npm cheatsheet

아직 완성되지 않았습니다.

참고: http://blog.nodejitsu.com/npm-cheatsheet

npm cheatsheet

 

Installing npm

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

 

Update npm

npm을 업데이트는 여러가지 방법이 있다. 맘에드는 방법으로 선택하시면 됩니다.

$ curl http://npmjs.org/install.sh | sh
or
$ npm install npm -g

 

Search for npm packages

검색하기위해서는 패키지명을 알아야합니다. 또한 http://search.npmjs.org 에서도 정보를 볼 수 있습니다.

$ npm search <name>
$ npm search hook.io

 

View details of a npm package

지정한 패키지명에대한 상세정보를 볼 수 있습니다. 예를들어 이름, 설명, 버전, 작성자, contributors, dependencies 등 정보를 볼 수 있습니다.

$ npm view <name>
$ npm view hook.io

 

Installing a npm package locally

$ npm install <name>
$ npm install hook.io

 

Installing a npm package into an application

 

Understanding Global versus Local installs in npm

 

Global Package Installation

 

Uninstalling a package locally

 

Uninstalling a package globally

 

Installing a specific version of a package

 

Cloning a module from Github

 

Linking any npm package locally

 

Linking local npm packages to multiple applications

 

Unlinking a npm package from an application

 

Unlinking a npm package from your system

 

Create a new npm package

몇 가지 질문과 함께 package.json 생성을 도와주는 기능입니다.

$ mkdir mypackage/
$ cd mypackage/
$ npm init

 

Creating a new user account on npm

사용자를 추가하는 기능이며, username, password와 email을 입력받습니다. 암호를 잊었을 경우 http://admin.npmjs.org 에서 초기화도 가능합니다.

$ npm adduser
Username: xxxx
Password: xxxx
Email: xxxx

 

Publishing a npm package

registry에 배포할 수 있도록 하는 기능입니다.

$ cd mypackage/
$ npm publish

 

Unpublishing a npm package

publish된 패키지를 registry에서 삭제하는 기능입니다.

$ npm unpublish <name>
$ npm unpublish <name>[@<version>]

 

Managing owners of packages

About these ads

Tagged: ,

One thought on “npm cheatsheet

  1. Categorized « Dani's Notes 2011/12/19 at 00:11 Reply

    [...] npm cheatsheet [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

%d bloggers like this: