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

@jcarloflores/lotide

v1.0.1

Published

A clone of the lodash JavaScript library to practice creating various types of functions using JS

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.

This project was created and published by me as part of my learnings at Lighthouse Labs.

Usage

Install it:

npm install @jcarloflores/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • countLetters(sentence): Returns an object with key-value pairs with a total count for each letter.

    Since

    • 1.0.1

    Arguments

    • sentence (String): The string to process.

    Returns

    • (Object): Returns an object with key-value pair summary per letter.

    Example

    _.countLetters('Hello World');
    // => { h: 1, 
    //      e: 1, 
    //      l: 3, 
    //      o: 2, 
    //      w: 1, 
    //      r: 1, 
    //      d: 1 }
  • countOnly(allItems, itemsToCount): Returns an object with key-value pair count based on itemsToCount object of matching key and boolean value of true.

    Since

    • 1.0.1

    Arguments

    • allItems (Array): Array of strings to process.
    • itemsToCount (Object): Object with keys of what to count paired with boolean values.

    Returns

    • (Object): Returns an object with key-value pair count for each matching key with true values.

    Example

    const firstNames = [
      "Hello",
      "World",
      "Foo",
      "Bar",
      "Code",
      "World",
      "Bar",
    ];
    
    _.countOnly(firstNames, { World: true, Blaster: true, Bar: false});
    // => { World: 2 }
  • eqArrays(array1, array2): Returns a boolean value depending whether or not both arrays are strictly equal to each other.

    Since

    • 1.0.1

    Arguments

    • array1 (Array): First array for comparison.
    • array2 (Array): Second array for comparison.

    Returns

    • (Boolean): Returns an boolean value (true or false) if both arrays are strictly equal.

    Example

    const array1 = [1, [2], 3];
    const array2 = [1, [2], 3];
    
    _.eqArrays(array1, array2);
    // => true
  • eqObjects(object1, object2): Returns a boolean value depending whether or not both objects are strictly equal to each other.

    Since

    • 1.0.1

    Arguments

    • object1 (Object): First object for comparison.
    • object2 (Object): Second object for comparison.

    Returns

    • (Boolean): Returns an boolean value (true or false) if both objects are strictly equal.

    Example

    const object1 = {a: 1, b: {c: 2}, d: 2};
    const object2 = {a: 1, d: 2, b: {c: 2}};
    
    _.eqObjects(object1, object2);
    // => true
  • findKey(object, callback): Returns key of object if the value of the key is truthy when using with the callback.

    Since

    • 1.0.1

    Arguments

    • object (Object): The object to evaluate.
    • callback (Function): Callback function that takes in object[key] as argument.

    Returns

    • (Object): Returns first key with truthy callback(value).

    Example

    const toys = () => {
      "car":     { shelflife: 3},
      "ball":    { shelflife: 2},
      "doll":    { shelflife: 4),
      "device":  { shelflife: 2},
      "top":     { shelflife: 5},
    }
    
    _.findKey(toys, toy =>  toy.shelflife === 2);
    // => "ball"
  • flatten(array): Returns an array without any nesting.

    Since

    • 1.0.1

    Arguments

    • array (Array): The array to evaluate.

    Returns

    • (Object): Returns flattened array.

    Example

    const array = [1, 2, [3, 4], 5, [6]];
    
    _.flatten(array);
    // => [1, 2, 3, 4, 5, 6]
  • head(array): Returns the first item in the array.

    Since

    • 1.0.0

    Arguments

    • array (Array): The array to process.

    Returns

    • (Array): Returns the first element of array.

    Example

    _.head(['a', 'b', 'c']);
    // => 'a'
    
    _.head([1, 2, 3]);
    // => 1
  • letterPositions(sentence): Returns an object with key-value pairs that correspond to the index locations of each letter from provided string.

    Since

    • 1.0.1

    Arguments

    • sentence (String): The string to evaluate.

    Returns

    • (Object): Returns object index locations of each letter in the sentence.

    Example

    const sentence = "hello";
    
    _.letterPositions(sentence);
      // => { h: [0], 
      //      e: [1], 
      //      l: [2, 3], 
      //      o: [4] }
  • map(array, callback): Returns a new array with each value modified based on the callback.

    Since

    • 1.0.1

    Arguments

    • array (Array): The array to evaluate.
    • callback (Function): Callback function that modifies each object[key].

    Returns

    • (Object): Returns new array where each value has been modified by the callback function.

    Example

    const numbers = [1, 2, 3, 4, 5];
    _.map(numbers, n => n * 2);
    // => [2, 4, 6, 8, 10]
  • middle(array): Returns the middle item of the first of the array.

    Since

    • 1.0.0

    Arguments

    • array (Array): The array to process.

    Returns

    • (Array): Returns the middle element of array. If the array length is even, it will return two elements.

    Example

    _.middle(['a', 'b', 'c']);
    // => 'b'
    
    _.middle([1, 2, 3, 4]);
    // => '[2, 3]
  • tail(array): Returns every item in the array except the first item (head).

    Since

    • 1.0.0

    Arguments

    • array (Array): The array to process.

    Returns

    • (Array): Returns every item in an array except the first item.

    Example

    _.tail(['a', 'b', 'c']);
    // => ['b', 'c']
    
    _.tail([1, 2, 3, 4]);
    // => '[2, 3, 4]
  • takeUntil(array, callback): Evaluates each element starting from the beginning until callback evaluates true.

    Since

    • 1.0.1

    Arguments

    • array (Array): The array to evaluate.
    • callback (Function): Callback function that evaluates each element.

    Returns

    • (Array): Returns new array with elements up till element satisfies callback condition.

    Example

    const array = [1, 2, 5, 7, 2, -1, 2, 4, 5];
    _.takeUntil(array, x => x < 0);
    // => [ 1, 2, 5, 7, 2 ]
  • without(source, itemsToRemove): Evaluates each element in the array and removes elements that match itemsToRemove.

    Since

    • 1.0.1

    Arguments

    • source (Array): The array to evaluate.
    • itemsToRemove (Array): The array containing elements to compare for removal.

    Returns

    • (Array): Returns new array with elements that do not contain itemsToRemove.

    Example

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