Guest User

Untitled

a guest
Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var fs = require("fs"),
  2. coffeescript = require("coffee-script");
  3.  
  4. var json_as_coffeescript_to_json = function (string, callback) {
  5. string = coffeescript.compile(string, {bare: true});
  6. callback(JSON.parse(string.substr(1, string.length - 3)));
  7. };
  8.  
  9. fs.readFile("./configuration.coffee", "utf8", function (error, file) {
  10. if (error) throw error;
  11. json_as_coffeescript_to_json(file, function (json) {
  12. console.log(json)
  13. });
  14. });
Add Comment
Please, Sign In to add comment