How to use the snyk-nodejs-lockfile-parser.LockfileType.npm function in snyk-nodejs-lockfile-parser

To help you get started, we’ve selected a few snyk-nodejs-lockfile-parser 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 snyk / snyk / src / lib / plugins / npm / index.ts View on Github external
throw new Error(`Detected a lockfile at location: ${lockFileFullPath}\nHowever the package.json is missing!`);
  }

  const [manifestFile, lockFile] = await Promise.all([
    await fs.readFile(manifestFileFullPath, 'utf-8'),
    await fs.readFile(lockFileFullPath, 'utf-8'),
  ]);

  const defaultManifestFileName = path.relative(root, manifestFileFullPath);
  const strictOutOfSync = _.get(options, 'strictOutOfSync') !== 'false';

  return await buildDepTree(
    manifestFile,
    lockFile,
    options.dev,
    LockfileType.npm,
    strictOutOfSync,
    defaultManifestFileName,
  );
}

snyk-nodejs-lockfile-parser

Generate a dep tree given a lockfile

Apache-2.0
Latest version published 2 days ago

Package Health Score

86 / 100
Full package analysis

Similar packages