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

ecma-utils

v0.2.2

Published

A collection of ECMAScript utilities for use in any JavaScript projects.

Downloads

18

Readme

ECMA-UTILS

Ecma utils is a library created for use in many different projects. As such it doesn't strictly adhere to one paradigm or coding style over another. That being said, most of the functions I've been writing lately are to help with writing functional programming.

INSTALL
  npm i ecma-utils
  # or...
  yarn add ecma-utils
IS

The is class is a collection of static methods used for type validation. It is very simple to read and understand.

if (is.array(someThing)) {
  console.log('jump for joy')
}
if (is.not(is.object(someItems)) {
  console.log('Hey! That's a no object!')
}
UTILS

The utils module is a bunch of lambda abstraction type functions. The typical kit is in there, compose, map, reduce, pluck, an assortment of array and string functions. This module is under the most development/testing at the moment. As such it is incomplete and subject to great change in both how it works and how it is used.

CACHE-ME

The cache-me module is built to wrap object methods with a private cache. At the moment it only works for objects and methods, pass a list of strings as methods to wrap (to customize caching) or don't and the module will wrap each method on the object with a cache.

    const abacus = {
      add() {/*...*/},
      mult() {/*...*/},
      rand() {/*...*/}
    }
    
    // Cache only the add and mult methods on abacus
    cacheMe(myObject, 'add', 'mult')
Here is a list of all functions needing testing in utils

isCallable isObject isDefined isBool isNone not isNeg noop bool int sum list keys set get at zip unzipWith apply lastItem lastIndex head pluck pluckN immutableSplice count push map filter reduce padList tap lTap minOf maxOf inRange divideBy divide match replaceAll str strMatchRE strMatchStr strToRegExp ifOrElse orElse initializeToType compose runWith

 


Comments, Suggestions, Talky-talks?

Troubles, Issues, Uh-ohs and Boom-booms?

Thanks and Appreciation