duo-package
package downloader for duo
Last updated 4 years ago by stephenmathieson .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install duo-package 
SYNC missed versions from official npm registry.

Duo Package

NPM version build status

Duo's GitHub package installer.

Features

  • github-style urls
  • semver support
  • flexible api
  • checks local before fetching remote
  • private repo support

Example

var pkg = new Package('matthewmueller/cheerio', '0.13.x')
  .token(process.env.token)
  .directory('components');

pkg.fetch(function(err) {
  if (err) throw err;
  console.log('fetched: %s', pkg.slug());
})

API

Package(name, ref)

initialize a new Package with name and ref, where name is a github-style url and ref is either a tag or a branch. ref supports semver versioning.

Examples:

Package('matthewmueller/uid', '*');
Package('matthewmueller/uid', 'master');
Package('matthewmueller/uid', 'some/feature');
Package('matthewmueller/uid', '~0.1.0');

Package#token(token)

authenticate with github. you can create a new token here: https://github.com/settings/tokens/new.

Package#directory(dir)

set a directory to install the package in.

Package#cache(cache)

cache instance created by duo.

Package.path([path])

Get the path of the fetched package. optionally add a relative path.

Package.useragent([ua])

Get or set the user agent header duo-package uses to make requests. defaults to duo-package.

Package.resolve([fn])

Resolve a package's version

Package.fetch([fn])

fetch the package. returns a generator that can be yielded in a generator function or wrapped in co.

yield pkg.fetch()

Package.slug()

Return the full package name (ie. component/emitter@1.0.0)

Authors

License

The MIT License

Copyright © 2014

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 0.10.3                                ...           latest (4 years ago)

39 Versions

  • 0.10.3                                ...           4 years ago
  • 0.10.2                                ...           4 years ago
  • 0.10.1                                ...           4 years ago
  • 0.10.0                                ...           5 years ago
  • 0.9.0                                ...           5 years ago
  • 0.8.0                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.6.1                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.4                                ...           6 years ago
  • 0.3.3                                ...           6 years ago
  • 0.3.2                                ...           6 years ago
  • 0.3.1                                ...           6 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.13                                ...           6 years ago
  • 0.2.11                                ...           6 years ago
  • 0.2.10                                ...           6 years ago
  • 0.2.9                                ...           6 years ago
  • 0.2.8                                ...           6 years ago
  • 0.2.7                                ...           6 years ago
  • 0.2.6                                ...           6 years ago
  • 0.2.5                                ...           6 years ago
  • 0.2.4                                ...           6 years ago
  • 0.2.3                                ...           6 years ago
  • 0.2.2                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.10                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 80
Last Day 0
Last Week 39
Last Month 80
Dependencies (9)
Dev Dependencies (8)

Copyright 2014 - 2016 © taobao.org |