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

essed

v1.4.0

Published

Like Unix "sed" but for JS code

Readme

essed

essed is a simple program with purpose similar to sed or awk

Pros and cons

When to use essed

  • Dealing with line-delimited JSON
  • One-time time-consuming task
  • Playing around
  • Want to leverage knowledge of JavaScript

When not to use essed

  • Performance - sed is strongly optimized C code. JavaScript is much slower. It's totally possible for essed to be 200 times slower than C-based tools.
  • Non-UTF8 encodings (at least yet)
  • Dealing with binary files

Consider

  • Portability - you can use essed in your npm scripts. Though, it won't be installed globally on your CI.

TODO

  • Loading code from file
  • assert - assert input match some criteria. If it doesn't, break pipeline, otherwise return untouched
  • find - find first line matching some criteria
  • limit parameter on filter - if number of matched items exceed limit, drop them down
  • limit parameter on map
  • takeWhile
  • takeUntil
  • findLast
  • reduce
  • Native support for line-delimited JSON
  • Provide Webpack compiled build to improve startup time
  • Provide way to load external modules

map

Examples

Remove whitespace from each line:

cat ~/.bashrc | essed --map "line.trim()"

Reverse lines:

cat ~/.bashrc | essed --map "$0.reverse()"

Remove comments (nulls and undefineds are filtered out from output):

cat ~/.zshrc | essed --map "value.trim().startsWith('#') ? null : line"

Color even lines (terminal):

cat ~/.zshrc | essed -m "i % 2 ? line.yellow : line"

filter

Examples

Remove comments:

essed --filter "line.trim().startsWith('#')" ~/.zshrc

Comming

Allowed return values

  • string
  • Promise<string>
  • highland<string>
  • ReadableStream<string>

Enviroment

For your convenience we expose following "globals":

  • shared - empty object shared by many invocations
  • P, Bluebird - Bluebird instance
  • lodash, _ - lodash instance
  • hl, highland - highland instance
  • deburr, pad, trim, truncate, upperFirst, replace - exported from lodash
  • execFile, execFileSync - exported from native child_process
  • colors - colors instance
  • log - function that logs it's input on stderr and returns first argument.
  • fs - native Node.js module ** log(line) === line

colors module is avalaible by default.

Line is available as line, l, value, $0.

Number of line is avalaiable as i and index.

Resources to read: