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

hibar

v0.4.0

Published

JavaScript's missing functions

Downloads

94

Readme

hibar

JavaScript's missing functions.

Install

yarn add hibar

There are three ways of using it:

Magically

Hibar supports the magic lodash-styled syntax:

const _ = require('hibar')
console.log(_.clamp(0, 1, 2))

This will automagically call the right function. See Performance if that's a concern.

Manually

If you'd prefer not to override the base JavaScript classes, you can import and invoke these methods manually:

const { array } = require('hibar')
console.log(array.equals([1], [1]))

Polyfill

require('hibar/polyfill')
console.log(Math.clamp(0, 1, 2))

This will monkey-patch the base JavaScript classes. To see the full list of them see ./lib/polyfill.js.

Note: This approach is not reccommended because 1) it makes your code harder To read and 2) it makes your code rely on the polyfill being called before any of your other code is run.

Performance

Note when using the magic _ function, there is a slight performance hit for using functions with colliding names in the library (e.g. compact is both an array and an object function).

If you're doing some intense computation, you should manually import and invoke the method directly (as described in the Manually section).

Development

To publish a new version of the package, install np then run:

np