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

@kk2022/lotide

v1.0.0

Published

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

Downloads

12

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

Require it:

const _ = require('@kk2022/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 identical
  • assertEqual(actual, expected): Asserts whether two primitive values are strictly equal
  • assertObjectsEqual(object1, object2): Asserts whether two objects are identical
  • assertObjectsEqual(object1, object2): Asserts whether two objects are identical
  • countLetters(sentence): Counts occurrences of characters in input string and returns object with character and count as key-value pairs
  • countOnly(allItems, itemsToCount): Takes in an array of items and an object specifying subset of those items to be counted; outputs object with item and count as key-value pairs
  • eqArrays(array1, array2): Compares two arrays and returns true if they're identical, false otherwise (accepts nested arrays)
  • eqObjects(object1, object2): Compares two objects and returns true if they're identical, false otherwise (accepts nested arrays & objects)
  • findKey(object, callback): Scan's input object and returns first key whose value evaluates to true when passed into the callback function; returns undefined if none found
  • findKeyByValue(object, searchValue): Scan's input object and returns first key whose value matches that of the second argument; returns undefined if none found
  • flatten(array): Takes in array with up to one additional layer of nested arrays and returns a non-nested (flat) array that contains all the values from the input
  • head(array): Returns the first element of the input array, aka the "head" of the array
  • letterPositions(sentence): Takes in a string and returns an object that contains: each character found in the input (as keys) and an array with the indices in which they were found (as values); skips white spaces
  • map(array, callback): Passes each element of the input array into the callback function and returns a new array with the returned values
  • middle(array): Takes in an array and returns the one or two middle elements depending on whether input has odd or even number of elements; returns empty array if input has two or less elements
  • tail(array): Takes in an array and returns all but the first element, aka the "tail" of the array
  • takeUntil(array): Copies each element of the input array into a new array until an element evaluates to true when passed to the callback function
  • without(array): Takes in a source array and an array specifying items to be removed; returns the filtered array