From a817849947a7a47abffbc1f757f2ed0cd077c07b Mon Sep 17 00:00:00 2001 From: Svante Date: Tue, 6 Jun 2017 18:36:39 +0200 Subject: [PATCH] Better recognition of node commonJS resolves #391, tested with chrome, LTS node (6.10.3) and current node (8.0.0) --- papaparse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/papaparse.js b/papaparse.js index fdd8472..704f186 100644 --- a/papaparse.js +++ b/papaparse.js @@ -11,7 +11,7 @@ // AMD. Register as an anonymous module. define([], factory); } - else if (typeof module === 'object' && module.exports) + else if (typeof module === 'object' && typeof exports !== 'undefined') { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports,