Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitovi/engine-dependencies
Install npm dependencies based on what version of Node you are using
https://github.com/bitovi/engine-dependencies
Last synced: about 5 hours ago
JSON representation
Install npm dependencies based on what version of Node you are using
- Host: GitHub
- URL: https://github.com/bitovi/engine-dependencies
- Owner: bitovi
- License: mit
- Created: 2015-08-26T19:31:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-17T18:29:35.000Z (over 6 years ago)
- Last Synced: 2024-09-19T16:36:22.264Z (about 2 months ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 3
- Watchers: 51
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/bitovi/engine-dependencies.svg?branch=master)](https://travis-ci.org/bitovi/engine-dependencies)
[![Build status](https://ci.appveyor.com/api/projects/status/yq4n7uwqj81osd5y/branch/master?svg=true)](https://ci.appveyor.com/project/matthewp/engine-dependencies/branch/master)
[![npm version](https://badge.fury.io/js/engine-dependencies.svg)](http://badge.fury.io/js/engine-dependencies)# engine-dependencies
Specify package dependencies based on what version of Node you are using. Useful if you're trying to support Node 0.10.x, 0.12.x and IO.js.
## CLI
You can use engine-dependencies within your process as a post-install script. Just define your dependencies in the `engineDependencies` field of your package.json:
```json
{
"name": "my-lib",
"version": "1.0.0",
"engineDependencies": {
"node": {
"0.12.x": {
"devDependencies": {
"semver": "^1.0.0"
}
}
},
"iojs": {
"^3.0.0": {
"semver": "2.0.0"
}
}
}
...
}
```And then add to your scripts:
```json
{
"name": "my-lib",
"version": "1.0.0",
"scripts": {
"postInstall": "install-engine-dependencies my-lib"
}
...
}
```## Node API
```js
engineDependencies({
"node": {
"0.10.x": {
"devDependencies": {
"jquery": "1.8.0"
}
},
"0.12.x": {
"jquery": "^1.11.2"
}
},
"iojs": {
"^3.0.0": {
"devDependencies": {
"jquery": "2.1.4"
}
}
}
}, function(err){
// all done
});
```## License
MIT