From 2d5c591d8084f8424f14895f66e1ed54631226cf Mon Sep 17 00:00:00 2001 From: Rob Dupuis Date: Wed, 18 Feb 2015 17:28:49 +0000 Subject: [PATCH] Add support for node module exports format Backported from BabyParse --- papaparse.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/papaparse.js b/papaparse.js index 823e870..88d06db 100644 --- a/papaparse.js +++ b/papaparse.js @@ -34,8 +34,13 @@ Papa.FileStreamer = FileStreamer; Papa.StringStreamer = StringStreamer; + // export to Node... + if (typeof module !== 'undefined' && module.exports) { + module.exports = Papa; + } + // Wireup with RequireJS - if (isFunction(global.define) && global.define.amd) + else if (isFunction(global.define) && global.define.amd) { global.define(function() { return Papa; }); }