Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
create-polyfill-service-url
Advanced tools
Analyse your JavaScript file and generate a polyfill.io URL based on all the features that are being used from within the JavaScript file.
A Node.js command-line application for analysing your JavaScript file and generating a https://polyfill.io URL based on all the features that are being used from within the JavaScript file.
> npx create-polyfill-service-url analyse --file bundle.js
This project requires Node.js 10.x and npm. You can run it with:
> npx create-polyfill-service-url analyse --file bundle.js [--cwd "/custom/pwd" --omit "Array.prototype.includes" --hostname "polyfill.io"]
You can pass multiple files as argument if you split your bundle files:
npx create-polyfill-service-url analyse --file app.js vendor.js
Option | Description | Default |
---|---|---|
--file | The path to the JavaScript file(s) to analyse | |
--cwd | The current working directory | process.cwd() |
--omit | A list of features to omit. Example: Array.prototype.map | |
--hostname | The hostname of the polyfill service to use. | polyfill.io |
--use-compute-at-edge-backend | Defines the compute-at-edge-backend usage policy: yes or no . If empty the server will decide. | |
--flags | Configuration settings for every polyfill being requested. Possible values are always and gated or both | |
--unknown | Defines the policy for unsupported browsers: polyfill or ignore | polyfill |
const analyze = require('create-polyfill-service-url');
const result = await analyze({
file: ['bundle.js'],
cwd: '/foo/bar', // Defaults to process.cwd()
omit: ['Array.prototype.includes'], // Defaults to []
hostname: 'example.com', // Defaults to 'polyfill.io'
unknown: 'polyfill', // Defaults to null. Accepts 'polyfill' or 'ignore'
useComputeAtEdgeBackend: 'yes', // Defaults to null. Accepts 'yes' or 'no'
flags: 'gated', // Defaults to null. Accepts 'always', 'gated' or both ['always', 'gated']
});
This module has a full suite of unit tests, and is verified with ESLint. You can use the following commands to check your code before opening a pull request:
npm test # verify JavaScript code with ESLint and run the tests
We use SemVer for versioning. For the versions available, see the tags on this repository.
New versions of the module are published automatically by CI for every commit which lands on the master
branch.
See also the list of contributors who participated in this project.
If you have any questions or comments about this module, or need help using it, please raise an issue.
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
Analyse your JavaScript file and generate a polyfill.io URL based on all the features that are being used from within the JavaScript file.
We found that create-polyfill-service-url demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.