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

js-extra

v1.7.1

Published

Does what native Javascript doesn't.

Readme

js-extra docs

npm version ci status GitHub license PRs Welcome code style: prettier build formats bundle size

Menu

Motivation

From my humble point of view, JavaScript is lacking of some very useful small built-in functions some other languages, like Python, have.

Yes, reduce and map can do quite a lot of things, in quite a lot of situations. They can also often save us in the most desparate situations. But because they are very generic tools, they do not provide a clear straight-forward understanding of what they are used/implemented for.

For example, let's say you want to count the occurences of a number in an array of numbers. For sure, you can do it with a reduce:

array.reduce((count, item) => item === itemToCount ? count + 1 : count, 0)

But let's be honest. Don't you think this is so verbose code for a simple count() ? Why is there not a built-in count function in JavaScript ?

This is exactly what js-extra is built for. Its aim is to provide explicit functions built on top of the native JavaScript functions. Since Lodash already provides many extra functions, the lib will aim to complete it with very specific functions.

With js-extra the above code becomes:

count(array, itemToCount)

How to use js-extra

Yarn:

$ yarn add js-extra

Npm:

$ npm i js-extra

You can import the functions this way:

ES6

import { count } from 'js-extra'

ES5

var { count } = require('js-extra')

You can find all the implemented & available functions of the lib here.

js-extra is tree-shakeable and side-effects free!

API

The API is available here: js-extra API

Contributing

Any contribution would be more than welcome! You think you can optimize the algorithms of existing functions ? Please, open a PR! :)

You would like to add a function that JavaScript doesn't have natively ? Please, go ahead and open a PR! :)

Found any bugs or you have some ideas ? Please, open an issue! :)

The following commands are executed with yarn, but you can of course use any package manager tool like npm or npx.

To install dependencies:

yarn install

To build the project:

yarn build

To run the tests:

yarn test

Before you commit:

yarn validate