Last active
January 2, 2018 14:07
-
-
Save msuzen/5e3852fd02adaff1048f6de3987a2e10 to your computer and use it in GitHub Desktop.
node.js read a text file to a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| By msuzen GPLv3 | |
| See Also: https://stackoverflow.com/questions/3133243/how-do-i-get-the-path-to-the-current-script-with-node-js | |
| */ | |
| var fs = require('fs'); | |
| var shapes = fs.readFile(process.cwd() + '/' + options.shapes, function(err, data) | |
| { | |
| if(err) | |
| console.log(err) | |
| else | |
| console.log(data.toString()); | |
| }); | |
| console.log(shapes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment