@stdlib/utils

Standard utilities.

https://github.com/stdlib-js/utils

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.2%) to scientific vocabulary

Keywords

javascript node node-js nodejs stdlib util utilities utility utils

Keywords from Contributors

iterate names tokenizer accumulate capitals assert normalize reduce value strided
Last synced: 4 months ago · JSON representation ·

Repository

Standard utilities.

Basic Info
Statistics
  • Stars: 6
  • Watchers: 3
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Topics
javascript node node-js nodejs stdlib util utilities utility utils
Created over 4 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Security Notice

README.md

About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

Utils

NPM version Build Status Coverage Status <!-- dependencies -->

Utilities.

## Installation ```bash npm install @stdlib/utils ``` Alternatively, - To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]). - If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions). - For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]). The [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships. To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.
## Usage ```javascript var utils = require( '@stdlib/utils' ); ``` #### utils Namespace containing utilities. ```javascript var o = utils; // returns {...} ``` The namespace has the following sub-namespaces:
- [`async`][@stdlib/utils/async]: async utilities.
### Collections
- [`anyByRight( collection, predicate[, thisArg ] )`][@stdlib/utils/any-by-right]: test whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left. - [`anyBy( collection, predicate[, thisArg ] )`][@stdlib/utils/any-by]: test whether at least one element in a collection passes a test implemented by a predicate function. - [`any( collection )`][@stdlib/utils/any]: test whether at least one element in a collection is truthy. - [`append( collection1, collection2 )`][@stdlib/utils/append]: add elements from one collection to the end of another collection. - [`bifurcateBy( collection, [options,] predicate )`][@stdlib/utils/bifurcate-by]: split values into two groups according to a predicate function. - [`bifurcateIn( obj, [options,] predicate )`][@stdlib/utils/bifurcate-in]: split an object's **own** and **inherited** property values into two groups according to a predicate function. - [`bifurcateOwn( obj, [options,] predicate )`][@stdlib/utils/bifurcate-own]: split an object's **own** property values into two groups according to a predicate function. - [`bifurcate( collection, [options,] filter )`][@stdlib/utils/bifurcate]: split values into two groups. - [`countBy( collection, [options,] indicator )`][@stdlib/utils/count-by]: group values according to an indicator function and return group counts. - [`everyByRight( collection, predicate[, thisArg ] )`][@stdlib/utils/every-by-right]: test whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left. - [`everyBy( collection, predicate[, thisArg ] )`][@stdlib/utils/every-by]: test whether all elements in a collection pass a test implemented by a predicate function. - [`every( collection )`][@stdlib/utils/every]: test whether all elements in a collection are truthy. - [`forEachRight( collection, fcn[, thisArg ] )`][@stdlib/utils/for-each-right]: invoke a function for each element in a collection, iterating from the right to left. - [`forEach( collection, fcn[, thisArg ] )`][@stdlib/utils/for-each]: invoke a function for each element in a collection. - [`groupBy( collection, [options,] indicator )`][@stdlib/utils/group-by]: group values according to an indicator function. - [`groupIn( obj, [options,] indicator )`][@stdlib/utils/group-in]: group an object's **own** and **inherited** property values according to an indicator function. - [`groupOwn( obj, [options,] indicator )`][@stdlib/utils/group-own]: group an object's **own** property values according to an indicator function. - [`group( collection, [options,] groups )`][@stdlib/utils/group]: group values as arrays associated with distinct keys. - [`inmapRight( collection, fcn[, thisArg ] )`][@stdlib/utils/inmap-right]: invoke a function for each element in a collection and update the collection in-place, iterating from right to left. - [`inmap( collection, fcn[, thisArg ] )`][@stdlib/utils/inmap]: invoke a function for each element in a collection and update the collection in-place. - [`keyByRight( collection, fcn[, thisArg ] )`][@stdlib/utils/key-by-right]: convert a collection to an object whose keys are determined by a provided function and whose values are the collection values, iterating from right to left. - [`keyBy( collection, fcn[, thisArg ] )`][@stdlib/utils/key-by]: convert a collection to an object whose keys are determined by a provided function and whose values are the collection values. - [`noneByRight( collection, predicate[, thisArg ] )`][@stdlib/utils/none-by-right]: test whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left. - [`noneBy( collection, predicate[, thisArg ] )`][@stdlib/utils/none-by]: test whether all elements in a collection fail a test implemented by a predicate function. - [`none( collection )`][@stdlib/utils/none]: test whether all elements in a collection are falsy. - [`pop( collection )`][@stdlib/utils/pop]: remove and return the last element of a collection. - [`prepend( collection1, collection2 )`][@stdlib/utils/prepend]: add elements from one collection to the beginning of another collection. - [`push( collection, ...items )`][@stdlib/utils/push]: add one or more elements to the end of a collection. - [`reduceRight( arr, initial, reducer[, thisArg ] )`][@stdlib/utils/reduce-right]: apply a function against an accumulator and each element in an array while iterating from right to left and return the accumulated result. - [`reduce( arr, initial, reducer[, thisArg ] )`][@stdlib/utils/reduce]: apply a function against an accumulator and each element in an array and return the accumulated result. - [`reduce2d( arr, initial, fcn[, thisArg] )`][@stdlib/utils/reduce2d]: reduce the number of dimensions by one of a two-dimensional nested array by applying a function against an accumulator and each element along the innermost dimension and returning the accumulation results as a one-dimensional array. - [`shift( collection )`][@stdlib/utils/shift]: remove and return the first element of a collection. - [`someByRight( collection, n, predicate[, thisArg ] )`][@stdlib/utils/some-by-right]: test whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left. - [`someBy( collection, n, predicate[, thisArg ] )`][@stdlib/utils/some-by]: test whether a collection contains at least `n` elements which pass a test implemented by a predicate function. - [`some( collection, n )`][@stdlib/utils/some]: test whether a collection contains at least `n` elements which are truthy. - [`tabulateBy( collection[, options,] indicator )`][@stdlib/utils/tabulate-by]: generate a frequency table according to an indicator function. - [`tabulate( collection )`][@stdlib/utils/tabulate]: generate a frequency table. - [`unshift( collection, ...items )`][@stdlib/utils/unshift]: add one or more elements to the beginning of a collection. - [`untilEachRight( collection, predicate, fcn[, thisArg ] )`][@stdlib/utils/until-each-right]: until a test condition is true, invoke a function for each element in a collection, iterating from right to left. - [`untilEach( collection, predicate, fcn[, thisArg ] )`][@stdlib/utils/until-each]: until a test condition is true, invoke a function for each element in a collection. - [`whileEachRight( collection, predicate, fcn[, thisArg ] )`][@stdlib/utils/while-each-right]: while a test condition is true, invoke a function for each element in a collection, iterating from right to left. - [`whileEach( collection, predicate, fcn[, thisArg ] )`][@stdlib/utils/while-each]: while a test condition is true, invoke a function for each element in a collection.
### Arrays
- [`deepPluck( arr, path[, options] )`][@stdlib/utils/deep-pluck]: extract a nested property value from each element of an object array. - [`find( arr, [opts,] clbk )`][@stdlib/utils/find]: find elements in an array-like object that satisfy a test condition. - [`flattenArray( arr[, options] )`][@stdlib/utils/flatten-array]: flatten an array. - [`objectFromEntries( entries )`][@stdlib/utils/from-entries]: create an object from key-value pairs. - [`indexOf( arr, searchElement[, fromIndex] )`][@stdlib/utils/index-of]: return the first index at which a given element can be found. - [`pluck( arr, prop[, options] )`][@stdlib/utils/pluck]: extract a property value from each element of an object array. - [`unzip( arr[, idx] )`][@stdlib/utils/unzip]: unzip a zipped array (i.e., a nested array of tuples). - [`zip( arr1, arr2,...[, opts] )`][@stdlib/utils/zip]: generate array tuples from input arrays.
### Objects
- [`capitalizeKeys( obj )`][@stdlib/utils/capitalize-keys]: convert the first letter of each object key to uppercase. - [`commonKeys( obj1, obj2[, obj3[,...,objN]] )`][@stdlib/utils/common-keys]: return the common own property names of two or more objects. - [`deepGet( obj, path[, options] )`][@stdlib/utils/deep-get]: get a nested property value. - [`deepSet( obj, path, value[, options] )`][@stdlib/utils/deep-set]: set a nested property value. - [`setConfigurableReadOnlyAccessor( obj, prop, getter )`][@stdlib/utils/define-configurable-read-only-accessor]: define a configurable **read-only** accessor. - [`setConfigurableReadOnly( obj, prop, value )`][@stdlib/utils/define-configurable-read-only-property]: define a configurable **read-only** property. - [`setConfigurableReadWriteAccessor( obj, prop, getter, setter )`][@stdlib/utils/define-configurable-read-write-accessor]: define a configurable **read-write** accessor. - [`setConfigurableWriteOnlyAccessor( obj, prop, setter )`][@stdlib/utils/define-configurable-write-only-accessor]: define a configurable **write-only** accessor. - [`setMemoizedConfigurableReadOnly( obj, prop, fcn )`][@stdlib/utils/define-memoized-configurable-read-only-property]: define a configurable memoized **read-only** object property. - [`defineMemoizedProperty( obj, prop, descriptor )`][@stdlib/utils/define-memoized-property]: define a memoized object property. - [`setMemoizedReadOnly( obj, prop, fcn )`][@stdlib/utils/define-memoized-read-only-property]: define a memoized **read-only** object property. - [`setNonEnumerableProperty( obj, prop, value )`][@stdlib/utils/define-nonenumerable-property]: define a **non-enumerable** property. - [`setNonEnumerableReadOnlyAccessor( obj, prop, getter )`][@stdlib/utils/define-nonenumerable-read-only-accessor]: define a non-enumerable **read-only** accessor. - [`setNonEnumerableReadOnly( obj, prop, value )`][@stdlib/utils/define-nonenumerable-read-only-property]: define a non-enumerable **read-only** property. - [`setNonEnumerableReadWriteAccessor( obj, prop, getter, setter )`][@stdlib/utils/define-nonenumerable-read-write-accessor]: define a non-enumerable **read-write** accessor. - [`setNonEnumerableWriteOnlyAccessor( obj, prop, setter )`][@stdlib/utils/define-nonenumerable-write-only-accessor]: define a non-enumerable **write-only** accessor. - [`defineProperties( obj, properties )`][@stdlib/utils/define-properties]: define (and/or modify) object properties. - [`defineProperty( obj, prop, descriptor )`][@stdlib/utils/define-property]: define (or modify) an object property. - [`setReadOnlyAccessor( obj, prop, getter )`][@stdlib/utils/define-read-only-accessor]: define a **read-only** accessor. - [`setReadOnly( obj, prop, value )`][@stdlib/utils/define-read-only-property]: define a **read-only** property. - [`setReadWriteAccessor( obj, prop, getter, setter )`][@stdlib/utils/define-read-write-accessor]: define a **read-write** accessor. - [`setWriteOnlyAccessor( obj, prop, setter )`][@stdlib/utils/define-write-only-accessor]: define a **write-only** accessor. - [`objectEntriesIn( obj )`][@stdlib/utils/entries-in]: return an array of an object's own and inherited enumerable property key-value pairs. - [`objectEntries( obj )`][@stdlib/utils/entries]: return an array of an object's own enumerable property key-value pairs. - [`enumerablePropertiesIn( obj )`][@stdlib/utils/enumerable-properties-in]: return an array of an object's own and inherited enumerable property names and symbols. - [`enumerableProperties( obj )`][@stdlib/utils/enumerable-properties]: return an array of an object's own enumerable property names and symbols. - [`enumerablePropertySymbolsIn( obj )`][@stdlib/utils/enumerable-property-symbols-in]: return an array of an object's own and inherited enumerable symbol properties. - [`enumerablePropertySymbols( obj )`][@stdlib/utils/enumerable-property-symbols]: return an array of an object's own enumerable symbol properties. - [`flattenObject( obj[, options] )`][@stdlib/utils/flatten-object]: flatten an object. - [`forIn( obj, fcn[, thisArg ] )`][@stdlib/utils/for-in]: invoke a function for each own and inherited enumerable property of an object. - [`forOwn( obj, fcn[, thisArg ] )`][@stdlib/utils/for-own]: invoke a function for each own enumerable property of an object. - [`getPrototypeOf( value )`][@stdlib/utils/get-prototype-of]: return the prototype of a provided object. - [`inheritedEnumerableProperties( obj[, level] )`][@stdlib/utils/inherited-enumerable-properties]: return an array of an object's inherited enumerable property names and symbols. - [`inheritedEnumerablePropertySymbols( obj[, level] )`][@stdlib/utils/inherited-enumerable-property-symbols]: return an array of an object's inherited enumerable symbol properties. - [`inheritedKeys( obj[, level] )`][@stdlib/utils/inherited-keys]: return an array of an object's inherited enumerable property names. - [`inheritedNonEnumerableProperties( obj[, level] )`][@stdlib/utils/inherited-nonenumerable-properties]: return an array of an object's inherited non-enumerable property names and symbols. - [`inheritedNonEnumerablePropertyNames( obj[, level] )`][@stdlib/utils/inherited-nonenumerable-property-names]: return an array of an object's inherited non-enumerable property names. - [`inheritedNonEnumerablePropertySymbols( obj[, level] )`][@stdlib/utils/inherited-nonenumerable-property-symbols]: return an array of an object's inherited non-enumerable symbol properties. - [`inheritedProperties( obj[, level] )`][@stdlib/utils/inherited-properties]: return an array of an object's inherited property names and symbols. - [`inheritedPropertyDescriptor( obj, property[, level] )`][@stdlib/utils/inherited-property-descriptor]: return a property descriptor for an object's inherited property. - [`inheritedPropertyDescriptors( obj[, level] )`][@stdlib/utils/inherited-property-descriptors]: return an object's inherited property descriptors. - [`inheritedPropertyNames( obj[, level] )`][@stdlib/utils/inherited-property-names]: return an array of an object's inherited enumerable and non-enumerable property names. - [`inheritedPropertySymbols( obj[, level] )`][@stdlib/utils/inherited-property-symbols]: return an array of an object's inherited symbol properties. - [`inheritedWritableProperties( obj[, level] )`][@stdlib/utils/inherited-writable-properties]: return an array of an object's inherited writable property names and symbols. - [`inheritedWritablePropertyNames( obj[, level] )`][@stdlib/utils/inherited-writable-property-names]: return an array of an object's inherited writable property names. - [`inheritedWritablePropertySymbols( obj[, level] )`][@stdlib/utils/inherited-writable-property-symbols]: return an array of an object's inherited writable symbol properties. - [`keysIn( obj )`][@stdlib/utils/keys-in]: return an array of an object's own and inherited enumerable property names. - [`lowercaseKeys( obj )`][@stdlib/utils/lowercase-keys]: convert each object key to lowercase. - [`mapKeys( obj, transform )`][@stdlib/utils/map-keys]: map keys from one object to a new object having the same values. - [`mapValues( obj, transform )`][@stdlib/utils/map-values]: map values from one object to a new object having the same keys. - [`merge( target, source1[, source2[,...,sourceN]] )`][@stdlib/utils/merge]: merge and extend objects. - [`moveProperty( source, prop, target )`][@stdlib/utils/move-property]: move a property from one object to another object. - [`nonEnumerablePropertiesIn( obj )`][@stdlib/utils/nonenumerable-properties-in]: return an array of an object's own and inherited non-enumerable property names and symbols. - [`nonEnumerableProperties( obj )`][@stdlib/utils/nonenumerable-properties]: return an array of an object's own non-enumerable property names and symbols. - [`nonEnumerablePropertyNamesIn( obj )`][@stdlib/utils/nonenumerable-property-names-in]: return an array of an object's own and inherited non-enumerable property names. - [`nonEnumerablePropertyNames( obj )`][@stdlib/utils/nonenumerable-property-names]: return an array of an object's own non-enumerable property names. - [`nonEnumerablePropertySymbolsIn( obj )`][@stdlib/utils/nonenumerable-property-symbols-in]: return an array of an object's own and inherited non-enumerable symbol properties. - [`nonEnumerablePropertySymbols( obj )`][@stdlib/utils/nonenumerable-property-symbols]: return an array of an object's own non-enumerable symbol properties. - [`nonIndexKeys( obj )`][@stdlib/utils/nonindex-keys]: return an array of an object's own enumerable property names which are not integer indices. - [`objectInverseBy( obj, [options,] transform )`][@stdlib/utils/object-inverse-by]: invert an object, such that keys become values and values become keys, according to a transform function. - [`objectInverse( obj[, options] )`][@stdlib/utils/object-inverse]: invert an object, such that keys become values and values become keys. - [`omitBy( obj, predicate )`][@stdlib/utils/omit-by]: return a partial object copy excluding properties for which a predicate (function) returns a truthy value. - [`omit( obj, keys )`][@stdlib/utils/omit]: return a partial object copy excluding specified keys. - [`pickArguments( fcn, indices[, thisArg] )`][@stdlib/utils/pick-arguments]: create a function that invokes a provided function with specified arguments. - [`pickBy( obj, predicate )`][@stdlib/utils/pick-by]: return a partial object copy containing properties for which a predicate (function) returns a truthy value. - [`pick( obj, keys )`][@stdlib/utils/pick]: return a partial object copy containing only specified keys. - [`propertiesIn( obj )`][@stdlib/utils/properties-in]: return an array of an object's own and inherited property names and symbols. - [`properties( obj )`][@stdlib/utils/properties]: return an array of an object's own enumerable and non-enumerable property names and symbols. - [`propertyDescriptorIn( obj, property )`][@stdlib/utils/property-descriptor-in]: return a property descriptor for an object's own or inherited property. - [`propertyDescriptor( obj, property )`][@stdlib/utils/property-descriptor]: return a property descriptor for an object's own property. - [`propertyDescriptorsIn( obj )`][@stdlib/utils/property-descriptors-in]: return an object's own and inherited property descriptors. - [`propertyDescriptors( obj )`][@stdlib/utils/property-descriptors]: return an object's own property descriptors. - [`propertyNamesIn( obj )`][@stdlib/utils/property-names-in]: return an array of an object's own and inherited enumerable and non-enumerable property names. - [`propertyNames( obj )`][@stdlib/utils/property-names]: return an array of an object's own enumerable and non-enumerable property names. - [`propertySymbolsIn( obj )`][@stdlib/utils/property-symbols-in]: return an array of an object's own and inherited symbol properties. - [`propertySymbols( obj )`][@stdlib/utils/property-symbols]: return an array of an object's own symbol properties. - [`uncapitalizeKeys( obj )`][@stdlib/utils/uncapitalize-keys]: convert the first letter of each object key to lowercase. - [`uppercaseKeys( obj )`][@stdlib/utils/uppercase-keys]: convert each object key to uppercase. - [`objectValuesIn( obj )`][@stdlib/utils/values-in]: return an array of an object's own and inherited enumerable property values. - [`objectValues( obj )`][@stdlib/utils/values]: return an array of an object's own enumerable property values. - [`writablePropertiesIn( obj )`][@stdlib/utils/writable-properties-in]: return an array of an object's own and inherited writable property names and symbols. - [`writableProperties( obj )`][@stdlib/utils/writable-properties]: return an array of an object's own writable property names and symbols. - [`writablePropertyNamesIn( obj )`][@stdlib/utils/writable-property-names-in]: return an array of an object's own and inherited writable property names. - [`writablePropertyNames( obj )`][@stdlib/utils/writable-property-names]: return an array of an object's own writable property names. - [`writablePropertySymbolsIn( obj )`][@stdlib/utils/writable-property-symbols-in]: return an array of an object's own and inherited writable symbol properties. - [`writablePropertySymbols( obj )`][@stdlib/utils/writable-property-symbols]: return an array of an object's own writable symbol properties.
### Functions
- [`argumentFunction( idx )`][@stdlib/utils/argument-function]: create an argument function. - [`compose( ...fcn )`][@stdlib/utils/compose]: function composition. - [`constantFunction( x )`][@stdlib/utils/constant-function]: constant function. - [`curryRight( fcn[, arity][, thisArg] )`][@stdlib/utils/curry-right]: transform a function into a sequence of functions each accepting a single argument. - [`curry( fcn[, arity][, thisArg] )`][@stdlib/utils/curry]: transform a function into a sequence of functions each accepting a single argument. - [`doUntilEachRight( collection, fcn, predicate[, thisArg ] )`][@stdlib/utils/do-until-each-right]: until a test condition is true, invoke a function for each element in a collection, iterating from right to left. - [`doUntilEach( collection, fcn, predicate[, thisArg ] )`][@stdlib/utils/do-until-each]: until a test condition is true, invoke a function for each element in a collection. - [`doUntil( fcn, predicate[, thisArg ] )`][@stdlib/utils/do-until]: invoke a function until a test condition is true. - [`doWhileEachRight( collection, fcn, predicate[, thisArg ] )`][@stdlib/utils/do-while-each-right]: while a test condition is true, invoke a function for each element in a collection, iterating from right to left. - [`doWhileEach( collection, fcn, predicate[, thisArg ] )`][@stdlib/utils/do-while-each]: while a test condition is true, invoke a function for each element in a collection. - [`doWhile( fcn, predicate[, thisArg ] )`][@stdlib/utils/do-while]: invoke a function while a test condition is true. - [`filterArguments( fcn, predicate[, thisArg] )`][@stdlib/utils/filter-arguments]: create a function that invokes a provided function according to a predicate function. - [`functionName( fcn )`][@stdlib/utils/function-name]: determine a function's name. - [`functionSequence( ...fcn )`][@stdlib/utils/function-sequence]: function sequence. - [`identity( x )`][@stdlib/utils/identity-function]: identity function. - [`mapArguments( fcn, clbk[, thisArg] )`][@stdlib/utils/map-arguments]: create a function that applies arguments to a provided function after transforming arguments according to a callback function. - [`mapFun( fcn, n[, thisArg ] )`][@stdlib/utils/map-function]: invoke a function `n` times and return an array of accumulated function return values. - [`maskArguments( fcn, mask[, thisArg] )`][@stdlib/utils/mask-arguments]: create a function that invokes a provided function according to an argument mask. - [`memoize( fcn[, hashFunction] )`][@stdlib/utils/memoize]: memoize a function. - [`noop()`][@stdlib/utils/noop]: function which does nothing. - [`papplyRight( fcn[, ...args] )`][@stdlib/utils/papply-right]: partially apply function arguments from the right. - [`papply( fcn[, ...args] )`][@stdlib/utils/papply]: partially apply function arguments. - [`rejectArguments( fcn, predicate[, thisArg] )`][@stdlib/utils/reject-arguments]: create a function that invokes a provided function according to a predicate function. - [`reorderArguments( fcn, indices[, thisArg] )`][@stdlib/utils/reorder-arguments]: create a function that invokes a provided function with reordered arguments. - [`reverseArguments( fcn[, thisArg] )`][@stdlib/utils/reverse-arguments]: create a function that invokes a provided function with arguments in reverse order. - [`uncurryRight( fcn[, arity][, thisArg] )`][@stdlib/utils/uncurry-right]: transform a curried function into a function invoked with multiple arguments. - [`uncurry( fcn[, arity][, thisArg] )`][@stdlib/utils/uncurry]: transform a curried function into a function invoked with multiple arguments. - [`until( predicate, fcn[, thisArg ] )`][@stdlib/utils/until]: invoke a function until a test condition is true. - [`whilst( predicate, fcn[, thisArg ] )`][@stdlib/utils/while]: invoke a function while a test condition is true.
### Error Handling
- [`trycatch( x, y )`][@stdlib/utils/try-catch]: if a function does not throw, return the function return value; otherwise, return `y`. - [`tryFunction( fcn )`][@stdlib/utils/try-function]: wrap a function in a try/catch block. - [`tryRequire( id )`][@stdlib/utils/try-require]: wrap `require` in a try/catch block. - [`trythen( x, y )`][@stdlib/utils/try-then]: if a function does not throw, return the function return value; otherwise, return the return value of a second function.
### General Utilities
- [`commonKeysIn( obj1, obj2[, obj3[,...,objN]] )`][@stdlib/utils/common-keys-in]: return the common own and inherited property names of two or more objects. - [`constructorName( value )`][@stdlib/utils/constructor-name]: determine the name of a value's constructor. - [`convertPath( from, to )`][@stdlib/utils/convert-path]: convert between POSIX and Windows paths. - [`copy( value[, level] )`][@stdlib/utils/copy]: copy or deep clone a value to an arbitrary depth. - [`decorateAfter( fcn, arity, after[, thisArg] )`][@stdlib/utils/decorate-after]: decorate a provided function such that the function's return value is provided as an argument to another function. - [`dirname( path )`][@stdlib/utils/dirname]: return a directory name. - [`dsv`][@stdlib/utils/dsv]: utilities for working with data formatted as delimiter-separated values (DSV). - [`rescape( str )`][@stdlib/utils/escape-regexp-string]: escape a regular expression string or pattern. - [`evil( str )`][@stdlib/utils/eval]: alias for `eval` global. - [`extname( filename )`][@stdlib/utils/extname]: return a filename extension. - [`getGlobal( [codegen] )`][@stdlib/utils/global]: return the global object. - [`ifelse( bool, x, y )`][@stdlib/utils/if-else]: if a condition is truthy, return `x`; otherwise, return `y`. - [`ifthen( bool, x, y )`][@stdlib/utils/if-then]: if a condition is truthy, invoke `x`; otherwise, invoke `y`. - [`inherit( ctor, superCtor )`][@stdlib/utils/inherit]: implement prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor. - [`objectKeys( obj )`][@stdlib/utils/keys]: return an array of an object's own enumerable property names. - [`mapReduceRight( arr, initial, mapper, reducer[, thisArg ] )`][@stdlib/utils/map-reduce-right]: perform a single-pass map-reduce operation against each element in an array while iterating from right to left and return the accumulated result. - [`mapReduce( arr, initial, mapper, reducer[, thisArg ] )`][@stdlib/utils/map-reduce]: perform a single-pass map-reduce operation against each element in an array and return the accumulated result. - [`mapRight( arr, fcn[, thisArg] )`][@stdlib/utils/map-right]: apply a function to each element in an array and assign the result to an element in an output array, iterating from right to left. - [`map( arr, fcn[, thisArg] )`][@stdlib/utils/map]: apply a function to each element in an array and assign the result to an element in an output array. - [`map2Right( x, y, fcn[, thisArg] )`][@stdlib/utils/map2-right]: apply a function to elements in two input arrays while iterating from right to left and assign the results to an output array. - [`map2( x, y, fcn[, thisArg] )`][@stdlib/utils/map2]: apply a function to elements in two input arrays and assign the results to an output array. - [`map2d( arr, fcn[, thisArg] )`][@stdlib/utils/map2d]: apply a function to each nested element in an array of arrays and assign the result to a nested element in a new array of arrays. - [`map3d( arr, fcn[, thisArg] )`][@stdlib/utils/map3d]: apply a function to each nested element in a three-dimensional nested array and assign the result to a nested element in a new three-dimensional nested array. - [`map4d( arr, fcn[, thisArg] )`][@stdlib/utils/map4d]: apply a function to each nested element in a four-dimensional nested array and assign the result to a nested element in a new four-dimensional nested array. - [`map5d( arr, fcn[, thisArg] )`][@stdlib/utils/map5d]: apply a function to each nested element in a five-dimensional nested array and assign the result to a nested element in a new five-dimensional nested array. - [`naryFunction( fcn, arity[, thisArg] )`][@stdlib/utils/nary-function]: create a function that invokes a provided function with a specified number of arguments. - [`nativeClass( value )`][@stdlib/utils/native-class]: determine the specification defined classification of an object. - [`nextTick( clbk[, ...args] )`][@stdlib/utils/next-tick]: add a callback to the "next tick queue". - [`openURL()`][@stdlib/utils/open-url]: open a URL. - [`parallel( files, [options,] clbk )`][@stdlib/utils/parallel]: execute scripts in parallel. - [`parseJSON( str[, reviver] )`][@stdlib/utils/parse-json]: parse a string as JSON. - [`realmax( dtype )`][@stdlib/utils/real-max]: return the maximum finite value capable of being represented by a numeric real type. - [`realmin( dtype )`][@stdlib/utils/real-min]: return the smallest positive normal value capable of being represented by a numeric real type. - [`reFromString( str )`][@stdlib/utils/regexp-from-string]: create a regular expression from a regular expression string. - [`safeintmax( dtype )`][@stdlib/utils/safe-int-max]: return the maximum safe integer capable of being represented by a numeric real type. - [`safeintmin( dtype )`][@stdlib/utils/safe-int-min]: return the minimum safe integer capable of being represented by a numeric real type. - [`sizeOf( dtype )`][@stdlib/utils/size-of]: return the size (in bytes) of the canonical binary representation of a specified numeric type. - [`timeit( code, [options,] clbk )`][@stdlib/utils/timeit]: time a snippet. - [`typemax( dtype )`][@stdlib/utils/type-max]: return the maximum value of a specified numeric type. - [`typemin( dtype )`][@stdlib/utils/type-min]: return the minimum value of a specified numeric type. - [`typeOf( value )`][@stdlib/utils/type-of]: determine a value's type.
## Examples ```javascript var objectKeys = require( '@stdlib/utils/keys' ); var utils = require( '@stdlib/utils' ); console.log( objectKeys( utils ) ); ```
* * * ## Notice This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. #### Community [![Chat][chat-image]][chat-url] --- ## License See [LICENSE][stdlib-license]. ## Copyright Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors].

