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 🙏

© 2026 – Pkg Stats / Ryan Hefner

chorecore

v4.1.0

Published

Utilities to simplify many commonly used pieces of code

Downloads

13

Readme

ChoreCore

NPM Version Downloads Code Size GitHub Issues

Alphabet

Objects

alphabet

Contains the alphabet in an abundance of variants in Array form.

| Name | Value | |----------------------|------------------------------------------------------------------------------------------------------------------------------------| | LOWERCASE | ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] | | UPPERCASE | ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] | | LOWERCASE_VOWELS | ["a", "e", "i", "o", "u", "y"] | | UPPERCASE_VOWELS | ["A", "E", "I", "O", "U", "Y"] | | LOWERCASE_NON_VOWELS | ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z"] | | UPPERCASE_NON_VOWELS | ["B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Z"] |

alphabet.strings

Contains the alphabet in an abundance of variants in String form.

| Name | Value | |----------------------|------------------------------| | LOWERCASE | "abcdefghijklmnopqrstuvwxyz" | | UPPERCASE | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | | LOWERCASE_VOWELS | "aeiouy" | | UPPERCASE_VOWELS | "AEIOUY" | | LOWERCASE_NON_VOWELS | "bcdfghjklmnpqrstvwxz" | | UPPERCASE_NON_VOWELS | "BCDFGHJKLMNPQRSTVWXZ" |

Methods

All constants have an accompanying method that will simply return the character at the index passed to it

  • lowercaseAt(i: number): string

  • uppercaseAt(i: number): string

  • lowercaseVowelAt(i: number): string

  • uppercaseVowelAt(i: number): string

  • lowercaseNonVowelAt(i: number): string

  • uppercaseNonVowelAt(i: number): string

Conditionals

Conditional functions were created to simplify ternary operations when you only want to define one condition.

This is often most useful in string interpolation, but is definitely not limited to this.

isEven(testVal: number, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is even, the returnVal is returned, otherwise it will return elseVal.

isEqual(originalVal: any, testVal: any, returnVal: any = originalVal, sameType: boolean = true, elseVal: any = ''): any

If the originalVal and testVal are equal, the returnVal is returned, otherwise it will return elseVal.

The sameType parameter determines whether to test type equality too. When true it will use ===, when false it will use ==.

isFalse(testVal: any, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is false, the returnVal is returned, otherwise it will return elseVal.

isGT: (originalVal: any, testVal: any, returnVal: any = originalVal, elseVal = ''): any

If the originalVal is greater than the testVal, the returnVal is returned, otherwise it will return elseVal.

isGTE: (originalVal: any, testVal: any, returnVal: any = originalVal, elseVal = ''): any

If the originalVal is greater than or equal to the testVal, the returnVal is returned, otherwise it will return elseVal.

isLT: (originalVal: any, testVal: any, returnVal: any = originalVal, elseVal = ''): any

If the originalVal is less than the testVal, the returnVal is returned, otherwise it will return elseVal.

isLTE: (originalVal: any, testVal: any, returnVal: any = originalVal, elseVal = ''): any

If the originalVal is less than or equal to the testVal, the returnVal is returned, otherwise it will return elseVal.

isNotEqual(originalVal: any, testVal: any, returnVal: any = originalVal, sameType: boolean = true, elseVal: any = ''): any

If the originalVal and testVal are not equal, the returnVal is returned, otherwise it will return elseVal.

The sameType parameter determines whether to test type equality too. When true it will use !==, when false it will use !=.

isNotNull(testVal: any, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is not null, the returnVal is returned, otherwise it will return elseVal.

isNotUndefined(testVal: any, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is not undefined, the returnVal is returned, otherwise it will return elseVal.

isNull(testVal: any, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is null, the returnVal is returned, otherwise it will return elseVal.

isOdd(testVal: number, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is odd, the returnVal is returned, otherwise it will return elseVal.

isTrue(testVal: any, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is true, the returnVal is returned, otherwise it will return elseVal.

isUndefined(testVal: any, returnVal: any = testVal, elseVal: any = ''): any

If the testVal is undefined, the returnVal is returned, otherwise it will return elseVal.

Math

closest(needle: number, arr: number[]): number

This method will return the closest value in the array to the needle

Example:

closest(8, [1, 7, 3, 10, 5]) 
// returns 7

 

parseFractionString(fraction: string): number

This method parses a function written in out in a string and returns the number as a decimal

Strings

capitalize(alterVal: string): string

This method will return an altered version of the string provided which only ensures the first letter is capitalized

sentenceCase(alterVal: string): string

This method will alter the provided string by capitalizing the first letter, and making all other letters lowercase.

Time

Object

time

Contains all time constants in milliseconds (Units such as months and up are not included as they are not constant).

| Unit | Value | |-------------|-----------| | MILLISECOND | 1 | | SECOND | 1000 | | MINUTE | 60000 | | HOUR | 3600000 | | DAY | 86400000 | | WEEK | 604800000 |

Methods

All constants have an accompanying method that will simply return that unit in milliseconds multiplied by the argument you pass in.

  • days(multiplier: number): number

  • hours(multiplier: number): number

  • milliseconds(multiplier: number): number

  • minutes(multiplier: number): number

  • seconds(multiplier: number): number

  • weeks(multiplier: number): number

Symbols

Object

fraction

Contains all Unicode fraction symbols

| Name | Value | |----------------|-------| | ONE_HALF | ½ | | ONE_THIRD | ⅓ | | ONE_QUARTER | ¼ | | ONE_FIFTH | ⅕ | | ONE_SIXTH | ⅙ | | ONE_SEVENTH | ⅐ | | ONE_EIGHTH | ⅛ | | ONE_NINTH | ⅑ | | ONE_TENTH | ⅒ | | TWO_THIRDS | ⅔ | | TWO_FIFTHS | ⅖ | | THREE_QUARTERS | ¾ | | THREE_FIFTHS | ⅗ | | THREE_EIGHTHS | ⅜ | | FOUR_FIFTHS | ⅘ | | FIVE_SIXTHS | ⅚ | | FIVE_EIGHTHS | ⅝ | | SEVEN_EIGHTHS | ⅞ |

Method

fractionToSymbol(originalVal: number | string): string

This method accepts a fraction (either as a number or a string) and returns the closest value from the list of symbols above

Throws an error if the provided value is less than or equal to -1, or greater than or equal to 1