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

@teyya/lotide

v1.0.0

Published

A simplier reimagining of Lodash coded as an educational exercise for Lighthouse Labs

Downloads

2

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head: returns the first item of an array.
  • tail: returns an array minus the head (first item).
  • middle: returns an array with the middle item(s) from the array used as the argument (one if odd, two if even).
  • assertEqual:
  • eqArrays: returns if two arrays are deeply equal
  • eqObjects: returns if two objects are deeply equal
  • assertArraysEqual: console.logs a statement in regards to if two arrays are deeply equal.
  • assertObjectsEqual: console.logs a statement in regards to if two objects are deeply equal.
  • countletters: returns an object wherein there is a key:value pair with every letter that appears in the string at least once as the keys. The values are the number of instances of that letter there are in the string.
  • countOnly: With an array as the first argument and an object as the second. The object being possessing keys with only boolean values. countOnly will search all items in the array for any that match keys with a value of TRUE, and return an object with those keys. The value, however, will be the number of instances in which that key/item can be found in the array.
  • findKey: With the first argument being an object, and the second (callback function) a value presumably IN that object, findKey will return a key with that value.
  • findKeyByValue: Similar to 'findKey', with the first argument being an obeject and the second a value, it will return a key with that value IF POSSIBLE.
  • flatten: Given an array with nested array(s) and potentially non-array items inside, will return an array with those nested items 'flattened' and 'retrieved' into a single-level array. Essentially, it removes one level of nested '[]'.
  • map: Applies the callback function to all items in an array, returning an array of the same length with the results.
  • takeUntil: returns an array that has all the items in the original array up until the 'cut off point', which is when (callback(item)) returns TRUE.
  • without: Takes in two arrays and returns a new one. Any items in the first that match a one in the second are NOT included in the new array.