reference-package v0.1.3
reference package
My reference npm package.
Specs
- Starter code in Typescript (for now).
- Tested on:
- npm 6.13.4
- node v10.19.0
Usage
Install cookiecutter
pip install cookiecutterCookie cut the template.
cookiecutter git@github.com:ardydedase/cookiecutter-npm-package.gitEnter the values accordingly. Pick a unique project name, it will be used as your npm package name. You can check if the package name is available in https://www.npmjs.com/.
Change the working directory to the generated folder, same name as the project slug.
cd <project_slug>
Development
Install dependencies
npm installRun build. This will generate the compiled code with type definitions in the
distfolder.npm run buildFormatting and linting.
npm run lint npm run formatRun tests
npm testBuild on top of the starter example in
srcfolder is a simple function that returns a string.
Publish package
Inside the generated folder, run the following commands:
If you don't have an npm account, create one on: https://www.npmjs.com/signup or run the command:
npm adduserIf you already have an account, login by running the following command:
npm loginWhen you're successfully logged-in. Publish the package:
npm publishYou should now be able to
npm installyour published package. There is an npm package called reference-package which is generated from this cookiecutter. There is a sample usage in example/index.js.