This is a basic project template for creating and publishing an (Unscoped) npm package. To add organization or user scope, change the name in package.json from js-stage
to @scope/js-stage
https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c
https://www.npmjs.com/package/js-stage
npm install full-path-to-package-directory
npm login
npm version patch
npm publish
This command will publish publicly for unscoped package, and privately for scoped package by default. To explicitly specifying the access level, use this command:
npm publish --access=public
npm unpublish js-stage -f
npm install js-stage
- Add
import {Greeter} from 'js-stage';
to the top of the file - Calling
Greeter("zakhan4")
returns"Hello zakhan4"