@ffee/auto-import
TypeScript icon, indicating that this package has built-in type declarations

0.1.11 • Public • Published

auto-import.js

A tool for automatically update and import NPM module

npm version Build Status Code Coverage

Usage

Install

npm i @ffee/auto-import --save

AutoImport.require

Require the node module. If the module is not installed, install it automatically before loading it.

const AutoImport = require('@ffee/auto-import');

AutoImport.require('koa').then(koa => {
  const app = new koa();
  app.use(async ctx => {
    ctx.body = 'Hello World!';
  });

  app.listen(3000);
});

AutoImport.checkModuleUpdateStatus

Check whether the NPM module needs to be updated.

const AutoImport = require('@ffee/auto-import');

AutoImport.checkModuleUpdateStatus('koa').then(res => {
  console.log(res);
  // {
  //   name: 'koa',
  //   status: false,
  //   message: 'koa had not expired, return current...'
  // }
});

LICENSE

MIT.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.11
    0
    • latest

Version History

Package Sidebar

Install

npm i @ffee/auto-import

Weekly Downloads

0

Version

0.1.11

License

MIT

Unpacked Size

231 kB

Total Files

12

Last publish

Collaborators

  • lmtdgg