Standard library for JavaScript/TypeScript

Usage no npm install needed!

<script type="module">
  import agyemanjpStandard from 'https://cdn.skypack.dev/@agyemanjp/standard';



Standard library for JavaScript/TypeScript


  • 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


npm install --save @agyemanjp/standard


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

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

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