How to use the node-project-validator.hasAnyDependencies function in node-project-validator

To help you get started, we’ve selected a few node-project-validator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bucharest-gold / szero / bin / cli.js View on Github external
const run = (options) => {
  const dir = options.directory;

  // validates the project.
  validator.hasPackageJson(dir, true);
  validator.hasAnyDependencies(dir, true);
  validator.hasNodeModules(dir, true);

  // ignores test directory by default.
  if (!options.dev) {
    options.ignore.push('test');
  }

  // all the require() found.
  const requireSet = new Set();

  // lists JS files.
  listJS(dir, options.ignore)
    .then((files) => {
      // searches the require() for each file.
      files.forEach((f) => {
        const src = fs.readFileSync(f);

node-project-validator

A basic Node.js project validator

MIT
Latest version published 2 years ago

Package Health Score

42 / 100
Full package analysis