ardydedase / reference-package

Reference npm package from https://github.com/ardydedase/cookiecutter-npm-package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI

Reference Package

My reference npm package. Cookiecut from: https://github.com/ardydedase/cookiecutter-npm-package

Specs

  • Starter code in Typescript (for now).
  • Tested on:
    • npm 6.13.4
    • node v10.19.0

Usage

  1. Install cookiecutter

     pip install cookiecutter
    
  2. Cookie cut the template.

     cookiecutter git@github.com:ardydedase/cookiecutter-npm-package.git
    
  3. Enter 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/.

  4. Change the working directory to the generated folder, same name as the project slug.

     cd <project_slug>
    

Development

  1. Install dependencies

     npm install
    
  2. Run build. This will generate the compiled code with type definitions in the dist folder.

     npm run build
    
  3. Formatting and linting.

     npm run lint
     npm run format
    
  4. Run tests

     npm test
    
  5. Build on top of the starter example in src folder is a simple function that returns a string.

Publish package

Inside the generated folder, run the following commands:

  1. If you don't have an npm account, create one on: https://www.npmjs.com/signup or run the command: npm adduser

  2. If you already have an account, login by running the following command:

     npm login
    
  3. When you're successfully logged-in. Publish the package:

     npm publish
    
  4. You should now be able to npm install your 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.

About

Reference npm package from https://github.com/ardydedase/cookiecutter-npm-package.


Languages

Language:TypeScript 100.0%