snyk-nodejs-lockfile-parser

  • Version 1.37.1
  • Published
  • 94.9 kB
  • 15 dependencies
  • Apache-2.0 license

Install

npm i snyk-nodejs-lockfile-parser
yarn add snyk-nodejs-lockfile-parser
pnpm add snyk-nodejs-lockfile-parser

Overview

Generate a dep tree given a lockfile

Index

Functions

function buildDepGraphFromCliOutput

buildDepGraphFromCliOutput: (
rawCliOutput: string,
lockfileContent: string,
manifestFileContent: string
) => any;

    function buildDepTree

    buildDepTree: (
    manifestFileContents: string,
    lockFileContents: string,
    includeDev?: boolean,
    lockfileType?: LockfileType,
    strictOutOfSync?: boolean,
    defaultManifestFileName?: string
    ) => Promise<PkgTree>;

      function buildDepTreeFromFiles

      buildDepTreeFromFiles: (
      root: string,
      manifestFilePath: string,
      lockFilePath: string,
      includeDev?: boolean,
      strictOutOfSync?: boolean
      ) => Promise<PkgTree>;

        function getYarnLockfileType

        getYarnLockfileType: (
        lockFileContents: string,
        root?: string,
        lockFilePath?: string
        ) => LockfileType;

          function getYarnWorkspaces

          getYarnWorkspaces: (targetFile: string) => string[] | false;

            function getYarnWorkspacesFromFiles

            getYarnWorkspacesFromFiles: (
            root: any,
            manifestFilePath: string
            ) => string[] | false;

              Classes

              class InvalidUserInputError

              class InvalidUserInputError extends Error {}

                constructor

                constructor(...args: any[]);

                  property code

                  code: number;

                    property name

                    name: string;

                      class OutOfSyncError

                      class OutOfSyncError extends Error {}

                        constructor

                        constructor(dependencyName: string, lockFileType: LockfileType);

                          property code

                          code: number;

                            property dependencyName

                            dependencyName: string;

                              property lockFileType

                              lockFileType: string;

                                property name

                                name: string;

                                  class UnsupportedRuntimeError

                                  class UnsupportedRuntimeError extends Error {}

                                    constructor

                                    constructor(...args: any[]);

                                      property code

                                      code: number;

                                        property name

                                        name: string;

                                          Interfaces

                                          interface ManifestFile

                                          interface ManifestFile {}

                                            property dependencies

                                            dependencies?: ManifestDependencies;

                                              property devDependencies

                                              devDependencies?: ManifestDependencies;

                                                property engines

                                                engines?: {
                                                node?: string;
                                                };

                                                  property name

                                                  name: string;

                                                    property optionalDependencies

                                                    optionalDependencies?: ManifestDependencies;

                                                      property peerDependencies

                                                      peerDependencies?: ManifestDependencies;

                                                        property private

                                                        private?: string;

                                                          property resolutions

                                                          resolutions?: ManifestDependencies;

                                                            property version

                                                            version?: string;

                                                              property workspaces

                                                              workspaces?: string[] | WorkspacesAlternateConfig;

                                                                interface PkgTree

                                                                interface PkgTree extends DepTreeDep {}

                                                                  property cyclic

                                                                  cyclic?: boolean;

                                                                    property dependencies

                                                                    dependencies: {
                                                                    [depName: string]: DepTreeDep;
                                                                    };

                                                                      property hasDevDependencies

                                                                      hasDevDependencies?: boolean;

                                                                        property meta

                                                                        meta?: {
                                                                        nodeVersion?: string;
                                                                        lockfileVersion?: number;
                                                                        packageManager?: string;
                                                                        };

                                                                          property packageFormatVersion

                                                                          packageFormatVersion?: string;

                                                                            property size

                                                                            size?: number;

                                                                              property type

                                                                              type?: string;

                                                                                Enums

                                                                                enum LockfileType

                                                                                enum LockfileType {
                                                                                npm = 'npm',
                                                                                npm7 = 'npm7',
                                                                                yarn = 'yarn',
                                                                                yarn2 = 'yarn2',
                                                                                }

                                                                                  member npm

                                                                                  npm = 'npm'

                                                                                    member npm7

                                                                                    npm7 = 'npm7'

                                                                                      member yarn

                                                                                      yarn = 'yarn'

                                                                                        member yarn2

                                                                                        yarn2 = 'yarn2'

                                                                                          enum Scope

                                                                                          enum Scope {
                                                                                          prod = 'prod',
                                                                                          dev = 'dev',
                                                                                          }

                                                                                            member dev

                                                                                            dev = 'dev'

                                                                                              member prod

                                                                                              prod = 'prod'

                                                                                                Package Files (6)

                                                                                                Dependencies (15)

                                                                                                Dev Dependencies (15)

                                                                                                Peer Dependencies (0)

                                                                                                No peer dependencies.

                                                                                                Badge

                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/snyk-nodejs-lockfile-parser.

                                                                                                • Markdown
                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/snyk-nodejs-lockfile-parser)
                                                                                                • HTML
                                                                                                  <a href="https://www.jsdocs.io/package/snyk-nodejs-lockfile-parser"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>