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

1.1.0 • Public • Published

deep-resolve-from

Resolve the path of a module through a sequence of packages

npm version Build Status

Installation

npm i -S deep-resolve-from

Usage

'use strict'
const deepResolveFrom = require('deep-resolve-from')

console.log(deepResolveFrom(process.cwd(), ['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

deepResolveFrom(fromDir, moduleIds)

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

deepResolveFrom.silent(fromDir, moduleIds)

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

fromDir

Type: string

Directory to resolve from.

moduleIds

Type: string[]

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

Related

  • resolve-from - Resolve the path of a module like require.resolve() but from a given path

License

MIT © Zoltan Kochan

Package Sidebar

Install

npm i deep-resolve-from

Weekly Downloads

109

Version

1.1.0

License

MIT

Last publish

Collaborators

  • zkochan