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

@hatem.deux/lotide

v1.0.2

Published

mini-clone of lotide

Readme

Lotide

A mini-clone of the Lodash library.

Author :

Hatem : Github: @AH82 | npm: @hatem.deux

Author's Notes :

Lighthouse Labs

  • This project is a part of a learning experience as a student at Lighthouse Labs's Full-Stack Web-Developper Bootcamp course.
  • This is my very first project.
  • Main focus:
    • Data manipulation (arrays and objects)
    • Callbacks
    • Recursion
    • export / import (require)
    • TDD / BDD with Mocha & Chai
  • Most commented-out code is kept intentionally for learning, improvement & future awareness purposes.
  • These are especially at the bottom of Test files.
  • This project was revisited post-bootcamp and implemented additional excercises, did major clean up and fixed a couple of bugs.

Table of contents

Setup

back to top

CAUTION: This library is published as a part of a learning process. It is not meant for use in serious projects.

Install via npm:

In your Terminal:

> npm install @hatem.deux/lotide

At the top of your JavaScript code:

const _ = require('@hatem.deux/lotide');

Call it (example):

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

Clone it from GitHub

in your terminal:

> git clone [email protected]:AH82/lotide.git

Dependencies

back to top

Install Dependencies in the terminal:

> npm install

DevDependencies

> npm install --save-dev mocha chai

Documentation

back to top

Main Functions

  • All functions are in files of "./<function name>.js"
  • index.js exports all these functions.

| Function name | parameter | Description | | -------------------- | :-----------------------------: | ----------- | | head | array | returns the value of the first (head) element in an array. | tail | array | returns an array of remaining element in an array. | middle | array | returns an array of middle element(s) in an array (1 for odd, 2 for even). | without | SourceArray, itemsToRemoveArray | returns a filtered-out new array. | flatten | array | returns a flattened array from a multi-level nested one in the same element-order (i.e. removes nesting) | countOnly | array, itemsToCountObject | returns an object containing counts of everything the input object listed. | countLetters | string | returns an object a count of each of the letters in that sentence. ignores whitespaces. | letterPositions | string | returns an object with all the indices (zero-based positions) in the string where each character is found. (property-value is an array) | findKeyByValue | object, value | scans the object and return the first key which contains the given value. If no key with that given value is found, then it should return undefined. | map | array, callback | returns an array modified by the callback. | takeUntil | array, callback | returns a slice of the array with elements taken from the beginning until callback returns a truthy value. | findKey | object, callback | returns the first key for which the callback returns a truthy value. If not found, returns undefined. |

Comparison functions

These functions are not included in index.js.

| Function name | parameter | Description | | -------------------- | :-----------------------------: | ----------- | | eqArrays | array1, array2 | deep-compares arrays. returns true if identical. false if not. | eqObjects | object1, object2 | deep-compares objects. returns true if identical. false if not.

Custom Assertion functions

These functions are not included in index.js.

These functions were used during development and are no longer required by other functions. They are kept for archiving and the learning experience.

These are side-effects function do not return, they produce console.logs indicating success or failure of Assertion. They typically use the Comparison functions as inputs to assert. | Function name | parameter | Description | | -------------------- | :-----------------------------: | ----------- | | assertEqual | bool | for regular values | assertArraysEqual | bool | for arrays | assertEqualObjects | bool | for objects |

Testing

Using Mocha/Chai

  • All test files are under "./test/"
  • All Test files are named by the convention "./test/<function name>Test.js"

Running Test

  • At project root folder in the terminal
> mocha

or

> npm test

Change History

back to top

v1.0.2

  • upgrades to version 1.0.2 to fix an npm unpublishing/publishing accidental issue.
  • fixes a minor issue in the interlinks of REAMDME.md

v1.0.1


Improvements

  • eqArrays & eqObjects now support deep comparison (through recursion)
  • README.md redesigned.
  • lints, cleans and removes redundant, dead or commented-out code across entire project, except when intentional.
  • Testing
    • The entire code is now covered by tests.
    • Any in-file custom tests (console.log or custom assertions) moved to the "./test/*" folders.
    • Any remaining custom tests are converted to Mocha/Chai code.
      • except: custom Assertions due to side-effect nature (but rapped in Mocha's describe/it )

Bug fixes

  • takeUntil.js
    • Issue: returns undefined if the callback argument does not match an element. (i.e. does not find a truthy element).
    • Fix: returns the entire array if no match.
  • without.js
    • Issue: Does not return a new array. (i.e. modifies the original).
    • Fix: returns a new array.
  • index.js
    • fixes typo: ~~findKeysByValue~~ => findKeyByValue
  • package.json
    • Issue: "main" refered to the incorrect file => { ..., "main": "assertArraysEqual.js", ... }
    • Fix: "main" now referes to the correct file => { ..., "main": "index.js", ... }
  • functions findKeysByValue, letterPositions, map, takeUntil, without, findKey are now implemented. (on npm package only)

v1.0.0


  • Initial release.

back to top

Meet Larry The Duck - Lighthouse labs mascot

Larry the Duck