{"id":13447657,"url":"https://github.com/rollup/rollup-plugin-node-resolve","last_synced_at":"2026-01-14T03:36:02.696Z","repository":{"id":57126616,"uuid":"44773553","full_name":"rollup/rollup-plugin-node-resolve","owner":"rollup","description":"This module has moved and is now available at @rollup/plugin-node-resolve / https://github.com/rollup/plugins/blob/master/packages/node-resolve","archived":true,"fork":false,"pushed_at":"2019-12-02T23:28:06.000Z","size":406,"stargazers_count":470,"open_issues_count":0,"forks_count":84,"subscribers_count":17,"default_branch":"master","last_synced_at":"2026-01-12T02:32:27.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rollup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-22T21:12:34.000Z","updated_at":"2025-10-21T14:46:57.000Z","dependencies_parsed_at":"2022-08-31T12:11:55.052Z","dependency_job_id":null,"html_url":"https://github.com/rollup/rollup-plugin-node-resolve","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/rollup/rollup-plugin-node-resolve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-node-resolve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-node-resolve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-node-resolve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-node-resolve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollup","download_url":"https://codeload.github.com/rollup/rollup-plugin-node-resolve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-node-resolve/sbom","scorecard":{"id":783461,"data":{"date":"2025-08-11","repo":{"name":"github.com/rollup/rollup-plugin-node-resolve","commit":"daa51892f9b19dac46dffbdfe986d768543b6a2f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 10/30 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T05:28:01.224Z","repository_id":57126616,"created_at":"2025-08-23T05:28:01.224Z","updated_at":"2025-08-23T05:28:01.224Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:01:23.674Z","updated_at":"2026-01-14T03:36:02.671Z","avatar_url":"https://github.com/rollup.png","language":"JavaScript","readme":"# Moved\n\nThis module has moved and is now available at [@rollup/plugin-node-resolve](https://github.com/rollup/plugins). Please update your dependencies. This repository is no longer maintained.\n\n\n# rollup-plugin-node-resolve\n\n*This plugin used to be called rollup-plugin-npm*\n\nLocate modules using the [Node resolution algorithm](https://nodejs.org/api/modules.html#modules_all_together), for using third party modules in `node_modules`\n\n## Installation\n\n```bash\nnpm install --save-dev rollup-plugin-node-resolve\n```\n\n## Usage\n\n```js\n// rollup.config.js\nimport resolve from 'rollup-plugin-node-resolve';\n\nexport default {\n  input: 'main.js',\n  output: {\n    file: 'bundle.js',\n    format: 'iife',\n    name: 'MyModule'\n  },\n  plugins: [\n    resolve({\n\n      // the fields to scan in a package.json to determine the entry point\n      // if this list contains \"browser\", overrides specified in \"pkg.browser\"\n      // will be used\n      mainFields: ['module', 'main'], // Default: ['module', 'main']\n\n      // DEPRECATED: use \"mainFields\" instead\n      // use \"module\" field for ES6 module if possible\n      module: true, // Default: true\n\n      // DEPRECATED: use \"mainFields\" instead\n      // use \"jsnext:main\" if possible\n      // legacy field pointing to ES6 module in third-party libraries,\n      // deprecated in favor of \"pkg.module\":\n      // - see: https://github.com/rollup/rollup/wiki/pkg.module\n      jsnext: true,  // Default: false\n\n      // DEPRECATED: use \"mainFields\" instead\n      // use \"main\" field or index.js, even if it's not an ES6 module\n      // (needs to be converted from CommonJS to ES6)\n      // – see https://github.com/rollup/rollup-plugin-commonjs\n      main: true,  // Default: true\n\n      // some package.json files have a \"browser\" field which specifies\n      // alternative files to load for people bundling for the browser. If\n      // that's you, either use this option or add \"browser\" to the\n      // \"mainfields\" option, otherwise pkg.browser will be ignored\n      browser: true,  // Default: false\n\n      // not all files you want to resolve are .js files\n      extensions: [ '.mjs', '.js', '.jsx', '.json' ],  // Default: [ '.mjs', '.js', '.json', '.node' ]\n\n      // whether to prefer built-in modules (e.g. `fs`, `path`) or\n      // local ones with the same names\n      preferBuiltins: false,  // Default: true\n\n      // Lock the module search in this path (like a chroot). Module defined\n      // outside this path will be marked as external\n      jail: '/my/jail/path', // Default: '/'\n\n      // Set to an array of strings and/or regexps to lock the module search\n      // to modules that match at least one entry. Modules not matching any\n      // entry will be marked as external\n      only: [ 'some_module', /^@some_scope\\/.*$/ ], // Default: null\n\n      // If true, inspect resolved files to check that they are\n      // ES2015 modules\n      modulesOnly: true, // Default: false\n\n      // Force resolving for these modules to root's node_modules that helps\n      // to prevent bundling the same package multiple times if package is\n      // imported from dependencies.\n      dedupe: [ 'react', 'react-dom' ], // Default: []\n\n      // Any additional options that should be passed through\n      // to node-resolve\n      customResolveOptions: {\n        moduleDirectory: 'js_modules'\n      }\n    })\n  ]\n};\n```\n\n## Using with rollup-plugin-commonjs\n\nSince most packages in your node_modules folder are probably legacy CommonJS rather than JavaScript modules, you may need to use [rollup-plugin-commonjs](https://github.com/rollup/rollup-plugin-commonjs):\n\n```js\n// rollup.config.js\nimport resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\n\nexport default {\n  input: 'main.js',\n  output: {\n    file: 'bundle.js',\n    format: 'iife',\n    name: 'MyModule'\n  },\n  plugins: [\n    resolve(),\n    commonjs()\n  ]\n};\n```\n\n## Resolving Built-Ins (like `fs`)\n\nThis plugin won't resolve any builtins (e.g. `fs`). If you need to resolve builtins you can install local modules and set `preferBuiltins` to `false`, or install a plugin like [rollup-plugin-node-builtins](https://github.com/calvinmetcalf/rollup-plugin-node-builtins) which provides stubbed versions of these methods.\n\nIf you want to silence warnings about builtins, you can add the list of builtins to the `externals` option; like so:\n\n```js\nimport resolve from 'rollup-plugin-node-resolve';\nimport builtins from 'builtin-modules'\nexport default ({\n  input: ...,\n  plugins: [resolve()],\n  external: builtins,\n  output: ...\n})\n```\n\n## Additional Plugin APIs\n\nIn addition to the standard hooks used by Rollup, this plugin exposes additional functionality useful for other plugins.\n\n## getPackageInfoForId (moduleId: string) =\u003e PackageInfo\n\nReturns an object with metadata about the package containing the specified module. PackageInfo has the following fields:\n\n* **packageJson**: The package.json file for the package\n* **packageJsonPath**: The path to the package.json file\n* **root**: The root directory of the package\n* **resolvedMainField**: Which main field was used during resolution (see the mainFields option)\n* **browserMappedMain**: Whether the browser map was used to resolve the module's entry point\n* **resolvedEntrypoint**: The resolved entry point to the module with respect to the mainFields configuration and browser mappings.\n\nThis object is populated during the `resolve` hook, so plugins should only depend on this information being present in hooks that run after `resolve`.\n\n\n## Usage from Other Plugins\n\n`getPackageInfoForId` is exposed as a method on the plugin object along side the other hooks expected of a Rollup plugin.\n\n```js\nimport resolve from 'rollup-plugin-node-resolve';\nconst resolve = resolve();\n\nexport default ({\n  input: ...,\n  plugins: [\n    resolve(),\n    // custom plugin\n    {\n      transform(code, id) {\n        // get package info for this module id\n        const info = resolve.getPackageInfoForId(id);\n\n        // if it's the buffer shim, return nothing.\n        if (info.packageJson.name === 'buffer') {\n          return '';\n        }\n\n        return code;\n      }\n    }\n  ],\n  output: ...\n})\n```\n\nIf you're writing a standalone plugin, you can get access to the plugin object by pulling it out of the config provided to the `buildStart` hook:\n\n```js\n\nexport default function {\n  let nodeResolvePlugin;\n\n  function getPackageInfoForId(id) {\n    // user config isn't using this plugin\n    if (!nodeResolvePlugin) return;\n\n    // user config has an older version without this API\n    if (!nodeResolvePlugin.getPackageInfoForId) return;\n\n    return nodeResolvePlugin.getPackageInfoForId(id);\n  }\n\n  return {\n    buildStart (options) {\n      nodeResolvePlugin = options.plugins \u0026\u0026 options.plugins.filter(p =\u003e p.name === 'node-resolve')[0];\n    },\n    transform (code, id) {\n      const info = getPackageInfoForId(id);\n      // ...\n    }\n  }\n}\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-node-resolve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollup%2Frollup-plugin-node-resolve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-node-resolve/lists"}