ff-stream-web

git clone git://archive.git.mtrnord.blog/MTRNord/ff-stream-web.git
Log | Files | Refs | README | LICENSE

commit a5b17530826e99fe8e33aa31787a72597231bb61
parent 55a1d21e92cbd3aa4dac9c49e04acad5c26b9cb6
Author: Evan <emjaksa@gmail.com>
Date:   Thu, 14 Jul 2016 23:43:49 -0400

Update tools/run.js to check if files are run directly from Node.js (#747)

* Update tools/run.js to check if files are run directly from Node.js

* Revert eslint rule comment

Diffstat:
Mtools/run.js | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/run.js b/tools/run.js @@ -26,7 +26,7 @@ function run(fn, options) { }); } -if (process.mainModule.children.length === 0 && process.argv.length > 2) { +if (require.main === module && process.argv.length > 2) { delete require.cache[__filename]; // eslint-disable-line no-underscore-dangle const module = require(`./${process.argv[2]}.js`).default; run(module).catch(err => console.error(err.stack));