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

@jinwonn/lotide

v1.0.0

Published

A mini clone of the [Lodash] library.

Downloads

14

Readme

Lotide

A mini clone of the Lodash library.

Purpose

BEWARE: This library was published for learning purposes. It is not intended for use in production-grade software.

Usage

Install it:

npm install @jinwonn/lotide

Require it:

const _ = require('@jinwonn/lotide');

Call it:

const results = _.tail([1, 2, 3]) // => [2, 3]

Documentation

The following functions are currently implemented:

  • countLetters(string): return an object of counts of each of the letters from string (excluding spaces).

      _.countLetters('sttr');
      // => {s:1,t:2,r:1}
    
      _.countLetters('s t tr');
      // => {s:1,t:2,r:1});
  • countOnly([allItems], {itemsToCount}): Returns and array of counts for items specified in {itemsToCount} from inputted collection of items (strings) in [allItems].

      const firstNames = ["Karl", "Salima", "Agouhanna", "Fang","Kavith", "Jason", "Salima", "Fang", "Joe"];
    
      const result1 = _.countOnly(firstNames, { "Jason": true, 
                                                "Karima": true, 
                                                "Fang": true, 
                                                "Agouhanna": false 
                                              });
    
      result1["Jason"]; // => 1
    
      result1["Karima"]; // => undefined
    
      result1["Fang"]; // => 2
    
      result1["Agouhanna"]; // => undefined
  • eqArrays([actual], [expected]): Takes in two arrays and returns true or false, based on a perfect match.

      _.eqArrays([1, [[2], 3]], [1, [[2], 3]]);// => true
    
      _.eqArrays([1, 2, [3]], [[3], 2, 1]);// => false
    
      _.eqArrays(["1", "2", [3]], ["1", 2, [3]]); // => false
  • eqObjects({actual}, {expected}) Takes in two objects and returns true or false, based on a perfect match.

      const ab = { a: "1", b: [2, 3], c: {4 ,5} };
      const ba = { b: [2, 3], c: {4 ,5}, a: "1" };
        
      _.eqObjects(ab, ba); // => true
    
      const abc = { a: "1", b: [2, 3], c: {4 ,5}, d: "6" };
        
      _.eqObjects(ab, abc); // => false
  • findKey({input}, cb): Returns the first key from {input} for which the cb returns a truthy value.

      const input = { "Blue Hill": { stars: 1 },
                      "Akaleri":   { stars: 3 },
                      "noma":      { stars: 2 },
                      "elBulli":   { stars: 3 },
                      "Ora":       { stars: 2 },
                      "Akelarre":  { stars: 3 }
                    };
    
      _.findKey(input, x => x.stars === 2); // => "noma"
        
      _.findKey(input, x => x.stars === 4); // => undefined
  • findKeyByValue({data}, searchKey): Returns the first key from {data} which contains the given value searchKey.

      const bestTVShowsByGenre = { sci_fi: "The Expanse",
                                   comedy: "Brooklyn Nine-Nine",
                                   drama:  "The Wire" };
    
      _.findKeyByValue(bestTVShowsByGenre, "The Wire");
      // => drama
    
      _.findKeyByValue(bestTVShowsByGenre, "That '70s Show");
      // => undefined
  • flatten([input]): Returns a flattened single-level array from [input] which contains other arrays inside.

      _.flatten([1,[2,3],'a',[5],true]);
      // => [1,2,3,'a',5,true])
  • head([input]): Returns the first element of [input].

      _.head([1, a, 3]); // => 1
    
      _.head([]); // => undefined
  • letterPositions(string): returns an object of arrays of all the indices (zero-based positions) in string where each character is found (excluding spaces).

      _.letterPositions('lighthouse labs');
      // => {l: [ 0, 11 ],
             i: [ 1 ],
             g: [ 2 ],
             h: [ 3, 5 ],
             t: [ 4 ],
             o: [ 6 ],
             u: [ 7 ],
             s: [ 8, 14 ],
             e: [ 9 ],
             a: [ 12 ],
             b: [ 13 ]}
  • map([input], cb): Returns a new array based on the results of callback function cb on [input].

      const words = ["ground", "control", "to", "major", "tom"];
    
      _.map(words, word => word.length);
      // => [6,7,2,5,3]
  • middle([input]): Return an array with only the middle element(s) of [input].

      _.middle([1]);
      // => []
    
      _.middle([1, 2]);
      // => []
    
      _.middle([1, 2, 3]);
      // => [2]
    
      _.middle([1, 2, 3, 4]);
      // => [2, 3]
  • tail([input]): Gets and returns an array of all but the first element of [input].

      _.tail([1, a, 3]); // => [a, 3]
  • takeUntil([input], cb): return a "slice of [array] with elements taken from the beginning until the cb returns a truthy value.

      const data1 = [1, 2, 5, -1, 2, 4, 5];
        
      _.takeUntil(data1, x => x < 0);
      // => [ 1, 2, 5 ]
    
      const data2 = ["I've", "been", "to", "Hollywood", ";", "also", "Redwood"];
        
      _.takeUntil(data2, x => x === ';');
      // => [ "I've", 'been', 'to', 'Hollywood' ]
  • without([source], [itemsToRemove]): Returns an array of values from [source] excluding all given values in [itemsToRemove].

      _.without([1, 2, 3], [1]);
      // => [2, 3]
    
      _.without(["1", "2", "3"], [1, 2, "3"]);
      // => ["1", "2"]