@ngnjs/libdata

1.0.0-alpha.3 • Public • Published

@ngnjs/libdata

While this JavaScript library is maintained primarily by and for NGN, it is a standalone "cross-runtime" library (will work without NGN).

The library consists of common functions for managing primitive and low level elements of JavaScript (objects, arrays, booleans, etc).

Usage

See the working examples on Codepen.

Via CDN (Browser/Deno)

import * as DATA from 'https://cdn.skypack.dev/@ngnjs/libdata'

console.log(DATA)

Also available on JSDelivr.

Node

npm i @ngnjs/libdata -S

import * as DATA from '@ngnjs/libdata'
console.log(DATA)

Features

The NGN libdata library is a standalone library containing common data manipulation functions. This is significantly more primitive than the NGN Data module. This library contains methods for performing operations to a single data item, whereas the NGN Data module focuses on data modeling, bulk storage, and querying (amongst others).

Constants

Name Description
dedupe Deduplicate an array.
forceArray Force a value into an array.
forceBoolean Force a value into a boolean.
forceNumber Force a value into a number.
forceString Force a value into a string.
object A collection of object management methods, including all, any, exactly, require, extraneous, missing, mixin, serialize
typeOf Returns the data type of a value. This is more specific than the native `typeof` operator.
nullIf Returns null if the source value matches the provided value.
coalesce Returns the first non-null/defined value in a list of arguments.
coalesceb Same as coalesce, but ignores blank/empty strings.
getPrimitive Returns the primitive object/function of the specified type.
AdvancedSet This is a Set, augmented with additonal methods: isSuperSet, concat, intersection, except, diff, and equal
GUID Generate a globally unique identifier.
UUID Generate a universally unique identifier.
NANOID A very fast/efficient unique ID generator.
checksum Calculate the checksum of an object.

Readme

Keywords

none

Package Sidebar

Install

npm i @ngnjs/libdata

Weekly Downloads

13

Version

1.0.0-alpha.3

License

MIT

Unpacked Size

14.2 kB

Total Files

4

Last publish

Collaborators

  • cbutler
  • nodengn
  • gbdrummer
  • authoriocicd