A template for writing distributable front-end javascript modules.
A template for writing distributable javascript libraries.
Javascript libraries are fun to write. Setting up all of the boilerplate to get your build up and running is not so fun.
This module provides a forkable module template, which you can use to kick-start a new javascript library. Once you've done that, feel free to come back and switch out the tooling for whatever you prefer.
npm run setup
./src
and writing tests in ./tests
npm run build
npm run build
Edit tests in ./test/tests
Run the tests:
npm run test
npm run karma -- --browser=PhantomJS
npm run karma -- --browser=Chrome
npm run karma -- --browser=Safari
npm run karma -- --browser=Firefox
npm run karma -- --browser=PhantomJS,Chrome,Safari,Firefox
npm run karma -- --browser=Chrome --keep-open
./src
, ./test/tests
and ./demo
package.json
README.md
and CONTRIBUTING.md
npm run release
to add a patch
npm run release:path
, npm run release:minor
, npm run release:major
Who is this for?
Who this is not for?
Why use technology X/Y/Z?
Probably because it's been a good fit for us in the past. We wanted our focus to be around (fairly) standardized javascript as much as possible, rather than compiled-to-javascript languages, hence the use of babel, flow, etc.
So you just took a bunch of build-tools and daisy-chained them together?
Yep, pretty much. This is not anything remotely technically impressive, or new, or innovative. It's just a healthy set of defaults to get started with if you're building a front-end distributable library.
Can I improve this template?
By all means, please feel to raise a PR, but if it's a big change, try to open an issue first so we can chat!
What about support for React, Ember, framework X or Y?
Wanted to keep this module as framework-agnostic as possible. Not to mention there are already pretty good boilerplates out there for whatever framework you're using, I'll bet. Otherwise please feel free to be my guest and fork grumbler-superawesomeframework
if it's helpful.