Skip to content

Commit

Permalink
ESM support
Browse files Browse the repository at this point in the history
fixes mholt#977
  • Loading branch information
btakita committed Mar 1, 2023
1 parent ff8ae31 commit c32ee47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions papaparse.js
Expand Up @@ -10,18 +10,21 @@ License: MIT
/* globals define */
if (typeof define === 'function' && define.amd)
{
console.debug('papaparse.js|amd|debug|1')
// AMD. Register as an anonymous module.
define([], factory);
}
else if (typeof module === 'object' && typeof exports !== 'undefined')
{
console.debug('papaparse.js|exports|debug|1')
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
}
else
{
console.debug('papaparse.js|root.Papa|debug|1')
// Browser globals (root is window)
root.Papa = factory();
}
Expand Down

0 comments on commit c32ee47

Please sign in to comment.