Browse Source

Add support for node module exports format

Backported from BabyParse
pull/172/head
Rob Dupuis 10 years ago
parent
commit
2d5c591d80
  1. 7
      papaparse.js

7
papaparse.js

@ -34,8 +34,13 @@
Papa.FileStreamer = FileStreamer; Papa.FileStreamer = FileStreamer;
Papa.StringStreamer = StringStreamer; Papa.StringStreamer = StringStreamer;
// export to Node...
if (typeof module !== 'undefined' && module.exports) {
module.exports = Papa;
}
// Wireup with RequireJS // Wireup with RequireJS
if (isFunction(global.define) && global.define.amd) else if (isFunction(global.define) && global.define.amd)
{ {
global.define(function() { return Papa; }); global.define(function() { return Papa; });
} }

Loading…
Cancel
Save