mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 10:40:53 -04:00
39 lines
902 B
Markdown
39 lines
902 B
Markdown
# @pnpm/local-resolver
|
|
|
|
> Resolver for local packages
|
|
|
|
<!--@shields('npm')-->
|
|
[](https://www.npmjs.com/package/@pnpm/local-resolver)
|
|
<!--/@-->
|
|
|
|
## Installation
|
|
|
|
```
|
|
pnpm add @pnpm/local-resolver
|
|
```
|
|
|
|
## Usage
|
|
|
|
```js
|
|
'use strict'
|
|
const resolveFromLocal = require('@pnpm/local-resolver').default
|
|
|
|
resolveFromLocal({bareSpecifier: './example-package'}, {prefix: process.cwd()})
|
|
.then(resolveResult => console.log(resolveResult))
|
|
//> { id: 'link:example-package',
|
|
// normalizedBareSpecifier: 'link:example-package',
|
|
// package:
|
|
// { name: 'foo',
|
|
// version: '1.0.0',
|
|
// readme: '# foo\n',
|
|
// readmeFilename: 'README.md',
|
|
// description: '',
|
|
// _id: 'foo@1.0.0' },
|
|
// resolution: { directory: 'example-package', type: 'directory' }
|
|
// resolvedVia: 'local-filesystem' }
|
|
```
|
|
|
|
## License
|
|
|
|
MIT
|