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

@leaddreamer/genericutilities

v0.1.5

Published

useful cross-project utilities

Downloads

14

Readme

view on
npm

@leaddreamer/GenericUtilities

Useful cross-project utilities to be shared between Back and Front End - not browser services.

Modules

GenericUtilities

useful cross-project utilities, to be shared between Back and Front End - not browser services.

Utilities

Typedefs, constants, support functions and database operations for general Utilities

Utilities.simpleObjectCompare(object1, object2) ⇒ boolean

Simple top-level object compare - assumes objects have similar structure - or AT LEAST all the fields of object1 are present in object2

Kind: static method of Utilities

| Param | Type | | --- | --- | | object1 | object | | object2 | object |

Utilities.formatItem(thisItem, thisFormat) ⇒ string

Allows string substitution from an object field names support Dot notation field names allow ":" extension for alternate formatting

Kind: static method of Utilities

| Param | Type | Description | | --- | --- | --- | | thisItem | object | object to create formated string from | | thisFormat | string | string describing formatted output - fieldname wrapped in {} will be substituted. DOT notation allowed for fields. |

Utilities.compare(thisItem, anotherItem, sort) ⇒ string

Kind: static method of Utilities

| Param | Type | Description | | --- | --- | --- | | thisItem | object | one of two objects being compared | | anotherItem | object | the other of two objects being compared | | sort | string | string describing sort - format "fieldName:sortType" - sort Type is "string, "date" or "number" (default) |

Utilities.anyInAny(findFrom, findIn) ⇒ boolean

An array based compare function - is any entry of findFrom present in findIn

Kind: static method of Utilities

| Param | Type | | --- | --- | | findFrom | Array.any | | findIn | Array.any |

Utilities.PromisePoolRunner(entryArray, actionFunction, promiseOptions) ⇒ Promise

Kind: static method of Utilities

| Param | Type | | --- | --- | | entryArray | Array.object | | actionFunction | callback | | promiseOptions | PromiseOptions |

Utilities.lesserOf(args) ⇒ number

A convenience function for legibility

Kind: static method of Utilities
Returns: number - the least of any of the arguments b

| Param | Type | Description | | --- | --- | --- | | args | any | unbounded list of arguments |

Utilities.largerOf(args) ⇒ number

Kind: static method of Utilities
Returns: number - the largest of any of the arguments

| Param | Type | Description | | --- | --- | --- | | args | any | unbounded list of arguments |

Utilities.bound(value, lowerBound, upperBound) ⇒ number

clips value to given bounds

Kind: static method of Utilities

| Param | Type | | --- | --- | | value | number | | lowerBound | number | | upperBound | number |

Utilities.blindPush(targetArray, newObject)

function to push an element to an array which may not be initialized

Kind: static method of Utilities

| Param | Type | | --- | --- | | targetArray | Array.object | | newObject | object |

Utilities.addToArrayObject(arrayObject, key, object)

Kind: static method of Utilities

| Param | Type | Description | | --- | --- | --- | | arrayObject | Array.Array.object | | | key | string | key or index to choose which Array.object to add this object to | | object | object | |

Utilities.makeHexAsNeeded(color) ⇒ string

Kind: static method of Utilities
Returns: string - hex value of named color

| Param | Type | Description | | --- | --- | --- | | color | string | name of color |

Utilities~PromisePool

Kind: inner constant of Utilities

Utilities~promiseOptionsDefault : PromiseOptions

Kind: inner constant of Utilities
Default: {"concurrency":3,"rate":10}
Read only: true

Utilities~generateIterator(entryArray, actionFunction)

An Action Iterator Generator. Cycles through the entries in the passed array, yielding the result of a function for each entry. Only cares that inputs are an array, and a function that returns a promise

Kind: inner method of Utilities

| Param | Type | | --- | --- | | entryArray | Array.any | | actionFunction | callback |

Utilities~PromiseOptions : object

Kind: inner typedef of Utilities
Properties

| Name | Type | | --- | --- | | concurrency | number | | rate | number |

PromiseQueue

Typedefs, constants, support functions and database operations related to Promise getQueueSize Thes era euseful for scheduling large serial asynchronous operations


© 2020-2024 Tracy Hall / Dreams and Logic Inc / SaltSweetSpirits