自动安装 npm
包
- 支持
esmodule
模块 - 支持
npm
,yarn
和pnpm
管理器
pnpm i autoinstall-pkg
aip -h
import { autoInstallPkg } from "autoinstall-pkg"
autoInstallPkg() // 将扫描当前工作目录的 src 下的所有 ts 模块引入
// src/index.ts
import Koa from 'koa' // 引入模块不存在时将触发自动安装
Made with markthree
Published under MIT License.