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

jamie-huff-lotide

v1.0.0

Published

A library of functions made for lighthouse labs.

Downloads

4

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 @jamie-huff/lotide

Require it:

const _ = require('@jamie-huff/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

head(array) : Given an array, will return the first value

tail(array) : Given an array, will return all values but the first

middle(array) : Return the middle two values of an array, 2 numbers for even length arrays

assertArrayEqual(array1, array2) : Check if arrays are equal returns a statement depending on the answer

assertEqual(actual, expected) : Check if actual and expected values are equal

assertObjectEqual(object1, object2) : Check if objects are equal and returns a statement depnding on the answer

`countOnly(allItems, itemsToCount)' : Takes in an array of items, and an object. returns an object containing only those items that had 'true' beside them inside of the itemsToCount object, aswell as the number of those items.

ex: (allitems = bob, bob, carl, carl) ex: (itemsToCount = "bob": true, "carl": false) would return bob : 2

eqArrays(array1, array2) : Check if two arrays are equal, includes nested arrays. Returns T / F

eqObjects(object1, object2) : Check if two objects are equal, includes nested objects. Returns T / F

findKey(object, callback) : Takes in an object, and callback function, returns the first the key of the object, from the first time the specificed value / name appears.

ex:

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

would give us back // => "noma"

findKeyByValue(object, value) : Returns the key of a specifced value from an object.

flatten(array) : Removes nested arrays. [1, 2, [3, 4]] === [1, 2, 3, 4]

letterPositions(array, callbackfunction) : Takes an an array of values and a callback function, returns a specificed array of values depending on what information is in the callback. Ex:

let words = ["ground", "control", "to", "major", "tom"]; let results1 = map(words, word => word[0]); results 1 = ["g", "c", "t", "m", "t"]

takeUntil(array, callback) : Returns values of an array until a specificed condition in callback is met

without(array1, array2) : Takes in 2 arrays, what ever values are present in array 2 will be removed, array 1 will be returned with those values removed.