Skip to content

Latest commit

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

readme.md

rsolve npm

Resolve module path with custom entry point package.json field relative to caller file.

Install

$ yarn add rsolve

Usage

rsolve(id: string, fieldName: string) => Promise<string>
import { rsolve } from 'rsolve'

console.log(
  await rsolve('package', 'main')
)
console.log(
  await rsolve('@scope/package', 'browser')
)
console.log(
  await rsolve('../relative/path/to/package', 'react-native')
)