ghost-dep-check
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

Install

pnpm i ghost-dep-check

Usage

import { ghostDepCheck } from 'ghost-dep-check';

const config = {
  excludeAlias: ['js', '@', '@components'],
};

function check() {
  const directory = path.resolve('./');
  const pattern = `${directory}/src/**/*.+(vue|js|ts)`;
  glob(pattern, {
    ignore: [
      path.join(directory, '**/node_modules/**'),
    ],
  })
    .then(async files => {
      const pkgs = await ghostDepCheck(files, [path.join(directory, 'package.json')], config);

      if (pkgs.size) {
        console.log('The following deps maybe ghost deps: ', pkgs);
      } else {
        console.log('This project has no ghost dependencies.');
      }
    })
    .catch(err => {
      console.error('Error matching files:', err);
    });
}

check();

Preview

# in process
⠼  Checking files: 174/200 | 87% [============================================>      ]
# success
✔  Checking files: 200/200 | 100% [==================================================]
This project has no ghost dependencies.

Package Sidebar

Install

npm i ghost-dep-check

Weekly Downloads

1

Version

1.0.11

License

MIT

Unpacked Size

29.1 kB

Total Files

9

Last publish

Collaborators

  • luwuer