Skip to content

Instantly share code, notes, and snippets.

@EliEladElrom
Last active December 17, 2015 06:09
Show Gist options
  • Save EliEladElrom/5563485 to your computer and use it in GitHub Desktop.
Save EliEladElrom/5563485 to your computer and use it in GitHub Desktop.
NPM / Bower quick reference

NPM

Quick reference to publish to NPM:

vim package.json

{ "name": "roomsjs", "version": "0.0.21", "description": "Real Time Communication and Collaboration", "main": "index.js", "scripts": { "test": "listenToRoomEvents" }, "repository": { "type": "git", "url": "https://github.com/EladElrom/RoomsJS.git" }, "keywords": [ "roomsjs", "rooms", "collaboration", "" ], "author": "Elad Elrom", "license": "BSD" }

Than:

npm publish

Bower

Publish bower component:

  1. Create your package’s component.json file:

bower init

  1. Run Bower register yourpackagename

Bower register yourpackagename git://github.com/eladelrom/repositoryname

Example file

{
  "name": "somelib",
  "version": "0.0.30",
  "main": "somelib.js",
  "ignore": [
    "**/.*",
    "node_modules",
    "components"
  ]
}

To create symlink:

At the project you want to use

npm link

Than at the project you want to use it in:

npm link [project-name]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment