npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@e18e/web-features-codemods

v0.2.0

Published

A collection of codemods for web features

Readme

@e18e/web-features-codemods

This project contains a collection of codemods for transforming code to make use of newer web features and syntax.

For example, converting from array[array.length - 1] to array.at(-1).

Installation

You can install the codemods using npm or yarn:

npm install @e18e/web-features-codemods --save-dev

Available Codemods

| Codemod | Description | Example | |---------|-------------|---------| | arrayAt | Convert array length-based indexing to at() method | array[array.length - 1]array.at(-1) | | arrayFill | Optimize array fill patterns | Various fill pattern optimizations | | arrayIncludes | Convert indexOf checks to includes() | array.indexOf(item) !== -1array.includes(item) | | arrayToReversed | Convert copy-and-reverse patterns to toReversed() | array.slice().reverse()array.toReversed() | | arrayToSorted | Convert copy-and-sort patterns to toSorted() | array.slice().sort()array.toSorted() | | arrayToSpliced | Convert copy-and-splice patterns to toSpliced() | const copy = arr.slice(); copy.splice(0, 1);const copy = arr.toSpliced(0, 1); | | exponentiation | Convert Math.pow() to exponentiation operator | Math.pow(base, exp)base ** exp | | nullishCoalescing | Convert null/undefined checks to nullish coalescing | value != null ? value : defaultvalue ?? default | | objectHasOwn | Convert hasOwnProperty to Object.hasOwn() | obj.hasOwnProperty(prop)Object.hasOwn(obj, prop) | | postcssSignFunctions | Remove imports for postcss-sign-functions polyfill | Removes obsolete polyfill imports | | spreadSyntax | Convert array/object methods to spread syntax | array.concat(other)[...array, ...other] | | stringIncludes | Convert indexOf checks to includes() | string.indexOf(substr) !== -1string.includes(substr) | | urlCanParse | Convert URL validation try-catch to URL.canParse() | try { new URL(url) } catch { }URL.canParse(url) |

Usage

Each codemod can be imported and used programmatically. All codemods implement the same interface with test() and apply() methods.

Basic Example

import {arrayAt} from '@e18e/web-features-codemods';

const sourceCode = `
const lastItem = myArray[myArray.length - 1];
const firstItem = myArray[0];
`;

// Optionally check if the codemod applies to this source.
// You can also skip this step and directly call apply() as non-matching
// codemods will simply return the original source.
if (arrayAt.test({source: sourceCode})) {
  // Apply the transformation
  const transformed = arrayAt.apply({source: sourceCode});
  console.log(transformed);
  // Output:
  // const lastItem = myArray.at(-1);
  // const firstItem = myArray[0];
}

License

MIT