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

@awai/toolbox

v0.0.6

Published

Set of tools you'll always need. So, just `npm install --save @awai/toolbox` and have it always at hand.

Downloads

2

Readme

AWAI Toolbox

Set of tools you'll always need. So, just npm install --save @awai/toolbox and have it always at hand.

Resources

  • Sources: https://github.com/agroupp/awai/tree/master/libs/toolbox
  • Source Code Documentation: https://agroupp.github.io/awai/toolbox/

Str

Set of helper constants and methods for text processing.

Accessors

Accessor | Description ---------|------------ empty | Empty string englishLettersOrdered | Ordered set of lowercase English letters

Methods

Method | Description -------|------------- capitalize(str: string) | Return a copy of the string with its first character capitalized and the rest lowercased isAlpha(str: string) | Return true if all characters in the string are alpha only isControl(char: string) | Return true if char is ASCII control symbol isDomainName(str: string) | Return true if string looks like a valid domain name isEmail(str: string) | Return true if string is a valid email address isIp(str: string) | Return true if string is a valid IP address isLower(str: string) | Return true if all characters in the string are lowercase isNullOrEmpty(str: string) | Return true if a specified string is null or empty isNullOrWhiteSpace(str: string) | Return true if a specified string is null, empty, or consists only of white-space characters isNumber(str: string) | Return true if all characters in the string are digits only isUpper(str: string) | Return true if all characters in the string are uppercase parseNumBool(str: string) | Try to find number or boolean value in a provided string and return converted value random(size: number, alphaLower, alphaUpper, decimal) | Generate alpha numeric random sequence string splitLines(str: string) | Return an array of the lines in the string, breaking at line boundaries swapCase(str: string) | Return a copy of the string with uppercase characters converted to lowercase and vice versa wrapInHtmlTag(str: string, term: string, tagName: string, tagClasses: string[]) | Return source text with "term" wrapped by specified HTML tag

Arr

Provides a set of helper methods for arrays.

Accessors

Accessor | Description ---------|------------ englishLettersOrdered | Ordered set of lowercase English letters englishLettersUppercaseOrdered | Ordered set of upercase English letters

Methods

Method | Description -------|------------- bytesToFloat(bytes: Uint8Array) | Convert array of bytes into array of floats within range [0.0, 1.0] first(arr: Array) | Return the first element of a specified array isNullOrEmpty(arr: Array) | Return true if a specified array is null or empty last(arr: Array) | Return the last element of a specified array range(size: number, start: number) | Return array filled by range of integers removeEmptyStrings(arr: string[]) | Remove empty string elements from string array shuffle(arr: Array) | Shuffle the array by method Fisher–Yates stringToCharArray(str: string) | Convert string into array of chars

Random

Provides a set of helper methods to generate cryptographically strong random values.

Methods (RandomBytesProvider)

Method | Description -------|------------- nextBytes(size: number) | Return array of random bytes nextBytesAsync(size: number) | Return promise that resolves to array of random bytes

Methods (Rnd)

Method | Description -------|------------- nextFloat(qty: number) | Return a random floating-point number or array of random floating-point numbers that is greater than or equal to 0.0, and less than 1.0 nextFloatAsync(qty: number) | Return a promise that resolves to random floating-point number or array of random floating-point numbers that is greater than or equal to 0.0, and less than 1.0 nextInt(min: number, max: number, qty: number) | Return a random integer or array of random integers that is within a specified range nextIntAsync(min: number, max: number, qty: number) | Return a promise that resolves to random integer or array of random integers that is within a specified range

Url

The Url class is used to parse or create from 0 the URL. It gives you different property accessors that allow you easily access or set parts of the URL. Create the Url instance with the uri string or empty to construct it from zero.

Methods

Method | Description -------|------------- isUrl(value: string) | Return true if provided value can be parsed as valid URI toString() | Return string representation of the whole URL toURL() | Return URL object

Accessors

Accessor | Description ---------|------------ protocol | IANA-registered scheme or protocol domain | Name of the domain or IP address port | IP port number username | Username for HTTP Authentication password | Password for HTTP Authentication pathString | Route path in form /route/path pathParams | Route path as array of its parts path | Route path in form /route/path queryParams | Map of query params as a key - value. Values are parsed as strings, numbers and booleans hashFragment | Hash fragment isSsl | Return true if SSL is used

Running unit tests

Run nx test toolbox to execute the unit tests via Jest.