rsolve
v0.2.1
Published
Resolve module path with custom entry point `package.json` field relative to caller file
Downloads
299,922
Readme
rsolve
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')
)