deep-resolve-cwd
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

deep-resolve-cwd

Resolve the path of a module through a sequence of packages from the current working directory

npm version Build Status

Installation

npm i -S deep-resolve-cwd

Usage

const deepResolveCwd = require('deep-resolve-cwd')
 
console.log(deepResolveCwd(['mos', 'chalk', './package.json']))
//> /home/zkochan/src/deep-resolve-from/node_modules/.registry.npmjs.org/chalk/1.1.3/node_modules/chalk/package.json

API

deepResolveCwd(moduleIds)

Like require(), throws when the module can't be found.

deepResolveCwd.silent(fromDir, moduleIds)

Returns null instead of throwing when the module can't be found.

moduleIds

Type: string[]

An array of module IDs, a module ID is something that you pass to require().

Related

  • deep-resolve-from - Resolve the path of a module through a sequence of packages
  • resolve-cwd - Resolve the path of a module like require.resolve() but from the current working directory

License

MIT © Zoltan Kochan

Package Sidebar

Install

npm i deep-resolve-cwd

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • zkochan