I've tried a few different npm packages that open files and I have the same issue with all of them.
https://www.npmjs.com/package/opn
https://www.npmjs.com/package/open
the problem: I am not able to open multiple html files on my hard drive at once. but when I try to open just one of them it works fine. any idea what's causing this issue?
This DOESN'T work (the web pages don't open in my browser):
var fs = require('fs');
var opn = require('opn');
fs.writeFile('open.html', 'hello');
fs.writeFile('open1.html', 'hello1');
fs.writeFile('open2.html', 'hello2');
fs.writeFile('open3.html', 'hello3');
fs.writeFile('open4.html', 'hello4');
fs.writeFile('open5.html', 'hello5');
console.log('files created');
opn('open.html');
opn('open1.html');
opn('open2.html');
opn('open3.html');
opn('open4.html');
opn('open5.html');
BUT the code below WORKS (the one web page opens fine in my browser):
var fs = require('fs');
var opn = require('opn');
fs.writeFile('open.html', 'hello');
console.log('file created');
opn('open.html');
opnseparately for each file you want to open?