1.0.1 • Published 2 years ago

sample-mathlib v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

1. publishing 1st NPM package

echo "# first-package" >> README.md git init git add README.md git commit -m "first commit" git branch -M master git remote add origin git@github.com:prashantvermaiiitb/first-package.git git push -u origin master

2. for the https

git remote add origin https://github.com/prashantvermaiiitb/first-package.git git branch -M master git push -u origin master

3. Creating NPM link for the package in test

npm link in the package directory, will create link for this package that way if you try to install from some where else then it will install from this location.

name of the package in package json is important.

  1. this will be used while publishing the package internally "npm link"
  2. this will be used when linking the package "npm link .."

4. How to publish the package

1. for this you should have account in NPM 2. Login from that account in NPM and verify that account. 3. Then come back in VScode or to the root directory of the package to be published. 4. Check npm whoami to see from which account you are logged in or non-logged in. 5. After that use npm login then press enter, then fill in the details for login credentials. 6. Command "npm publish" is used to publish the package. 7. Ensure that email id is verified , package name is unique or within scope before publishing to avoid 403 Forbidden error. 8. if all is fine then package is published. 9. To rollout a scoped package 1. initialise the NPM repo with scope "npm init --scope=@" example @babel 2. This will create a scoped package json either press ENTER key or write name for the package. 3. then publish it using 'npm publish --scope="publish"'