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

@jaidenpearson/lotide

v1.0.3

Published

A simplified mock of the Lodash JS library

Downloads

155

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(Array1, Array2): asserts whether two arrays are deeply equal to each other

  • assertEqual(Actual, Expected): discerns whether the output of a function is the expected result

  • assertObjectsEqual(Object1, Object2): asserts whether two objects are deeply equal.

  • countLetters(String): counts how many times a letter appears in a string. Does not count spaces

  • countOnly(Array, Object): Takes an array and counts the amount of times a specified name appears. Names in the object must be a key and have the value True to be counted. Names with a False value will be ignored.

  • eqArrays(Array1, Array2): Same function as assertArraysEqual, only eqArrays returns a True value for deep equality between the Arrays, whereas False is returned for inequality.

  • eqObjects(Object1, Object2): Same function as assertObjects Equal, only returns a True value for deep equality between the Arrays, whereas False is returned for inequality.

  • findKey(Object, Callback): Accepts an object and a callback function. Returns any keys that return true from the callback function.

  • findKeyByValue(Object, Value): Accepts an object and an expected value within the object. Returns the key corresponding to the input value.

  • flatten(Array): Accepts an array, will eliminate all nested arrays within the parent and return all the values in a single array in the same order.

  • head(Array): Accepts an array, will return the first value in the array.

  • letterPositions(String): Accepts a string and indexes where each letter appears in the String. Does not count spaces. Records multiple indexes for repeat letters.

  • map(Array, Callback): Accepts an Array and a Callback function. Loops through the array and returns a new array with values that have returned true from the callback function.

  • middle(Array): Accepts an Array, returns the middle indexed value in the array or the two values closest to the middle.

  • tail(Array): Accepts an Array, returns every value but the first index. Sworn enemy of the head function.

  • takeUntil(Array, Callback): Accepts an Array and a Callback function, pushes values from array into a new array until the callback function returns true. In which case takeUntil returns the new array of values.

  • without(SourceArray, RemoveArray): Accepts two arrays, any stricly matching values between the two arrays are removed and the Source array is returned.