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

@jordanbjohnson/lotide

v1.0.0

Published

composition of functions that can be used as methods

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented: 'const results = _.head([1,2]) // => 1'

  • head(passes array): passes in an array, and returns the first item in that array

  • tail(array): takes in an array and returns everything after element 0 [1,2,2,2,3] return [2,2,2,3]

  • middle(array): takes in an array and returns the middle value if odd, and the 2 middle values if even, and if 0 - 2 values, comes back empty [1,2,3,4,5] return [3]

  • countLetters(string): input 1 sentence and return an object that has the letter encountered and how many occurences of those letters [assist] {a: 1, s: 3,
    i: 1, t: 1 }

  • `countOnly(array, strings): counts the occurances of strings passed in and how many times they were passed in in a list of names, ie: list of names, how many occurances of those names [assist] {a: 1, s: 3,
    i: 1, t: 1 }

  • eqArrays([array1], [array2]): takes in an compares the values of two different arrays [1,2,3,4] [1,2,3,4] returns true

  • eqObjects(obj1, obj2): confirms if two object arguments (object1, object2) are indentical, will return true or false value. ----Example---- Function: eqObjects({ a: "1", b: "2" }, { b: "2", a: "1" }) Return: true

  • findKey(object): scan and return first key which the callback returns truthy, if nothing found, return undefined {key1: 1, key2: 2 key3: 3 } (key2) return truthy at key2

  • findKey(obj, action): returns key for given value through function (action) parameter. ----Example---- Function: findKey({ "Blue Hill": { stars: 1 }, "Akaleri": { stars: 3 }, "Noma": { stars: 2 }, "elBulli": { stars: 3 }, "Ora": { stars: 2 }, "Akelarre": { stars: 3 } }, x => x.stars === 2) Returns: "Noma"

  • letterPositions(passes string): function to return the original position of the letter in the string (the L in :Hello" => [2,3])

  • map(arrays): map() is main function that takes 2 arguments, one an array and other with a callback function. when the map is called, are calling our callback function i.e. regularFun("ground"); ( [1,2]) *2 ([2,4 ])

  • takeUntil(arrays): takes in an array and pushes items into the array until the break value ie: const data2 = ["I've", "been", "to", "Hollywood", ",", "I've", "been", "to", "Redwood"]; argument "," return: "I've", "been", "to", "Hollywood"