Hypermod Codemods for e18e

Hypermod is proud to support the e18e community initiative by providing codemods that automate the cleanup and modernization of JavaScript dependencies. These codemods are based on the es-tooling/module-replacements-codemods repository, and we extend our gratitude to the authors for their foundational work.
What is e18e?
e18e (short for "ecosystem performance") is a community-driven initiative focused on enhancing the JavaScript ecosystem's performance. It aims to:
- Cleanup: Remove redundant dependencies and replace them with modern alternatives.
- Speedup: Improve the performance of widely used packages.
- Levelup: Build modern alternatives to outdated packages.
The initiative brings together developers passionate about improving the ecosystem, providing a space for collaboration and knowledge sharing.
The Role of ES Tooling
ES Tooling is a community-led organization that supports the e18e initiative by developing tools to facilitate ecosystem improvements. One of its key projects is module-replacements-codemods, which provides automated codemods to replace outdated or unnecessary dependencies with modern alternatives.
These codemods are based on the module-replacements manifest, a curated list of popular npm packages and their possible replacements. By automating the replacement process, developers can more easily modernize their codebases and reduce technical debt.
Why Run These Codemods on Your Repository?
Running these codemods on your repository offers several benefits:
- Reduce Technical Debt: Automatically replace outdated or redundant dependencies, leading to a cleaner and more maintainable codebase.
- Improve Performance: Switch to more efficient alternatives, potentially enhancing your application's performance.
- Stay Up-to-Date: Ensure your project uses actively maintained and modern packages.
- Simplify Dependency Management: Reduce the complexity of your dependency tree, making it easier to manage and audit.
For example, a codemod for the is-even
package would transform:
const isEven = require('is-even'); console.log(isEven(2));
into:
console.log(2 % 2 === 0);
This replacement removes the need for an external dependency by using native JavaScript functionality.
Hypermod's Codemods for e18e
Hypermod integrates these codemods into its platform, allowing developers to easily apply them to their projects. By leveraging Hypermod, you can:
- Automate Code Transformations: Apply multiple codemods across your codebase with minimal effort.
- Customize Transformations: Tailor codemods to fit your project's specific needs.
- Collaborate with the Community: Share and discover codemods contributed by other developers.
Explore the available codemods in the Hypermod Codemod Registry.
- e18e abort-controller to native AbortController
- e18e array.from to Array.from()
- e18e array-every to Array.prototype.every()
- e18e array-buffer-byte-length to native ArrayBuffer.prototype.byteLength()
- e18e array.of to Array.of()
- e18e array.prototype.at to Array.prototype.at()
- e18e array.prototype.concat to Array.prototype.concat()
- e18e array.prototype.copywithin to Array.prototype.copyWithin()
- e18e array.prototype.filter to Array.prototype.filter()
- e18e array.prototype.entries to Array.prototype.entries()
- e18e array.prototype.every to Array.prototype.every()
- e18e array-map to Array.prototype.map()
- e18e array.prototype.find to Array.prototype.find()
- e18e array.prototype.findindex to Array.prototype.findIndex()
- e18e array.prototype.findlast to Array.prototype.findLast()
- e18e array.prototype.findlastindex to Array.prototype.findLastIndex()
- e18e array.prototype.flat to Array.prototype.flat()
- e18e array.prototype.flatmap to Array.prototype.flatMap()
- e18e array.prototype.foreach to Array.prototype.forEach()
- e18e array.prototype.indexof to Array.prototype.indexOf()
- e18e array.prototype.join to Array.prototype.join()
- e18e array.prototype.keys to Array.prototype.keys()
- e18e array.prototype.lastindexof to Array.prototype.lastIndexOf()
- e18e array.prototype.map to Array.prototype.map()
- e18e array.prototype.push to Array.prototype.push()
- e18e array.prototype.reduce to Array.prototype.reduce()
- e18e array.prototype.reduceright to Array.prototype.reduceRight()
- e18e array.prototype.slice to Array.prototype.slice()
- e18e array.prototype.some to Array.prototype.some()
- e18e array.prototype.splice to Array.prototype.splice()
- e18e array.prototype.toreversed to Array.prototype.toReversed()
- e18e array.prototype.tosorted to Array.prototype.toSorted()
- e18e array.prototype.tospliced to Array.prototype.toSpliced()
- e18e array.prototype.unshift to Array.prototype.unshift()
- e18e array.prototype.values to Array.prototype.values()
- e18e array.prototype.with to Array.prototype.with()
- e18e arraybuffer.prototype.slice to ArrayBuffer.prototype.slice()
- e18e concat-map to Array.prototype.flatMap()
- e18e gopd to Object.getOwnPropertyDescriptor()
- e18e deep-equal to dequal
- e18e date to Date()
- e18e is-nan to Number.isNaN()
- e18e xtend to Spread syntax (...)
- e18e md5 to Crypto
- e18e object-is to Object.is()
- e18e object-assign to Object.assign()
- e18e object.keys to Object.keys()
- e18e object.values to Object.values()
- e18e object.hasown to Object.hasOwn()
- e18e object.getprototypeof to Object.getPrototypeOf()
- e18e object.fromentries to Object.fromEntries()
- e18e object.entries to Object.entries()
- e18e object-keys to Object.keys()
- e18e object.assign to Object.assign()
- e18e object.defineproperties to Object.defineProperties()
- e18e for-each to Array.prototype.forEach()
- e18e is-number to native JS
- e18e is-odd to native JS
- e18e is-even to native JS
- e18e array-includes to Array.prototype.includes()
Get Involved
The success of the e18e initiative and the effectiveness of these codemods rely on community participation. If you're interested in contributing:
- Join the e18e Community: Connect with like-minded developers on the e18e Discord server.
- Contribute Codemods: Help expand the module-replacements-codemods repository by adding new codemods.
- Improve Existing Codemods: Enhance the quality and coverage of current codemods by refining their implementations.
Together, we can build a faster, cleaner, and more efficient JavaScript ecosystem.
Note: The codemods provided by Hypermod are based on the es-tooling/module-replacements-codemods repository. We acknowledge and thank the authors for their contributions.