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

    0.1.10 • 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.

    Install

    npm i @ffee/auto-import

    DownloadsWeekly Downloads

    11

    Version

    0.1.10

    License

    MIT

    Unpacked Size

    231 kB

    Total Files

    12

    Last publish

    Collaborators

    • lmtdgg