How to use the node-project-validator.hasDependencies 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 nodeshift / license-reporter / lib / commands / report.cmd.js View on Github external
exports.handler = (argv) => {
  npv.hasPackageJson(argv.cwd, true);
  npv.hasDependencies(argv.cwd, true);

  if (npv.hasNodeModules(argv.cwd, false)) {
    let canonicalNameMapper;
    if (fs.existsSync(argv.nm)) {
      const mappings = canonicalName.loadNameMapperFile(argv.nm);
      canonicalNameMapper = canonicalName.init(mappings);
    } else {
      console.error(`File not found: ${argv.nm}`);
      process.exit(1);
    }

    if (fs.existsSync(argv.ul)) {
      validator.validate(argv.ul);
      unifiedList.load(argv.ul);
    } else {
      console.error(`File not found: ${argv.ul}`);
github nodeshift / license-reporter / lib / commands / save.cmd.js View on Github external
exports.handler = (argv) => {
  npv.hasPackageJson(argv.cwd, true);
  npv.hasDependencies(argv.cwd, true);

  if (npv.hasNodeModules(argv.cwd, false)) {
    let canonicalNameMapper;
    if (fs.existsSync(argv.nm)) {
      const mappings = canonicalName.loadNameMapperFile(argv.nm);
      canonicalNameMapper = canonicalName.init(mappings);
    } else {
      console.error(`File not found: ${argv.nm}`);
      process.exit(1);
    }

    if (fs.existsSync(argv.ul)) {
      validator.validate(argv.ul);
      unifiedList.load(argv.ul);
    } else {
      console.error(`File not found: ${argv.ul}`);
github nodeshift / license-reporter / lib / commands / console.cmd.js View on Github external
exports.handler = (argv) => {
  npv.hasPackageJson(argv.cwd, true);
  npv.hasDependencies(argv.cwd, true);

  if (npv.hasNodeModules(argv.cwd, false)) {
    let canonicalNameMapper;
    if (fs.existsSync(argv.nm)) {
      const mappings = canonicalName.loadNameMapperFile(argv.nm);
      canonicalNameMapper = canonicalName.init(mappings);
    } else {
      console.error(`File not found: ${argv.nm}`);
      process.exit(1);
    }

    if (fs.existsSync(argv.ul)) {
      validator.validate(argv.ul);
      unifiedList.load(argv.ul);
    } else {
      console.error(`File not found: ${argv.ul}`);

node-project-validator

A basic Node.js project validator

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis