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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ecmacomp

v1.0.0

Published

Compile javascript modules, optimize them with prepack and terser if `NODE_ENV` is `production`, and do more optimisations from this project. Reduce your code in production today!

Downloads

4

Readme

ecmacomp Build Status

Compile javascript modules, optimize them with prepack and terser if NODE_ENV is production, and do more optimisations from this project. Reduce your code in production today!

Further optimizations are coming up:

  • Caching React elements in variables and modifying them before passing them to React.createElement
  • Turning fs.readFileSync and other sync APIs into their Promise counterparts, and turning every function above the call into an async function
  • Removing react completely using rawact
  • Reducing GC allocations
  • Caching some function results
  • ...And other amazing optimizations

Usage (CLI)

You can disable rollup or prepack (to disable terser, use the NODE_ENV environment variable NODE_ENV=production ecmacomp ...)

$ ecmacomp input.js [--norollup] [--noprepack] [--public dir] [--output file]

Usage (JS API)

await require('ecmacomp')({ filename: 'input.js' })  // Or 'function code....'

Hacking ecmacomp

To hack on ecmacomp, clone this repository (git clone https://github.com/fabiosantoscode/ecmacomp), cd to it, run npm i, write a test in the appropriate place, respect the lint (npm run lint) and start hacking :)

This CLI command reveals the bytecode for a piece of javascript:

$ ecmacomp --parse input.js

You can use this bytecode as reference because it's the bytecode used in all the optimisations.