From 31a87c3661763cd43938b739cc9f5fdccf75cc93 Mon Sep 17 00:00:00 2001 From: Shawn Van Ittersum Date: Sun, 10 Sep 2017 22:06:08 -0700 Subject: [PATCH] Fix running-as-script check --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3d198cd..4494aa1 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ random.last = r(names) random.middle = r(middle) random.place = r(place) -if(!module.parent) { +if (require.main === module) { var l = process.argv[2] || 10 while (l--) console.log(random.first(), '.', random.middle(), '.', random.last()