Gathering detailed insights and metrics for rollup-plugin-node-polyfills
Gathering detailed insights and metrics for rollup-plugin-node-polyfills
Gathering detailed insights and metrics for rollup-plugin-node-polyfills
Gathering detailed insights and metrics for rollup-plugin-node-polyfills
npm install rollup-plugin-node-polyfills
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
139 Stars
23 Commits
59 Forks
6 Watching
14 Branches
4 Contributors
Updated on 07 Nov 2024
JavaScript (99.67%)
TypeScript (0.33%)
Cumulative downloads
Total Downloads
Last day
-19.4%
144,829
Compared to previous day
Last week
-2.9%
956,281
Compared to previous week
Last month
7.4%
4,051,544
Compared to previous month
Last year
49.7%
39,239,109
Compared to previous year
npm install --save-dev rollup-plugin-node-polyfills
Allows the node builtins to be require
d/import
ed.
The following modules include ES6 specific version which allow you to do named imports in addition to the default import and should work fine if you only use this plugin.
† the http and https modules are actually the same and don't differentiate based on protocol
‡ default export only, because it's console, seriously just use the global
§ vm does not have all corner cases and has less of them in a web worker
∆ not shimmed, just returns mock
˚ optional, add option to enable browserified shim
Crypto is not shimmed and and we just provide the commonjs one from browserify and it will likely not work, if you really want it please pass {crypto: true}
as an option.
Not all included modules rollup equally, streams (and by extension anything that requires it like http) are a mess of circular references that are pretty much impossible to tree-shake out, similarly url methods are actually a shortcut to a url object so those methods don't tree shake out very well, punycode, path, querystring, events, util, and process tree shake very well especially if you do named imports.
config for using this with something simple like events or querystring
1import nodePolyfills from 'rollup-plugin-node-polyfills'; 2rollup({ 3 entry: 'main.js', 4 plugins: [ 5 nodePolyfills() 6 ] 7})
and now if main contains this, it should just work
1import EventEmitter from 'events'; 2import {inherits} from 'util'; 3 4// etc
Config for something more complicated like http
1import nodePolyfills from 'rollup-plugin-node-polyfills'; 2rollup({ 3 entry: 'main.js', 4 plugins: [ 5 nodePolyfills() 6 ] 7})
MIT except ES6 ports of browserify modules which are whatever the original library was.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
37 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More