pkg-dep

1.3.0 • Public • Published

pkg-dep Build Status

Get package dependencies

Install

$ npm i pkg-dep

Example

const pkgDep = require('pkg-dep')
const {PkgDep} = require('pkg-dep')
const pkgDep = new PkgDep()

Methods

console.log(pkgDep.getSync())
pkgDep.get().then(res => console.log(res))
pkgDep.has('dot-prop').then(res => console.log(res))
console.log(pkgDep.hasSync('dot-prop'))

API

new pkgDep([options])

Returns a new instance.

pkgDep()

Returns a instance of module.

pkgDep.config([options])

Configure with options.

options

Type: Object

cwd

Type: string
Default: process.cwd()

Current working directory.

pkgDep.get()

Returns a Promise of dependencies object.

pkgDep.getSync()

Returns dependencies object.

pkgDep.has()

Returns a result(Promise) of typeof boolean whether a dependency exists or not.

pkgDep.hasSync()

Returns a result typeof boolean whether a dependency exists or not.

License

MIT © Joydip Roy (rjoydip)

Package Sidebar

Install

npm i pkg-dep

Weekly Downloads

0

Version

1.3.0

License

MIT

Unpacked Size

6.17 kB

Total Files

4

Last publish

Collaborators

  • rjoydip