Owner

  • Name: stdlib
  • Login: stdlib-js
  • Kind: organization

Standard library for JavaScript.

Citation (CITATION.cff)

cff-version: 1.2.0
title: stdlib
message: >-
  If you use this software, please cite it using the
  metadata from this file.

type: software

authors:
  - name: The Stdlib Authors
    url: https://github.com/stdlib-js/stdlib/graphs/contributors

repository-code: https://github.com/stdlib-js/stdlib
url: https://stdlib.io

abstract: |
  Standard library for JavaScript and Node.js.

keywords:
  - JavaScript
  - Node.js
  - TypeScript
  - standard library
  - scientific computing
  - numerical computing
  - statistical computing

license: Apache-2.0 AND BSL-1.0

date-released: 2016

GitHub Events

Total
  • Push event: 161
  • Create event: 8
Last Year
  • Push event: 161
  • Create event: 8

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 235
  • Total Committers: 2
  • Avg Commits per committer: 117.5
  • Development Distribution Score (DDS): 0.013
Past Year
  • Commits: 62
  • Committers: 2
  • Avg Commits per committer: 31.0
  • Development Distribution Score (DDS): 0.048
Top Committers
Name Email Commits
stdlib-bot n****y@s****o 232
Philipp Burckhardt p****t@o****m 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • npm 85,099 last-month
  • Total docker downloads: 481,210,190
  • Total dependent packages: 45
  • Total dependent repositories: 285
  • Total versions: 21
  • Total maintainers: 4
