npm-boilerplate-node-browser
v1.0.4
Published
Boilerplate for creating an NPM module for Node and browser environments
Readme
NPM Boilerplate Node Browser
Boilerplate for creating an NPM module for Node and browser environments.
Installation
$ npm install npm-boilerplate-node-browserCDN
The library is available over a CDN:
<script src="https://unpkg.com/npm-boilerplate-node-browser@latest/dist/npm-boilerplate-node-browser.umd.js"></script>
<!-- Or the minified version -->
<script src="https://unpkg.com/npm-boilerplate-node-browser@latest/dist/npm-boilerplate-node-browser.umd.min.js"></script>Usage
import foo from "npm-boilerplate-node-browser";
(async () => {
const result = foo("bar");
console.log(result);
})();API
foo(bar, [baz])Parameters
bar(String): Requires string.baz(optionalObject): Optional object, default to{}.
Returns
It returns a Promise which when resolved contains something.
Related
- npm-boilerplate-node: Boilerplate for creating an NPM module for Node environment.
License
Using the Boilerplate
Download the boilerpate:
wget https://github.com/risan/npm-boilerplate-node-browser/archive/master.zip \
-O master.zip && \
unzip master.zip && \
mv npm-boilerplate-node-browser-master my-package && \
rm master.zipToolings:
- Rollup for module bundler.
- Babel for transforming ES2015+ code.
- Jest for testing.
- ESLint for linting.
- Prettier for code formatting.
Available scripts:
npm run build: Run the module bundler.npm run lint: Run the linter.npm run lint-fix: Apply the linter fixes.npm run test: Run the tests.
Third-party services:
- Travis CI for continous integration.
- Codecov for test coverage report.
- Greenkeeper for automated dependency management.
