{"id":23822235,"url":"https://github.com/liqueurdetoile/dotobjectarray","last_synced_at":"2025-11-12T15:02:57.256Z","repository":{"id":29543938,"uuid":"121956382","full_name":"liqueurdetoile/DotObjectArray","owner":"liqueurdetoile","description":"Implements array-like methods for Object with support for dotted notation keys","archived":false,"fork":false,"pushed_at":"2022-12-30T21:59:29.000Z","size":4595,"stargazers_count":1,"open_issues_count":20,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T04:27:36.270Z","etag":null,"topics":["array","array-like","dot-notation","javascript","object"],"latest_commit_sha":null,"homepage":"https://liqueurdetoile.github.io/DotObjectArray/","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/liqueurdetoile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-18T13:54:02.000Z","updated_at":"2024-04-04T14:41:02.000Z","dependencies_parsed_at":"2023-01-14T15:09:49.859Z","dependency_job_id":null,"html_url":"https://github.com/liqueurdetoile/DotObjectArray","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/liqueurdetoile/DotObjectArray","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqueurdetoile%2FDotObjectArray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqueurdetoile%2FDotObjectArray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqueurdetoile%2FDotObjectArray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqueurdetoile%2FDotObjectArray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liqueurdetoile","download_url":"https://codeload.github.com/liqueurdetoile/DotObjectArray/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqueurdetoile%2FDotObjectArray/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284054333,"owners_count":26939559,"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","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["array","array-like","dot-notation","javascript","object"],"created_at":"2025-01-02T09:16:21.211Z","updated_at":"2025-11-12T15:02:57.180Z","avatar_url":"https://github.com/liqueurdetoile.png","language":"JavaScript","readme":"[![NPM](https://nodei.co/npm/dot-object-array.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/dot-object-array)\n\n[![GitHub release](https://img.shields.io/github/release/liqueurdetoile/objectarray.svg)](https://github.com/liqueurdetoile/DotObjectArray)\n[![Gzip size](http://img.badgesize.io/https://cdn.jsdelivr.net/npm/dot-object-array@latest/dist/objectarray.min.js?compression=gzip\u0026style=flat-square)](https://cdn.jsdelivr.net/npm/dot-object-array@latest)\n[![Build Status](https://travis-ci.org/liqueurdetoile/DotObjectArray.svg?branch=master)](https://travis-ci.org/liqueurdetoile/DotObjectArray)\n[![Coverage Status](https://coveralls.io/repos/github/liqueurdetoile/DotObjectArray/badge.svg?branch=master)](https://coveralls.io/github/liqueurdetoile/DotObjectArray?branch=master)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Documentation](https://liqueurdetoile.github.io/DotObjectArray/badge.svg)](https://liqueurdetoile.github.io/DotObjectArray/)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/liqueurdetoile/dotobjectarray/badge.svg?targetFile=package.json)](https://snyk.io/test/github/liqueurdetoile/dotobjectarray?targetFile=package.json) [![Greenkeeper badge](https://badges.greenkeeper.io/liqueurdetoile/DotObjectArray.svg)](https://greenkeeper.io/)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://liqueurdetoile.com\" target=\"\\_blank\"\u003e\u003cimg src=\"https://hosting.liqueurdetoile.com/logo_lqdt.png\" alt=\"Liqueur de Toile\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n# DotObjectArray, a.k.a. DOA a.k.a. ObjectArray\n\n## Why DOA ?\nFor three reasons :\n- No support for associative arrays in vanilla JS\n- Creating deep levels keys in a vanilla JS \u003ctt\u003eObject\u003c/tt\u003e can programmatically be a pain if none of parent keys exists\n- Bored of always using the same snippets everywhere and wants to have a less then 10KB NPM dependency ready to import\n\n## Features\nDOA is an object with a set of methods to :\n- Check, push, get and store data with ease regardless of its level\n- Bring some array-like behaviours for convenience (you know `forEach` for arrays, eh ?)\n- Provide data serializers and parsers\n- Work as well on a whole dataset or a key-based sub-selection of the dataset\n- Ease management of options default values\n\n## Quick examples\n```javascript\n// Import data at creation\nvar doa = new ObjectArray({\n\titem1: 3,\n item2: 12,\n item3: 5\n});\n\n// Add data\ndoa.push('item4', 4); // Single item or dataset\ndoa.import({\n  item5: 5,\n  item6: 6\n});\n\n// Add data with dotted notations\ndoa.push('dat.long.darn.key','isntIt?'); // Will automatically create each keys\n\n// Define default values\n// Will keep value if existent or create keys with value if not\ndoa.define('options.section1.item14', true);\n\n//Iterate on keys at root level or in sub dataset\ndoa.forEach(function(value, key, index) {\n [...]\n});\ndoa.forEach(function(value, key, index) {\n [...]\n}, 'dat.path.to.data');\n\n// Sub dataset import\ndoa.import({\n subitem1: 1,\n subitem2: 'astring',\n subitem3: {obj: really}\n}, 'dat.long.and.far.away.key');\n\n// sub dataset access\ndoa.dataset('dat.long.and.far.away.key');\n// or\ndoa.pull('dat.long.and.far.away.key');\n\n// And many more !\n```\n## Installation\n### Module\nThe ObjectArray class is provided as a UMD module.\n```\nnpm install dot-object-array\n```\nor\n```\nyarn add dot-object-array\n```\nThen simply require/import it :\n```javascript\nimport ObjectArray from 'dot-object-array';\nconst ObjectArray = require('dot-object-array').default;\n```\nObjectArray have been coded with ECMA6 class standard.\n\n### Browser\nDOA is available as CDN external link or can easily be installed locally.\n#### Bundle\n```html\n\u003cscript type=\"text/javascript\" src=\"https://bundle.run/dot-object-array@latest\"\u003e\u003c/script\u003e\n```\n#### JsDelivr\n```html\n\u003cscript type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/dot-object-array@latest\"\u003e\u003c/script\u003e\n```\n#### Unpkg\n```html\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/dot-object-array@latest\"\u003e\u003c/script\u003e\n```\n#### Local install\nFor browser install, you can simply fetch file `dist/objectarray.min.js` in this repo or clone it and load it :\n```html\n\u003cscript type=\"text/javascript\" src=\"myJsFolder/objectarray.min.js\"\u003e\u003c/script\u003e\n```\nAn ObjectArray constructor will be added to global (window) scope.\n\n## Configuring ObjectArray behaviour when a required key doesn't exist\nIn version 1.x, a non-existent key yields to an `undefined` returned value.\n\nIn version 2.x, a non-existent key data request raises an exception except for some methods that can leverage a throwable trigger.\n\nSince version 3.x, the behaviour can be configure per method call or override globally. Each data request have a predefined behaviour\ngiven its goal. For instance, the empty method will throw an exception by default and a dataset call will return undefined by default.\n\nPlease check [API reference](https://liqueurdetoile.github.io/DotObjectArray/identifiers.html) for details.\n\n## Playground\nIf you want to go further and try a bit, you [can go to the playground](https://jsfiddle.net/dx03k9sL/19/).\n\n## Documentation\nA full documentation (manual and API reference) set is available :\n- [Manual](https://liqueurdetoile.github.io/DotObjectArray/manual/index.html)\n- [API reference](https://liqueurdetoile.github.io/DotObjectArray/identifiers.html)\n\n## JSON support\nYou can easily use ObjectArrays to manipulate JSON data. Just rely on JSON native object to import your JSON structure, manipulate it with ObjectArray ease and get it back at the end :wink:\n```javascript\nvar jstring = '{\"dat\": {\"long\": {\"path\": \"foo\", \"dream\": \"baz\"}}}';\nvar doa = new ObjectArray(JSON.parse(jstring));\n\n// Let's say we want to move all dat.long stuff to a short thing\ndoa.push('short', doa.dataset('dat.long')).remove('dat');\n\nconsole.log(JSON.stringify(doa.data)); // outputs {\"short\":{\"path\":\"foo\",\"dream\":\"baz\"}}\n```\n## Bugs and features requests\nObjectArray is test-driven though it did not prevent all issues. Please report here any trouble or features request.\n\n## Want to help ?\nThere is many more to do to implements othe features. Don't mind fork DOA, tweak it and submit a pull request :wink:\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliqueurdetoile%2Fdotobjectarray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliqueurdetoile%2Fdotobjectarray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliqueurdetoile%2Fdotobjectarray/lists"}