Skip to content

Instantly share code, notes, and snippets.

@jothirnadh
Forked from tmcw/npm.txt
Created April 19, 2016 17:52
Show Gist options
  • Select an option

  • Save jothirnadh/c8077f21e570eec3fcc6c21b9828baf3 to your computer and use it in GitHub Desktop.

Select an option

Save jothirnadh/c8077f21e570eec3fcc6c21b9828baf3 to your computer and use it in GitHub Desktop.

Revisions

  1. @tmcw tmcw created this gist Apr 19, 2016.
    57 changes: 57 additions & 0 deletions npm.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    npm is a package manager. it's a website that keeps a big catalog of software
    that can be installed by anyone.

    some of that software you use directly, but other software you use as parts.

    software you use directly:

    "bin"

    software you use as a dependency:

    "main"

    --------------------------------------------------------------------------------

    npm works really well with GitHub, but isn't dependent on GitHub. when you
    publish a module to npm

    $ npm publish

    you upload a copy of that software to npmjs.org. When people install your module
    with npm

    $ npm install that-module

    they are downloading it from npmjs.org

    --------------------------------------------------------------------------------

    To install software with npm, you use the `install` method. This both downloads
    and installs the software. There are two ways to install software - one which
    makes it easy to include as a part of your application, and another that
    lets you use the software directly:

    You install software as part of your application like

    $ npm install chalk --save

    chalk is a module you use by including it in your program: it helps your program
    color text.

    And you install software to use yourself like

    $ npm install cli-weather -g

    cli-weather shows you the weather: after you install it, you get a new command
    line command called `weather` that tells you the weather.

    --------------------------------------------------------------------------------

    Let's install the weather

    $ npm install cli-weather -g

    Now run

    $ weather -a "Bangalore"