// set localStorage
localStorage.setItem('myKey', 'myValue');
// get localStorage
let value = localStorage.getItem('myKey');
console.log(value); // myValue
const fs = require('fs');
// write
fs.writeFile('myFile.txt', 'myValue', (err) => {
if (err) throw err;
console.log('The file has been saved!');
});
// read
fs.readFile('myFile.txt', 'utf8', (err, data) => {
if (err) throw err;
console.log(data); // myValue
});