npmjs.org: @stdlib/utils

Standard utilities.

  • Homepage: https://stdlib.io
  • License: Apache-2.0
  • Latest release: 0.3.3
    published about 1 year ago
  • Versions: 21
  • Dependent Packages: 45
  • Dependent Repositories: 285
  • Downloads: 85,099 Last month
  • Docker Downloads: 481,210,190
Rankings
Docker downloads count: 0.1%
Downloads: 0.6%
Dependent packages count: 0.6%
Dependent repos count: 0.9%
Average: 4.4%
Forks count: 11.6%
Stargazers count: 12.2%
Funding
  • type: opencollective
  • url: https://opencollective.com/stdlib
Last synced: 4 months ago

Dependencies

any/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
any-by/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
every/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
every-by/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
if-else/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
none/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
none-by/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
real-max/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
real-min/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
safe-int-max/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
safe-int-min/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
size-of/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
type-max/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
type-min/benchmark/julia/REQUIRE julia
  • BenchmarkTools 0.5.0
  • julia 1.5
package.json npm
  • @stdlib/bench github:stdlib-js/bench development
  • @stdlib/complex github:stdlib-js/complex development
  • @stdlib/number github:stdlib-js/number development
  • @stdlib/object github:stdlib-js/object development
  • @stdlib/proxy github:stdlib-js/proxy development
  • chai ^3.5.0 development
  • istanbul ^0.4.1 development
  • proxyquire ^2.0.0 development
  • semver ^6.0.0 development
  • tap-spec 5.x.x development
  • tape git+https://github.com/kgryte/tape.git#fix/globby development
  • @stdlib/array github:stdlib-js/array#main
  • @stdlib/assert github:stdlib-js/assert#main
  • @stdlib/blas github:stdlib-js/blas#main
  • @stdlib/boolean github:stdlib-js/boolean#main
  • @stdlib/buffer github:stdlib-js/buffer#main
  • @stdlib/cli github:stdlib-js/cli#main
  • @stdlib/constants github:stdlib-js/constants#main
  • @stdlib/fs github:stdlib-js/fs#main
  • @stdlib/function github:stdlib-js/function#main
  • @stdlib/math github:stdlib-js/math#main
  • @stdlib/ndarray github:stdlib-js/ndarray#main
  • @stdlib/os github:stdlib-js/os#main
  • @stdlib/process github:stdlib-js/process#main
  • @stdlib/random github:stdlib-js/random#main
  • @stdlib/regexp github:stdlib-js/regexp#main
  • @stdlib/streams github:stdlib-js/streams#main
  • @stdlib/string github:stdlib-js/string#main
  • @stdlib/symbol github:stdlib-js/symbol#main
  • @stdlib/time github:stdlib-js/time#main
  • @stdlib/types github:stdlib-js/types#main
  • debug ^2.6.9
.github/workflows/benchmark.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/cancel.yml actions
  • styfle/cancel-workflow-action 0.11.0 composite
.github/workflows/close_pull_requests.yml actions
  • superbrothers/close-pull-request v3 composite
.github/workflows/examples.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/npm_downloads.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • actions/upload-artifact v3 composite
  • distributhor/workflow-webhook v3 composite
.github/workflows/productionize.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • stdlib-js/bundle-action main composite
  • stdlib-js/transform-errors-action main composite
.github/workflows/publish.yml actions
  • JS-DevTools/npm-publish v1 composite
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • styfle/cancel-workflow-action 0.11.0 composite
.github/workflows/test.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/test_bundles.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • denoland/setup-deno v1 composite
.github/workflows/test_coverage.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • codecov/codecov-action v3 composite
  • distributhor/workflow-webhook v3 composite
.github/workflows/test_install.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite