A base package for creating NPM packages with ES2015.
Writing in ES2015 is an amazing experience. Setting up babel and the development environment in a kind of a pain.
If you want to write a NPM module in ES2015 and publish to NPM with backward compatibility, this is the easiest way.
- Simply clone this project.
- Change the
package.jsonas you want.
lib/index.jsin your entry point.
- Then publish to npm via
- ESLINT support is added to the project.
- It's configured for ES2015 and inherited configurations from graphql/graphql-js.
npm run lintto lint your code and
npm run lintfixto fix common issues.
- You can write test under
__test__directory anywhere inside
- Then run
npm testto test your code. (It'll lint your code as well).
- You can also run
npm run testonlyto run tests without linting.
- ES2015 support is added with babel6.
- After you publish your project to NPM, it can be run on older node versions and browsers without the support of Babel.
- This project uses ES2015 and some of the upcoming features like
- You can change them with adding and removing presets.
- All the polyfills you use are taken from the local
babel-runtimepackage. So, this package won't add any global polyfills and pollute the global namespace.
- Babel6 and the team behind it.
- Facebook's graphql-js authors for ESLint configurations and for the directory structure.