1 2 3 4 5 6 7 8 9 10 11 12 13 14
// read in pi, ../10000.pi.txt const fs = require('fs'); fs.readFile('../10000.pi.txt', 'utf8', (err, data) => { if (err) { console.error(err); return; } const string_pi = data; const big_pi = parseFloat(data); console.log(big_pi); });