You wrote a sweet piece of code! Releasing it on NPM seems like the obvious next step. Right?
Try it! Not as easy to do as you might think. At high quality. From scratch.
So here's a plug-and-play NPM package template that offers the following features:
-
Tree-shakable support for the latest ES6 goodies with
eslint
uber alles. -
CJS distributions targeting specific browser support scenarios.
-
Command line interfaces for your widget with
commander
. -
Automated
lodash
cherry-picking withbabel-plugin-lodash
. -
mocha
&chai
for testing, with examples, and a sweet testing console. -
In-code access to
package.json
data, with no warnings to ignore. -
Code formatting at every save & paste with
prettier
. -
Automated documentation of your API with
jsdoc-to-markdown
and assembly of your README withconcat-md
. -
One-button release to GitHub & publish to NPM with
release-it
.
Click here for full documentation & instructions!
If you want to create a React component in an NPM package, use my React Component NPM Package Template instead!
Usage: mycli [options]
Foos your bar.
Options:
-b, --bar <string> foo what?
-h, --help display help for command
import { foo, PACKAGE_INFO } from '@karmaniverous/npm-package-template`;
Returns whatever value is passed.
Kind: global function
Returns: any
- Whatever value it was passed.
Param | Type | Description |
---|---|---|
value | any |
Any value. |
See more great templates and other tools on my GitHub Profile!