get-package-dir

2019-08-14 admin

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

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

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

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

文章标题:get-package-dir

回到顶部