{
  "_args": [
    [
      {
        "raw": "snyk-resolve-deps@1.7.0",
        "scope": null,
        "escapedName": "snyk-resolve-deps",
        "name": "snyk-resolve-deps",
        "rawSpec": "1.7.0",
        "spec": "1.7.0",
        "type": "version"
      },
      "/build/npm-check-updates/pkg/npm-check-updates/usr/lib/node_modules/npm-check-updates/node_modules/snyk"
    ]
  ],
  "_from": "snyk-resolve-deps@1.7.0",
  "_id": "snyk-resolve-deps@1.7.0",
  "_inCache": true,
  "_location": "/npm-check-updates/snyk-resolve-deps",
  "_nodeVersion": "5.9.1",
  "_npmOperationalInternal": {
    "host": "packages-12-west.internal.npmjs.com",
    "tmp": "tmp/snyk-resolve-deps-1.7.0.tgz_1459431095631_0.46538650849834085"
  },
  "_npmUser": {
    "name": "snyk-admin",
    "email": "admin+snyk@snyk.io"
  },
  "_npmVersion": "3.7.3",
  "_phantomChildren": {},
  "_requested": {
    "raw": "snyk-resolve-deps@1.7.0",
    "scope": null,
    "escapedName": "snyk-resolve-deps",
    "name": "snyk-resolve-deps",
    "rawSpec": "1.7.0",
    "spec": "1.7.0",
    "type": "version"
  },
  "_requiredBy": [
    "/npm-check-updates/snyk"
  ],
  "_resolved": "https://registry.npmjs.org/snyk-resolve-deps/-/snyk-resolve-deps-1.7.0.tgz",
  "_shasum": "13743a058437dff890baaf437c333c966a743cb6",
  "_shrinkwrap": null,
  "_spec": "snyk-resolve-deps@1.7.0",
  "_where": "/build/npm-check-updates/pkg/npm-check-updates/usr/lib/node_modules/npm-check-updates/node_modules/snyk",
  "author": {
    "name": "Remy Sharp"
  },
  "bin": {
    "snyk-resolve": "./cli/index.js"
  },
  "bugs": {
    "url": "https://github.com/Snyk/resolve-deps/issues"
  },
  "dependencies": {
    "abbrev": "^1.0.7",
    "ansicolors": "^0.3.2",
    "clite": "^0.3.0",
    "debug": "^2.2.0",
    "es6-promise": "^3.0.2",
    "lodash": "^4.0.0",
    "lru-cache": "^4.0.0",
    "minimist": "^1.2.0",
    "semver": "^5.1.0",
    "snyk-module": "^1.6.0",
    "snyk-resolve": "^1.0.0",
    "snyk-tree": "^1.0.0",
    "snyk-try-require": "^1.1.1",
    "then-fs": "^2.0.0"
  },
  "description": "Resolves a node package tree with combined support for both npm@2 and npm@3.",
  "devDependencies": {
    "jscs": "^2.8.0",
    "proxyquire": "^1.7.4",
    "semantic-release": "^4.3.5",
    "sinon": "^1.17.3",
    "snyk-resolve-deps-fixtures": "^1.1.6",
    "tap": "^5.1.1",
    "tap-only": "0.0.5",
    "tape": "^4.4.0"
  },
  "directories": {
    "test": "test"
  },
  "dist": {
    "shasum": "13743a058437dff890baaf437c333c966a743cb6",
    "tarball": "https://registry.npmjs.org/snyk-resolve-deps/-/snyk-resolve-deps-1.7.0.tgz"
  },
  "gitHead": "83fa9ef5d6762674ae55e35b1624d01ff7d6392c",
  "homepage": "https://github.com/Snyk/resolve-deps#readme",
  "license": "Apache-2.0",
  "main": "lib/index.js",
  "maintainers": [
    {
      "name": "remy",
      "email": "remy@leftlogic.com"
    },
    {
      "name": "snyk-admin",
      "email": "admin+snyk@snyk.io"
    }
  ],
  "name": "snyk-resolve-deps",
  "optionalDependencies": {},
  "readme": "# snyk-resolve-deps\n\nThis package will create a virtual tree representation of a node package's dependencies, supporting *both* npm@2 and npm@3 directory structures.\n\nNote that the output differs from the `npm ls` output in that deduped packages are resolved to their owners.\n\n## Programatical usage\n\n```js\nvar resolveDeps = require('snyn-resolve-deps');\nvar asTree = require('snyk-tree');\n\nresolveDeps(process.cwd(), { dev: true }).then(function (tree) {\n  console.log(asTree(tree));\n}).catch(function (error) {\n  // error is usually limited to unknown directory\n  console.log(error.stack);\n  process.exit(1);\n});\n```\n\n## CLI usage\n\nNote that the installed module name differs from the CLI tool (no `-deps` on the end).\n\n```bash\n$ npm install -g snyk-resolve-deps\n$ snyk-resolve path-to-node-project\n```\n\nThe CLI also supports the `--dev` (or `-d`) flag to include dev dependencies and an optional `--json` to show the output as JSON instead of the ascii tree.\n\n## How it works\n\nTo fully support npm@2 and npm@3 two passes of the tree are required:\n\n### 1. The physical pass on the directory structure\n\nThe module will start by reading the `package.json` from the target directory, capture the metadata and then read through each recursive `node_modules` directory.\n\nThis creates the `physicalTree` object. In npm@3 this will usually yield an object with the root metadata (name, version, etc) and then a `dependencies` object that contains *every* dependency across the entire code base. This is not the true representation of the package relationships so we need to make the second pass.\n\nThere are also edge cases that need to be handled, particularly when a dev or prod dependency hasn't been loaded into the physical tree because it has been missed. This can be either because the package is missing from the project, or (more likely) because the dependencies is much higher up and outside of the original directory that was scanned. So a second check is run to find those missing modules, using the [snyk-resolve](https://www.npmjs.com/package/snyk-resolve) module.\n\n*Note: code found in `lib/deps.js`*\n\n### 2. The virtual pass using package metadata\n\nThe next pass uses the `physicalTree` as the starting point, but uses the `dependencies` and `devDependencies` properties from the `package.json` metadata. It will iterate through the dependencies and resolve the correct dependency package from the physical tree based on similar methods that the `require` module loading system will use (this is in `lib/pluck.js`).\n\nFinally, once the virtual tree is constructed, a pass is made to check for unused packages from the original `physicalTree`, which are marked as `extraneous: true`, and if the optional `dev` flag is `false`, all `devDependencies` are stripped.\n\n*Note: code found in `lib/logical.js`*\n\n## Misc\n\n* [CONTRIBUTING.md](CONTRIBUTING.md)\n* [License: Apache License, Version 2.0](LICENSE)",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Snyk/resolve-deps.git"
  },
  "scripts": {
    "check-tests": "! grep 'test.only' test/*.test.js -n",
    "cover": "tap test/*.test.js --cov --coverage-report=lcov",
    "env": "node -e 'console.log(process.env, process.versions)'",
    "lint": "jscs cli/*.js lib/*.js -v",
    "semantic-release": "semantic-release pre && npm publish && semantic-release post",
    "test": "npm run check-tests && npm run lint && tap test/*.test.js --cov --timeout=60"
  },
  "version": "1.7.0"
}
