const readline = require('readline');
const fs = require('fs');
// Create a reading-line handler
const rl = readline.createInterface({
input: fs.createReadStream('someFile'),
});
rl.on('line', (line) => {
console.log('the line is', line);
});
// In es6: map, set and its ops
let someSet = new Set();
someSet.add('so');
someSet.add('qqr');
if (someSet.has('so')) {
console.log('I have a set containing', 'so', '; and the set size is', someSet.size);
}
for (let key of someSet.values()) { // enumeration in insertion order
console.log(key);
}