Skip to content

ellerbrock/npm-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

npm Workflow

Development, Build and Deployment

Javascript Open Source Love Gitter Chat

Status

Deadlink Test

Info: Greeen Build Status means there should be no Deadlinks in this List.
You can find the Testfiles on travis-deadlink-scanner.

Resources

Node.js Installation

nvm

For OS X and Linux User i recommend using the Node Version Manager nvm.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | bash

OS X

with curl

curl http://npmjs.org/install.sh | sh

or with Homebrew

`brew update && brew install node`

If you want to choose another node version (in this example the long-term support for node 4) you can do so:

brew tap homebrew/versions
brew install homebrew/versions/node4-lts
brew link --overwrite node4-lts

Linux

curl http://npmjs.org/install.sh | sudo sh

or on a apt based linux version via

apt-get update && apt-get install npm

Configuration

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

https://docs.npmjs.com/cli/adduser

Then create a package.json and publish it:

cd /path/to/your-project
npm init

npm install -g pakmanager
# this shows you dependencies as you `require`d them

pakmanager deps
# now edit `package.json` and add any deps you forgot about

npm publish ./

https://docs.npmjs.com/files/package.json

User Managment

https://docs.npmjs.com/cli/owner

  • npm owner add username package - add user to package
  • npm owner rm username package - remove user from package
  • npm owner ls username package - list users from package

Beta and Release versions

If you don't want something to install by default

npm publish ./ --tag beta https://docs.npmjs.com/cli/publish

If you published a bugfix as v1.0.7 and need to set v1.1.3 back to latest

https://docs.npmjs.com/cli/publish

git checkout v1.0.7
npm publish ./

git checkout v1.1.3
npm tag foobar@1.1.3 latest

https://git-scm.com/docs/git-checkout
https://docs.npmjs.com/cli/publish
https://docs.npmjs.com/cli/tag

Remove a package from the registry

npm unpublish package

Its considered bad behavior to remove versions of a library others depending ong. A better way to is to mark the package as deprecated

https://docs.npmjs.com/cli/unpublish

npm deprecate package

https://docs.npmjs.com/cli/deprecate

Social Media

Get the latest News about Web Development, Open Source, Tooling, Server & Security

TwitterFacebookGoogle+GitterGithub

License

Creative Commons License

This work by Maik Ellerbrock is licensed under a Creative Commons Attribution 4.0 International License.

About

🎉 Publishing NPM Packages for Developers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published