Access Local Files
Using the fs module to access local files
fs module to access local filesconst fs = require('fs');
// Read the file
fs.readFile('/path/to/file', (err, data) => {
if (err) throw err;
console.log(data);
});
// Write to the file
fs.writeFile('/path/to/file', 'hello world', (err) => {
if (err) throw err;
console.log('done');
});Use native dialogs to get file paths
Last updated