drive-resolve

Asynchronous require resolution in Hyperdrive

Apache-2.0 6 个版本
安装
npm install drive-resolve
yarn add drive-resolve
pnpm add drive-resolve
bun add drive-resolve
README

drive-resolve

Asynchronous require resolution in Hyperdrive.

npm install drive-resolve

Usage

const resolve = require('drive-resolve')

const resolved = await resolve(drive, 'bar')
// => /path/to/bar/index.js

API

const resolved = async resolve(drive, specifier[, options])

options include:

{
  basedir: string, // directory to begin resolving from
  extensions: [],   // array of extensions to search
  conditions: [], // array of import conditions
  sourceOverwrites: {} // source overwrites key-value map (file -> source)
  imports: // An additional "imports" map to apply to all specifiers. Follows the same syntax and rules as the "imports" property defined in `package.json`.
}

const prebuilds = async resolve.prebuilds(drive, basedir)

Returns closest bare/node prebuilds from basedir.

License

Apache-2.0

版本列表
1.3.1 2024-02-02
1.3.0 2024-01-30
1.2.0 2024-01-06
1.1.0 2023-12-13
1.0.2 2023-12-12
1.0.1 2023-12-12