engine-dependencies

2019-02-12 admin

engine-dependencies是什么

什么是engine-dependencies,Install different versions of dependencies depending on which version of Node you are using

engine-dependencies使用教程帮助文档

Build Status Build status npm version

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:

{
	"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:

{
	"name": "my-lib",
	"version": "1.0.0",
	"scripts": {
		"postInstall": "install-engine-dependencies my-lib"
	}
	...
}

Node API

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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-53579.html

文章标题:engine-dependencies

回到顶部