get-package-dir

2019-08-14

get-package-dir是什么

什么是get-package-dir,Get or create a npm package directory with installed dependencies

get-package-dir使用教程帮助文档

get-package-dir Build Status

Get or create a npm package directory with installed dependencies

Install

$ npm install --save get-package-dir

Usage

get-package-dir will pass through local paths. For npm package names, it will download the package into a temporary directory and install dependencies.

var getPackageDir = require('get-package-dir')

getPackageDir('./foo/bar')
//=> /absolute/path/to/foo/bar

getPackageDir('xtend')
//=> /absolute/path/to/installed/xtend

API

getPackageDir(name, [options], callback) -> undefined

name

Required Type: string

A package name or a path to a local package.

options
version

Type: string Default: ''

The package version to request (only applies to npm downloads).

cwd

Type: string Default: process.cwd()

The working directory from which to resolve paths.

callback

Required Type: function Arguments: err, directory

A callback that receives an absolute path to the package's directory.

License

MIT © Ben Drucker


上一篇:get-package
下一篇:browserify-size
相关文章

首次访问,人机识别验证

扫描下方二维码回复 1024 获取验证码,验证完毕后 永久 无须验证

操作步骤:[打开微信]->[扫描上侧二维码]->[关注 FedJavaScript 的微信] 输入 1024 获取验证码

验证码有误,请重新输入