{"id":24375973,"url":"https://github.com/betaweb/nestedjs","last_synced_at":"2025-10-13T13:09:25.372Z","repository":{"id":32459103,"uuid":"134168424","full_name":"betaWeb/NestedJS","owner":"betaWeb","description":"Deal with deep nested arrays in JavaScript","archived":false,"fork":false,"pushed_at":"2022-12-09T08:40:25.000Z","size":13375,"stargazers_count":4,"open_issues_count":20,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-13T13:09:24.204Z","etag":null,"topics":["array-manipulations","collectr","javascript","javascript-array","javascript-library","nested","nested-structures","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/betaWeb.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-20T16:43:11.000Z","updated_at":"2024-06-03T13:27:36.000Z","dependencies_parsed_at":"2023-01-14T21:30:33.872Z","dependency_job_id":null,"html_url":"https://github.com/betaWeb/NestedJS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/betaWeb/NestedJS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2FNestedJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2FNestedJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2FNestedJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2FNestedJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/betaWeb","download_url":"https://codeload.github.com/betaWeb/NestedJS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2FNestedJS/sbom","scorecard":{"id":235017,"data":{"date":"2025-08-11","repo":{"name":"github.com/betaWeb/NestedJS","commit":"47e0453d4b0b8f4fab82c03f29eb6e774adedd33"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"116 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-675m-85rw-j3w4","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-779f-wgxg-qr8f","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-9v62-24cr-58cx","Warn: Project is vulnerable to: GHSA-r8f7-9pfq-mjmv","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-37q6-576q-vgr7","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-hgch-jjmr-gp7w","Warn: Project is vulnerable to: GHSA-r3x4-wr4h-pw33","Warn: Project is vulnerable to: GHSA-876r-hj45-fw7g","Warn: Project is vulnerable to: GHSA-v63x-xc9j-hhvq","Warn: Project is vulnerable to: GHSA-7mwh-4pqv-wmr8","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-w5q7-3pr9-x44w","Warn: Project is vulnerable to: GHSA-3fjq-93xj-3f3f","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-x9hc-rw35-f44h","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-5j4c-8p2g-v4jx","Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T05:29:42.297Z","repository_id":32459103,"created_at":"2025-08-17T05:29:42.297Z","updated_at":"2025-08-17T05:29:42.297Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015283,"owners_count":26085683,"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-10-13T02:00:06.723Z","response_time":61,"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-manipulations","collectr","javascript","javascript-array","javascript-library","nested","nested-structures","nodejs"],"created_at":"2025-01-19T05:58:56.795Z","updated_at":"2025-10-13T13:09:25.353Z","avatar_url":"https://github.com/betaWeb.png","language":"JavaScript","readme":"# NestedJS\n\n[![Build Status](https://travis-ci.org/betaWeb/NestedJS.svg?branch=master)](https://travis-ci.org/betaWeb/NestedJS)\n\nThis library allows you to deal with deep nested arrays in JavaScript.\u003cbr\u003e\nNavigate into nested collections can be tricky, so NestedJS try to get it easier.\n\nYou can find a [live demo](https://codepen.io/betaweb/full/wXvvpZ/) of NestedJS here.\n\n\u003cbr\u003e\n\n## Getting started\n### Installation\n#### Browser :\nDownload the latest version of NestedJS and load the file `Nested.min.js` (on build folder) on your HTML page :\n```HTML\n    \u003cscript src=\"/path/to/Nested.min.js\"\u003e\u003c/script\u003e\n```\n\n#### NodeJS :\nYou just have to install ...\n```bash\n    # with NPM\n    $ npm install nestedjs\n\n    # with Yarn\n    $ yarn add nestedjs\n```\n\n... and load the package on your script\n```JS\nconst NestedJS = require('nestedjs')\n// OR\nimport NestedJS from 'nestedjs'\n```\n\n### Usage\n#### Instanciation\nOnce package loaded, NestedJS must ne instanciate with a nested collection.\n```JS\nconst collection = [...] // Nested data collection\nconst tree = new NestedJS(collection)\n```\n\u003e **IMPORTANT** : The property of every node's children if there are, is named `children` by default. You can change the name with the option `children_key`.\n\n\u003cbr\u003e\n\nThe created instance transform the collection and add several properties and methods to each collection's node :\n#### Properties\n - `__nodeid` : this property is unique and allows you to retrieve a specific node\n - `__parentid` : tag the parent node id of a node if exists, null otherwise\n - `__rootid` : tag the root node id of a node if exists, null otherwise\n - `__previd` : tag the previous node id of a node if exists, null otherwise\n - `__nextid` : tag the next node id of a node if exists, null otherwise\n - `__depth` : tag the node depth (0 to n)\n\n \u003e To know the added properties on each node you must debug your collection, or you can simply browse it with a recursive loop.\n\n#### Methods\nYou can retrieve a node by his unique id :\n```JS\n    const node = tree.retrieveNode(/* __nodeid node unique id */)\n```\n\nThis will returns a node which is an instance of the NestedJS's `Node` class. This class has several methods :\n\n- returns original properties of the node :\n```JS\n    node.properties\n```\n\n- returns node unique id :\n```JS\n    node.getId()\n```\n\n- returns node parent unique id :\n```JS\n    node.getParentId()\n```\n\n- returns next node unique id :\n```JS\n    node.getNextId()\n```\n\n- returns previous node unique id :\n```JS\n    node.getPreviousId()\n```\n\n- check if node property exists :\n```JS\n    node.hasProperty(key)\n```\n\n- returns node property if exists, defaultValue otherwise :\n```JS\n    node.getProperty(key, defaultValue)\n```\n\n- set node's property :\n```JS\n    node.setProperty(key, value)\n```\n\n- returns an array of previous nodes if exists, null otherwise :\n```JS\n    node.previousNodes()\n```\n\n- returns previous node if exists, null otherwise :\n```JS\n    node.previousNode()\n```\n\n- returns true if the node has a predecessor, false otherwise :\n```JS\n    node.hasPreviousNode()\n```\n\n- returns an array of next nodes if exists, null otherwise :\n```JS\n    node.nextNodes()\n```\n\n- returns next node if exists, null otherwise :\n```JS\n    node.nextNode()\n```\n\n- returns true if the node has a successor, false otherwise :\n```JS\n    node.hasNextNode()\n```\n\n- returns an array of siblings nodes if exists, null otherwise\n```JS\n    node.siblingsNodes()\n```\n\n- returns an array of child nodes :\n```JS\n    node.childNodes()\n```\n\n- returns node's first child if it has, null otherwise :\n```JS\n    node.firstChild()\n```\n\n- returns node's last child if is has, null otherwise :\n```JS\n    node.lastChild()\n```\n\n- returns node's child by index if it has, null otherwise :\n```JS\n    node.nthChild()\n```\n\n- return true if the node has children, false otherwise :\n```JS\n    node.hasChildNodes()\n```\n\n- returns parent node if exists, null otherwise :\n```JS\n    node.parentNode()\n```\n\n- returns true if the node has an ancestor, false otherwise :\n```JS\n    node.hasParentNode()\n```\n\n- returns root node if exists, null otherwise :\n```JS\n    node.rootNode()\n```\n\n- returns true if the node has a root node, false otherwise :\n```JS\n    node.hasRootNode()\n```\n\n- returns current node breadcrumb :\n```JS\n    node.breadcrumb()\n```\n\n- returns NestedJS instance :\n```JS\n    node.getTree()\n```\n\n- returns node depth :\n```JS\n    node.depth()\n```\n\n\u003e Each node original properties are preserved and are transferred as properties of the NestedJS's `Node` class.\n\nYou also retrieve one or several nodes by a key/value couple search :\n```JS\nconst nodes = tree.retrieveNodesBy('name', 'lorem')\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetaweb%2Fnestedjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetaweb%2Fnestedjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetaweb%2Fnestedjs/lists"}