Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcuslilja/76fd22c0b45c9830cb2c to your computer and use it in GitHub Desktop.
Save marcuslilja/76fd22c0b45c9830cb2c to your computer and use it in GitHub Desktop.

Revisions

  1. marcuslilja created this gist Aug 10, 2015.
    18 changes: 18 additions & 0 deletions how-to-create-a-local-scoped-npm-module.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    # How to create a local scoped npm module

    1. The main file of the module should be named `index.js`.
    2. Initialize the module by running `npm init --scope=<your-scope>`.
    3. Install local module with `npm install --save <path-to-module>`.

    ## Example

    Local module resides in `lib/custom-module`, the scope of the module should be `marcuslilja`.

    1. Run `npm init --scope=marcuslilja` in `lib/custom-module`.
    2. Run `npm install --save lib/custom-module`.

    ```javascript

    var customModule = require('@marcuslilja/custom-module');

    ```