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

@chrispytel/lotide

v1.0.0

Published

My library clone of Lodash, project created while at Lighthouse Labs

Downloads

6

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 Chris Pytel as part of my learnings at Lighthouse Labs.

Usage

Install it:

npm install @chrispytel/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertEqual : AssertEqual checks two values against each other (strictly without type coercion). Prints the result to console if they are equal or not.
  • assertArraysEqual : assertArraysEqual asserts two arrays against each other utilizing the imported eqArrays module, prints the result of the assertions to the console if are equal or not.
  • assertObjectsEqual : assertObjectsEqual takes in two objects and console.logs if theyre equal or different,passes the objects through eqObjects first to check if they contain matching properties.
  • countLetters : countletters takes in a string and counts how many time a particular letter appears inside, it stores the letters and their total number of times it appears into an object. Lastly, it returns the object.
  • countOnly : countOnly takes in two parameters allItems: an array of strings that we need to look through.itemsToCount: an object specifying what to count. It will create a new object and log how many times that item appears, then returns results.
  • eqArrays : eqArrays takes in two arrays and checks their values against each other. Returns true/false depending if the two arrays contents are an exact match.
  • eqObjects : eqObjects checks two objects against each other and returns true if both objects have identical keys and values, returns false if there is a mismatch. Contents within arrays are also checked if they match. Returns undefined if 1 or 0 parameters are passed in.
  • findKey : findKey passes in an object and a callback as parameters. It returns the first key that matches the callbacks parameter.
  • findKeyByValue : findKeyByValue takes in an object and a value. It iterates through the object and return the first key which contains the given value. If no key with that value is found, then it should return undefined.
  • flatten : flatten will take in an array as an argument (potentially containing many nested arrays) and return a single array with all of the values "flattened". Now contains logic for dealing with infinitely nested arrays via recursion and a new helper function within flatten.
  • head : head takes in an array as a parameter, and returns the first value found in it.
  • tail : tail takes in an array, and returns the result of everything that isnt the first element and returns a new array.
  • middle : Middle takes in an array and returns an new array containing the middle value or values. Returns the 1 value from the middle of the array if the length is odd. Returns the 2 values from the middle of the array if the length is even. Returns an empty array if its length is under 3 total indexes as there is no middle.
  • letterPositions : letterPostions takes in a string as its parameter and returns an object. The function logs every time a letter appears in the string, and marks where it appears in the index. An object is compiled containing letters and their index numbers and is returned at the end.
  • map : similar to the JS map() function, this version takes in an array as its parameter and returns a new array based on what we want the callback function to do with the elements from our initial array.
  • takeUntil : takeUntil takes in an array, and a callback, creates a new array of elements after checking what our callback function requires, stopping when condition is met and returning the new array.
  • without : without function returns a filtered array by taking in 2 parameters. array: an array that we want filtered. removeThis: an array that contains elements to remove from our first array.