Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // read file
- var fs = require('fs');
- var path = require('path');
- fs.readFile(path.join(__dirname, '/data/customers.cvs'), {encoding: 'utf-8'}, function(err, data) {
- if (err) throw err;
- console.log(data);
- });
- // write file
- var fs = require('fs');
- fs.writeFile('message.txt', 'Hello world', function(err) {
- if (err) throw err;
- console.log('Writing is done');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement