Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fs = require("fs"),
- coffeescript = require("coffee-script");
- var json_as_coffeescript_to_json = function (string, callback) {
- string = coffeescript.compile(string, {bare: true});
- callback(JSON.parse(string.substr(1, string.length - 3)));
- };
- fs.readFile("./configuration.coffee", "utf8", function (error, file) {
- if (error) throw error;
- json_as_coffeescript_to_json(file, function (json) {
- console.log(json)
- });
- });
Add Comment
Please, Sign In to add comment