{"id":21089134,"url":"https://github.com/ngnjs/libdata","last_synced_at":"2025-05-16T11:32:49.668Z","repository":{"id":57130675,"uuid":"282991062","full_name":"ngnjs/libdata","owner":"ngnjs","description":"A library of data management functions.","archived":false,"fork":false,"pushed_at":"2022-09-18T22:03:15.000Z","size":37,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T18:59:08.351Z","etag":null,"topics":["browser","coalesce","data","deno","guid","javascript","nanoid","ngn","nodejs","uuid","web"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngnjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-27T19:06:54.000Z","updated_at":"2023-01-11T06:18:44.000Z","dependencies_parsed_at":"2022-08-31T19:41:51.431Z","dependency_job_id":null,"html_url":"https://github.com/ngnjs/libdata","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngnjs%2Flibdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngnjs%2Flibdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngnjs%2Flibdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngnjs%2Flibdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngnjs","download_url":"https://codeload.github.com/ngnjs/libdata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254522475,"owners_count":22085126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","coalesce","data","deno","guid","javascript","nanoid","ngn","nodejs","uuid","web"],"created_at":"2024-11-19T21:23:36.030Z","updated_at":"2025-05-16T11:32:47.854Z","avatar_url":"https://github.com/ngnjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e@ngnjs/libdata\u003cbr/\u003e\u003cimg src=\"https://img.shields.io/npm/v/@ngnjs/libdata?label=%40ngnjs%2Flibdata\u0026logo=npm\u0026style=social\"/\u003e\u003c/h1\u003e\n\nWhile this JavaScript library is maintained primarily by and for NGN, it is a standalone \"cross-runtime\" library (will work without NGN).\n\nThe library consists of common functions for managing primitive and low level elements of JavaScript (objects, arrays, booleans, etc).\n\n## Usage\n\nSee the [working examples](https://codepen.io/coreybutler/pen/OJNoPJX) on Codepen.\n\n### Via CDN (Browser/Deno)\n\n```javascript\nimport * as DATA from 'https://cdn.skypack.dev/@ngnjs/libdata'\n\nconsole.log(DATA)\n```\n\n_Also available on JSDelivr._\n\n### Node\n\n`npm i @ngnjs/libdata -S`\n\n```javascript\nimport * as DATA from '@ngnjs/libdata'\nconsole.log(DATA)\n```\n\n# Features\n\n\u003cp class=\"description\"\u003e\n  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).\n\u003c/p\u003e\n\u003ch2\u003eConstants\u003c/h2\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\u003cth\u003eName\u003c/th\u003e\u003cth\u003eDescription\u003c/th\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ededupe\u003c/td\u003e\u003ctd\u003eDeduplicate an array.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eforceArray\u003c/td\u003e\u003ctd\u003eForce a value into an array.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eforceBoolean\u003c/td\u003e\u003ctd\u003eForce a value into a boolean.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eforceNumber\u003c/td\u003e\u003ctd\u003eForce a value into a number.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eforceString\u003c/td\u003e\u003ctd\u003eForce a value into a string.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eobject\u003c/td\u003e\u003ctd\u003eA collection of object management methods, including \u003ccode\u003eall\u003c/code\u003e, \u003ccode\u003eany\u003c/code\u003e, \u003ccode\u003eexactly\u003c/code\u003e, \u003ccode\u003erequire\u003c/code\u003e, \u003ccode\u003eextraneous\u003c/code\u003e, \u003ccode\u003emissing\u003c/code\u003e, \u003ccode\u003emixin\u003c/code\u003e, \u003ccode\u003eserialize\u003c/code\u003e\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003etypeOf\u003c/td\u003e\u003ctd\u003eReturns the data type of a value. This is more specific than the native `typeof` operator.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003enullIf\u003c/td\u003e\u003ctd\u003eReturns \u003ccode\u003enull\u003c/code\u003e if the source value matches the provided value.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ecoalesce\u003c/td\u003e\u003ctd\u003eReturns the first non-null/defined value in a list of arguments.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ecoalesceb\u003c/td\u003e\u003ctd\u003eSame as \u003ccode\u003ecoalesce\u003c/code\u003e, but ignores blank/empty strings.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003egetPrimitive\u003c/td\u003e\u003ctd\u003eReturns the primitive object/function of the specified type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eAdvancedSet\u003c/td\u003e\u003ctd\u003eThis is a \u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\" target=\"blank\"\u003eSet\u003c/a\u003e, augmented with additonal methods: \u003ccode\u003eisSuperSet\u003c/code\u003e, \u003ccode\u003econcat\u003c/code\u003e, \u003ccode\u003eintersection\u003c/code\u003e, \u003ccode\u003eexcept\u003c/code\u003e, \u003ccode\u003ediff\u003c/code\u003e, and \u003ccode\u003eequal\u003c/code\u003e\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eGUID\u003c/td\u003e\u003ctd\u003eGenerate a globally unique identifier.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eUUID\u003c/td\u003e\u003ctd\u003eGenerate a universally unique identifier.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eNANOID\u003c/td\u003e\u003ctd\u003eA very fast/efficient unique ID generator.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003echecksum\u003c/td\u003e\u003ctd\u003eCalculate the checksum of an object.\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngnjs%2Flibdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngnjs%2Flibdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngnjs%2Flibdata/lists"}