Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Add CommonJS / NPM support #79

Merged
merged 1 commit into from
Jan 21, 2016
Merged

Add CommonJS / NPM support #79

merged 1 commit into from
Jan 21, 2016

Conversation

felixfbecker
Copy link
Contributor

This adds CommonJS support to this module by detecting the presence of module.exports, and if it exists, exporting the factory function instead of calling it on the global Highcharts object. This is in line with how the Highcharts exporting module is used in CommonJS.

It also adds a package.json, if this PR gets accepted please publish this module on NPM.

  • I prefixed the name with highcharts- since it is a plugin
  • I added highcharts as peerDependency since that is how version constraints for plugins should be defined. The homepage mentions at least 3.0 is required, so I set the version constraint between 3.0 and the next major version.
  • I took the version from the manifest.json (1.3.8), even though the homepage actually says 1.3.6
  • I took the description from the homepage (first sentence)

This allows one to require('highcharts-export-csv')(Highcharts) in a CommonJS environment like Browerify. Global use is still supported.

@TorsteinHonsi
Copy link
Contributor

Thanks!

TorsteinHonsi added a commit that referenced this pull request Jan 21, 2016
@TorsteinHonsi TorsteinHonsi merged commit 2210b5d into highcharts:master Jan 21, 2016
@felixfbecker
Copy link
Contributor Author

Awesome. And don't forget to npm publish :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants