{
  "manifest": {
    "name": "resolve",
    "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
    "version": "2.0.0-next.5",
    "repository": {
      "type": "git",
      "url": "git://github.com/browserify/resolve.git"
    },
    "bin": {
      "resolve": "bin/resolve"
    },
    "main": "index.js",
    "exports": {
      ".": [
        {
          "import": "./index.mjs",
          "default": "./index.js"
        },
        "./index.js"
      ],
      "./sync": "./lib/sync.js",
      "./async": "./lib/async.js",
      "./package.json": "./package.json"
    },
    "keywords": [
      "resolve",
      "require",
      "node",
      "module"
    ],
    "scripts": {
      "prepack": "npmignore --auto --commentLines=autogenerated",
      "prepublishOnly": "safe-publish-latest",
      "prepublish": "not-in-publish || npm run prepublishOnly",
      "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
      "lint": "eslint --ext=js,mjs --no-eslintrc -c .eslintrc . 'bin/**'",
      "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async",
      "tests-only": "tape test/*.js",
      "pretest": "npm run lint",
      "test": "npm run --silent tests-only",
      "posttest": "npm run test:multirepo && aud --production",
      "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
    },
    "devDependencies": {
      "@ljharb/eslint-config": "^21.1.0",
      "array.prototype.map": "^1.0.6",
      "aud": "^2.0.3",
      "copy-dir": "^1.3.0",
      "eclint": "^2.8.1",
      "eslint": "=8.8.0",
      "in-publish": "^2.0.1",
      "mkdirp": "^0.5.5",
      "mv": "^2.1.1",
      "npmignore": "^0.3.0",
      "object-keys": "^1.1.1",
      "rimraf": "^2.7.1",
      "safe-publish-latest": "^2.0.0",
      "tap": "^0.4.13",
      "tape": "^5.7.0",
      "tmp": "^0.0.31"
    },
    "license": "MIT",
    "author": {
      "name": "James Halliday",
      "email": "mail@substack.net",
      "url": "http://substack.net"
    },
    "funding": {
      "url": "https://github.com/sponsors/ljharb"
    },
    "dependencies": {
      "is-core-module": "^2.13.0",
      "path-parse": "^1.0.7",
      "supports-preserve-symlinks-flag": "^1.0.0"
    },
    "publishConfig": {
      "ignore": [
        ".github/workflows",
        "appveyor.yml",
        "test/resolver/malformed_package_json"
      ]
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-resolve-2.0.0-next.5-6b0ec3107e671e52b68cd068ef327173b90dc03c-integrity/node_modules/resolve/package.json",
    "readmeFilename": "readme.markdown",
    "readme": "# resolve <sup>[![Version Badge][2]][1]</sup>\n\nimplements the [node `require.resolve()` algorithm](https://nodejs.org/api/modules.html#modules_all_together) such that you can `require.resolve()` on behalf of a file asynchronously and synchronously\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][5]][6]\n[![dev dependency status][7]][8]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][11]][1]\n\n# example\n\nasynchronously resolve:\n\n```js\nvar resolve = require('resolve/async'); // or, require('resolve')\nresolve('tap', { basedir: __dirname }, function (err, res) {\n    if (err) console.error(err);\n    else console.log(res);\n});\n```\n\n```\n$ node example/async.js\n/home/substack/projects/node-resolve/node_modules/tap/lib/main.js\n```\n\nsynchronously resolve:\n\n```js\nvar resolve = require('resolve/sync'); // or, `require('resolve').sync\nvar res = resolve('tap', { basedir: __dirname });\nconsole.log(res);\n```\n\n```\n$ node example/sync.js\n/home/substack/projects/node-resolve/node_modules/tap/lib/main.js\n```\n\n# methods\n\n```js\nvar resolve = require('resolve');\nvar async = require('resolve/async');\nvar sync = require('resolve/sync');\n```\n\nFor both the synchronous and asynchronous methods, errors may have any of the following `err.code` values:\n\n- `MODULE_NOT_FOUND`: the given path string (`id`) could not be resolved to a module\n- `INVALID_BASEDIR`: the specified `opts.basedir` doesn't exist, or is not a directory\n- `INVALID_PACKAGE_MAIN`: a `package.json` was encountered with an invalid `main` property (eg. not a string)\n\n## resolve(id, opts={}, cb)\n\nAsynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`.\n\noptions are:\n\n* opts.basedir - directory to begin resolving from\n\n* opts.package - `package.json` data applicable to the module being loaded\n\n* opts.extensions - array of file extensions to search in order\n\n* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search\n\n* opts.readFile - how to read files asynchronously\n\n* opts.isFile - function to asynchronously test whether a file exists\n\n* opts.isDirectory - function to asynchronously test whether a file exists and is a directory\n\n* opts.realpath - function to asynchronously resolve a potential symlink to its real path\n\n* `opts.readPackage(readFile, pkgfile, cb)` - function to asynchronously read and parse a package.json file\n  * readFile - the passed `opts.readFile` or `fs.readFile` if not specified\n  * pkgfile - path to package.json\n  * cb - callback. a SyntaxError error argument will be ignored, all other error arguments will be treated as an error.\n\n* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the \"main\" field\n  * pkg - package data\n  * pkgfile - path to package.json\n  * dir - directory that contains package.json\n\n* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package\n  * pkg - package data\n  * path - the path being resolved\n  * relativePath - the path relative from the package.json location\n  * returns - a relative path that will be joined from the package.json location\n\n* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this)\n\n  For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function\n    * request - the import specifier being resolved\n    * start - lookup path\n    * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution\n    * opts - the resolution options\n\n* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this)\n    * request - the import specifier being resolved\n    * start - lookup path\n    * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution\n    * opts - the resolution options\n\n* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `\"node_modules\"`\n\n* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving.\nThis is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag.\n\ndefault `opts` values:\n\n```js\n{\n    paths: [],\n    basedir: __dirname,\n    extensions: ['.js'],\n    includeCoreModules: true,\n    readFile: fs.readFile,\n    isFile: function isFile(file, cb) {\n        fs.stat(file, function (err, stat) {\n            if (!err) {\n                return cb(null, stat.isFile() || stat.isFIFO());\n            }\n            if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);\n            return cb(err);\n        });\n    },\n    isDirectory: function isDirectory(dir, cb) {\n        fs.stat(dir, function (err, stat) {\n            if (!err) {\n                return cb(null, stat.isDirectory());\n            }\n            if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);\n            return cb(err);\n        });\n    },\n    realpath: function realpath(file, cb) {\n        var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;\n        realpath(file, function (realPathErr, realPath) {\n            if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);\n            else cb(null, realPathErr ? file : realPath);\n        });\n    },\n    readPackage: function defaultReadPackage(readFile, pkgfile, cb) {\n        readFile(pkgfile, function (readFileErr, body) {\n            if (readFileErr) cb(readFileErr);\n            else {\n                try {\n                    var pkg = JSON.parse(body);\n                    cb(null, pkg);\n                } catch (jsonErr) {\n                    cb(jsonErr);\n                }\n            }\n        });\n    },\n    moduleDirectory: 'node_modules',\n    preserveSymlinks: false\n}\n```\n\n## resolve.sync(id, opts)\n\nSynchronously resolve the module path string `id`, returning the result and\nthrowing an error when `id` can't be resolved.\n\noptions are:\n\n* opts.basedir - directory to begin resolving from\n\n* opts.extensions - array of file extensions to search in order\n\n* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search\n\n* opts.readFileSync - how to read files synchronously\n\n* opts.isFile - function to synchronously test whether a file exists\n\n* opts.isDirectory - function to synchronously test whether a file exists and is a directory\n\n* opts.realpathSync - function to synchronously resolve a potential symlink to its real path\n\n* `opts.readPackageSync(readFileSync, pkgfile)` - function to synchronously read and parse a package.json file. a thrown SyntaxError will be ignored, all other exceptions will propagate.\n  * readFileSync - the passed `opts.readFileSync` or `fs.readFileSync` if not specified\n  * pkgfile - path to package.json\n\n* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the \"main\" field\n  * pkg - package data\n  * pkgfile - path to package.json\n  * dir - directory that contains package.json\n\n* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package\n  * pkg - package data\n  * path - the path being resolved\n  * relativePath - the path relative from the package.json location\n  * returns - a relative path that will be joined from the package.json location\n\n* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this)\n\n  For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function\n    * request - the import specifier being resolved\n    * start - lookup path\n    * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution\n    * opts - the resolution options\n\n* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this)\n    * request - the import specifier being resolved\n    * start - lookup path\n    * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution\n    * opts - the resolution options\n\n* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `\"node_modules\"`\n\n* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving.\nThis is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag.\n\ndefault `opts` values:\n\n```js\n{\n    paths: [],\n    basedir: __dirname,\n    extensions: ['.js'],\n    includeCoreModules: true,\n    readFileSync: fs.readFileSync,\n    isFile: function isFile(file) {\n        try {\n            var stat = fs.statSync(file);\n        } catch (e) {\n            if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;\n            throw e;\n        }\n        return stat.isFile() || stat.isFIFO();\n    },\n    isDirectory: function isDirectory(dir) {\n        try {\n            var stat = fs.statSync(dir);\n        } catch (e) {\n            if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;\n            throw e;\n        }\n        return stat.isDirectory();\n    },\n    realpathSync: function realpathSync(file) {\n        try {\n            var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;\n            return realpath(file);\n        } catch (realPathErr) {\n            if (realPathErr.code !== 'ENOENT') {\n                throw realPathErr;\n            }\n        }\n        return file;\n    },\n    readPackageSync: function defaultReadPackageSync(readFileSync, pkgfile) {\n        return JSON.parse(readFileSync(pkgfile));\n    },\n    moduleDirectory: 'node_modules',\n    preserveSymlinks: false\n}\n```\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```sh\nnpm install resolve\n```\n\n# license\n\nMIT\n\n[1]: https://npmjs.org/package/resolve\n[2]: https://versionbadg.es/browserify/resolve.svg\n[5]: https://david-dm.org/browserify/resolve.svg\n[6]: https://david-dm.org/browserify/resolve\n[7]: https://david-dm.org/browserify/resolve/dev-status.svg\n[8]: https://david-dm.org/browserify/resolve#info=devDependencies\n[11]: https://nodei.co/npm/resolve.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/resolve.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/resolve.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=resolve\n[codecov-image]: https://codecov.io/gh/browserify/resolve/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/browserify/resolve/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/resolve\n[actions-url]: https://github.com/browserify/resolve/actions\n",
    "licenseText": "MIT License\n\nCopyright (c) 2012 James Halliday\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz",
    "hash": "6b0ec3107e671e52b68cd068ef327173b90dc03c",
    "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==",
    "registry": "npm",
    "packageName": "resolve",
    "cacheIntegrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA== sha1-aw7DEH5nHlK2jNBo7zJxc7kNwDw="
  },
  "registry": "npm",
  "hash": "6b0ec3107e671e52b68cd068ef327173b90dc03c"
}