@sparkwave/standard
TypeScript icon, indicating that this package has built-in type declarations

2.34.2 • Public • Published

standard.js

A standard library for JavaScript/TypeScript

Features

  • Lazy iterable combinators such as map, filter, reduce, etc.
  • Lazy async iterable combinators such as mapAsync, filterAsync, etc.
  • Fluent iterable containers: Sequence, Set, Array, ArrayNumeric, Dictionary
  • Functional combinators such as flip, curry, etc.
  • Async combinators such as promisify, sleep, etc.
  • Statistical functions such as mean, median, quartiles, variance/standard deviation, etc.
  • Advanced string, date-time, and numeric functions
  • Utility types, type guards, and value helpers

Install

npm install --save @sparkwave/standard

Usage

// import specific functions from specific modules
import { mapAsync, ZipAsync, isAsyncIterable /*, ...*/ } from "@sparkwave/standard/collections/combinators"
import { keys, entries, pick, omit  /*, ...*/ } from "@sparkwave/standard/object"
import { sleep, promisify } from "@sparkwave/standard/async"

// import everything from a module
import * as containers from "@sparkwave/standard/collections/containers"
const numArray = new containers.Array([1, 2, 3])

// import everything from package
import * as stdlib from "@sparkwave/standard"
type Predicate<T> = stdlib.Predicate<T>

Package Sidebar

Install

npm i @sparkwave/standard

Weekly Downloads

5

Version

2.34.2

License

MIT

Unpacked Size

197 kB

Total Files

37

Last publish

Collaborators

  • spencerg
  • eltharim
  • hypothesizemachineuser