Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Speed up your package installation process, reduce your disk usage, and extend the lifespan of your precious SSD.

License

NotificationsYou must be signed in to change notification settings

SukkaW/nolyfill

Repository files navigation

Speed up your package installation process, reduce your disk usage, extend the lifespan of your precious SSD by reducing yournode_modules size.

Why

While you are embracing the latest features and security fixes by installing the latest Node.js LTS, packages likeeslint-plugin-import,eslint-plugin-jsx-a11y,eslint-plugin-react, and many others maintained by ljharb are still trying to support thelong-dead Node.js 4 by addingtons of polyfills. These polyfills are inflating yournode_modules size, wasting your disk space and slowing down yournpm i /yarn /pnpm i commands. And what's worse, ljharb uses the polyfill implementation even when a native version is available in the environment, which makes the code run slower.

Whether to support Node.js 4 is up to ljharb, but most of you should not be forced to install polyfills for a Node.js version that has been dead since2018-04-30.

When not to use

  • Your Node.js version is below12.4.0.
  • You are targeting an environment that doesn't have full ES2019 support (which you really should usecore-js orcore-js-pure instead. It is significantly faster).

How to use

You can use thenolyfill CLI to replace the redundant polyfills with their super lightweight alternatives, just run following command in your project directory:

npx nolyfill# You can also specify the path to your project directory:npx nolyfill~/projects/my-project

This will find and list all redundant polyfills in the current project directory. You can then use theinstall command to replace them:

npx nolyfill install# Or in the specified directory:npx nolyfill install~/projects/my-project

CLI Options

--pm

By default nolyfill CLI will try to detect the preferred package manager of the project automatically. You can manually specify the package manager by using the--pm option. Supported options arenpm,yarn,pnpm andauto (default).

-d, --debug

Print full error messages and error stacks when an error occurs.

-v, --version

Print the current version of the nolyfill CLI.

-h, --help

Print the help message.


Development

Add the definition inpackages/data/es-shim-like/src/ orpackages/data/single-file/src/ andcreate.ts , thennpm run codegen. Notice that rarely used package will not be added, and some packages which are just sub-deps also won't be added.

Contributions

when younpm i or anything else, getUse your platform's native and it's available at Node.js <= 12, it's time to nolyfill it.


nolyfill ©Sukka, Released under theMIT License.Authored and maintained by Sukka with help from contributors (list).

Personal Website ·Blog · GitHub@SukkaW · Telegram Channel@SukkaChannel · Mastodon@sukka@acg.mn · Twitter@isukkaw · Keybase@sukka

About

Speed up your package installation process, reduce your disk usage, and extend the lifespan of your precious SSD.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp