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

@leandro316/lotide

v1.0.3

Published

Clone of lodash

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 @leandro316/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

assertArraysEqual Check if two arrays have the same element. It prints if both of them are equal or not

Arguments - Two array (array1, array2)

Example

assertArraysEqual([1, 2, 3], [1, 2, "3"]); // print Assertion Failed: array1 === array2

assertEqual - Check if two elements are the same, the actual and expected. It prints if both of them are equal or not

Arguments - two values (value, value)

Example

assertArraysEqual("same", "same"); // print Assertion passed: actual === expected

assertObjectsEqual - Check if two objects has the same properties and value, the actual and expected. It prints if both of them are equal or not

Arguments - two objects (object1, object2)

Example

assertObjectsEqual(
  { colors: ["red", "blue"], size: "medium" },
  {
    size: "medium",
    colors: ["red", "blue"],
  }
); // print Assertion passed: actual === expected

countLetters - count the number of letters and return an object

Arguments - string

return - object

Example

countLetters("lighthouse in the house") , // return {
    l: 1,
    i: 2,
    g: 1,
    h: 4,
    t: 2,
    o: 2,
    u: 2,
    s: 2,
    e: 3,
    n: 1,
  } //

countOnly - count the number of Words in array base on the given value in the second arugument of a function.

Arguments - (array, value)

return - object

Example

const firstNames = [
  "Karl",
  "Salima",
  "Agouhanna",
  "Fang",
  "Kavith",
  "Jason",
  "Salima",
  "Fang",
  "Joe",
];
countOnly(firstNames, {
  Jason: true,
  Karima: true,
  Fang: true,
  Agouhanna: false,
}) , // return {Jason: 1, karima: undefined, Fang: 2, Agouhanna: undefined}

eqArrays - check if two arrays has equal values inside

Arguments - (array1, array2)

return - Boolean

Example

eqArrays([1, 2, 3], [1, 2, 3]), // return true

eqObjects - check if two objects has equal key/properties values

Arguments - (object1, object2)

return - Boolean

Example

const multiColorShirtObject = { colors: ["red", "blue"], size: "medium" };
const anotherMultiColorShirtObject = {
  size: "medium",
  colors: ["red", "blue"],
};
eqObjects(multiColorShirtObject, anotherMultiColorShirtObject), // return true

findKey - return the key of an object that meet the requirements in the callback functions

Arguments - (object1, callBackFunction)

return - object key/s

Example

findKey(
  {
    "Blue Hill": { stars: 1 },
    Akaleri: { stars: 3 },
    noma: { stars: 2 },
    elBulli: { stars: 3 },
    Ora: { stars: 2 },
    Akelarre: { stars: 3 },
  },
  (x) => x.stars === 2
); // return "noma"

findKeyByValue - return the key of an object base on the given value

Arguments - (object1, value)

return - object key/s

Example

const bestTVShowsByGenre = {
  sci_fi: "The Expanse",
  comedy: "Brooklyn Nine-Nine",
  drama: "The Wire",
};

findKeyByValue(bestTVShowsByGenre, "The Wire"),// return "drama";

flatten - flatten an array with an array inside

Arguments - (array)

return - array

Example

flatten([1, 2, [3, 4], 5, [6]]); // return [1, 2, 3, 4, 5, 6]

head - get the first element of an array or string

Arguments - (array), (string)

return - value

Example

head([1, 2, 3]); // return 1

letterPositions - get the index of a given letter/s

Arguments - (string)

return - object

Example

letterPositions("hello").l,// return [2, 3]

middle - get the middle value/s of an array

Arguments - (array)

return - array

Example

middle([1, 2, 3]), // return [2]
middle([1, 2, 3, 4, 5, 6]), // return [3,4]

tail - get all the elements of an array except the first element

Arguments - (array)

return - array

Example

tail(["Hello", "Lighthouse", "Labs"]), // return ["Lighthouse", "Labs"]
tail([1, 2, 3]), // return [2,3]

takeUntil - return an array that meet the requirements in the call back functions. It stops to get the elements of an array once he meet the conditions in callback functions

Arguments - (array, function)

return - array

Example

const data1 = [1, 2, 5, 7, 2, -1, 2, 4, 5];
const data2 = [
  "I've",
  "been",
  "to",
  "Hollywood",
  ",",
  "I've",
  "been",
  "to",
  "Redwood",
];

const results1 = takeUntil(data1, (x) => x < 0); // return [1, 2, 5, 7, 2]
const results2 = takeUntil(data2, (x) => x === ","); // return  ["I've", "been", "to", "Hollywood"]

takeUntil - Return an array by removing the elements from array one that are also present in array two

Arguments - (arrayOne, arrayTwo)

return - array

Example

const words = ["hello", "world", "lighthouse"];
without(words, ["lighthouse"]); // return ["hello", "world"]