@naretini/npm-hello-world

1.0.4 • Public • Published

Basics on How to publish packages to npm

  • create a npm account and login
npm login
unername: naretini
  • create npm project:
  mkdir npm-hello-world && cd $_
  npm init --scope=naretini
  • publish to npm (publicly): [ If your repository has a scope, you need to adjust the publish command ]
 npm publish --access public
  • create a repo on github and link to it:
   git init
   git remote add origin git@github.com:naretini/npm-hello-world.git

Best practice before (npm) publish:

Steps:

  • Run tests (if there are any)
  • Update version in package.json according to Semver
  • Create a git tag according to Semver
  • Push the package to Github
  • Push the package to npm
  • Create release notes for every update

Or use np [https://github.com/sindresorhus/np] - A better npm publish

 npm install --global np
 np --help
  • add repo info to package.json to publish release / tags on github
"repository": {
    "type": "git",
    "url": "git@github.com:naretini/npm-hello-world.git"
  }

Readme

Keywords

none

Package Sidebar

Install

npm i @naretini/npm-hello-world

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

2.17 kB

Total Files

4

Last publish

Collaborators

  • naretini