https://github.com/indexzero/node-checkout
Pull down local or remote repositories to local directories.
https://github.com/indexzero/node-checkout
Last synced: about 1 year ago
JSON representation
Pull down local or remote repositories to local directories.
- Host: GitHub
- URL: https://github.com/indexzero/node-checkout
- Owner: indexzero
- License: mit
- Created: 2012-08-29T13:38:11.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2013-09-27T08:56:42.000Z (over 12 years ago)
- Last Synced: 2024-10-18T21:03:37.759Z (over 1 year ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 7
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# checkout
Simple unpacking of repositories to local directories.
## Git Repositories
``` js
checkout({
type: 'git',
url: 'git@github.com:bmeck/ruffian',
destination: 'my-apps/ruffian'
}, function (err) {
console.error(err)
});
```
## Streams from .tar files
``` js
checkout({
type: 'tar-stream',
stream: req,
destination: 'my-apps/ruffian'
}, function (err) {
console.error(err)
});
```
## Local directories
``` js
checkout({
type: 'directory',
directory: 'my-repos/ruffian',
destination: 'my-apps/ruffian'
}, function (err) {
console.error(err)
});
```
## npm packages
``` js
checkout({
type: 'npm',
package: 'ruffian',
version: '0.0.0',
destination: 'my-apps/ruffian',
//
// Optional
//
protocol: 'https',
proxy: 'http://outbound-proxy.com',
registry: 'registry.npmjs.org',
'strict-ssl': false,
headers: {
// Custom HTTP headers
'user-agent': 'node-checkout'
}
}, function (err) {
console.error(err)
})
```
## Custom Handler
``` js
checkout({
type: function (description, callback) {
// PERFORM THE CHECKOUT HERE
// @description matches the first argument to checkout
},
}, function (err) {
console.error(err)
})
```
## Registering a generic handler
``` js
checkout.handlers.myHandler = function (description, callback) {
// Same as Custom Handler
}
```