fly-import
v2.1.1
Published
Install and import packages on-the-fly
Downloads
1,176,746
Readme
fly-import
Install and import packages on-the-fly
Usage
Supports many different specifications.
import { flyImport } from 'fly-import';
const { flyImport: flyImport2 } = await flyImport('[email protected]');
const { flyInstall } = await 'fly-import2@npm:[email protected]';
console.log(await flyInstall('camelcase-git@github:sindresorhus/camelcase#v7.0.1'));Import a subpath of a package, resolved through its exports when it declares them:
import { flyImport } from 'fly-import';
const { customAlphabet } = await flyImport('nanoid@5', { subpath: 'non-secure' });Abort an install with a signal, which cancels its registry requests:
import { flyImport } from 'fly-import';
const { default: camelcase } = await flyImport('camelcase@8', { signal: AbortSignal.timeout(60_000) });Bins of installed packages are not linked, pass arboristConfig: { binLinks: true } to link them at <repositoryPath>/../bin (<repositoryPath> on Windows).
License
MIT
