Code Monkey home page Code Monkey logo

napa's Introduction

A helper for installing repos without a package.json with npm.

NPM

usage

Install with npm install napa --save-dev then setup your local package.json scripts as such:

{
  "scripts": {
    "install": "napa username/repo"
  }
}

Now when you run npm install it will git clone git://github.com/username/repo node_modules/repo.

Want to name the package something else?

{
  "scripts": {
    "install": "napa username/repo:adifferentname"
  }
}

Now it will install to node_modules/adifferentname.

Want to install a package not on github?

{
  "scripts": {
    "install": "napa git://example.com/user/repo:privatepackage"
  }
}

Multiple packages?

{
  "scripts": {
    "install": "napa user/repo1:dude user/repo2:rad user/repo3:cool"
  }
}

Prefer a more structured approach?

{
  "scripts": {
    "install": "napa"
  },
  "napa": {
    "foo": "username/repo",
    "bar": "[email protected]:user/repo"
  }
}

Looking to just download a tagged release/a branch/a specific commit on github or just a zip or tar.gz url?

{
  "scripts": {
    "install": "napa"
  },
  "napa": {
    "foo": "username/repo#v1.2.3",
    "bar": "username/bar#some-branch",
    "baz": "username/baz#347259472813400c7a982690acaa516292a8be40",
    "qoo": "https://example.com/downloads/release.tar.gz",
    "fuz": "git+https://yourcompany.com/repos/project.git",
    "goo": "git+ssh://yourcompany.com/repos/project.git"
  }
}

Additional configuration

The application currently supports the following configuration options under a napa-config property in package.json.

  • "cache" - Set to false to completely disable package caching.
  • "cache-path" - Override default cache path to a specific location(relative to the current working directory)
  • "directory" - Override default (node_modules) package path to a specific location(relative to the current working directory)
  • "log-level" - Set the log level (default is 'info', may also be 'silent', 'error', 'warn', 'verbose', or 'silly').
{
  "napa-config": {
    "cache": false,
    "cache-path": "../.napa-cache",
    "directory": "napa_modules",
    "log-level": "error"
  }
}

Release History

  • Please view https://github.com/shama/napa/commits/master for history.
  • 2.4.1 - Fix some readme typos
  • 2.4.0 - Add support for a "directory" option in napa-config.
  • 2.0.1 - Fix path must be a string error (@caseyWebb).
  • 2.0.0 - Better detection for github repos, fixes when creating a package.json, cached git #tag urls now get updated properly (@tomekwi). Add config options for disabling cache or setting cache path (@bbsbb). Fix for npm3 erroring when .git folder present (@caseyWebb). Updating dependencies.
  • 1.2.0 - Callback optional with cli and do not ignore .gitignore files when unpacking (@dai-shi).
  • 1.1.0 - Upgrade download for better downloads behind proxies (@msieurtoph).
  • 1.0.2 - Fix references to git specifiers. Thanks @jsdevel!
  • 1.0.1 - Fix path to cli.
  • 1.0.0 - Avoids duplicate installs and will install from cache.
  • 0.4.1 - Fix git reporting non-errors on stderr by running in quiet mode.
  • 0.4.0 - Add strip: 1 when downloading to avoid untarring within a sub-directory. Thanks @seei!
  • 0.3.0 - Ability to download packages using any URL
  • 0.2.0 - Ability to set packages using napa key in package.json
  • 0.1.1 - --depth 1 for faster cloning
  • 0.1.0 - initial release

License

Copyright (c) 2016 Kyle Robinson Young Licensed under the MIT license.

napa's People

Contributors

shama avatar caseywebb avatar jebaird avatar linkabi9 avatar djebbz avatar dai-shi avatar msieurtoph avatar tschaub avatar seei avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.