{"id":16758437,"url":"https://github.com/kessler/digital-chain","last_synced_at":"2026-04-13T11:01:20.433Z","repository":{"id":32788107,"uuid":"36380248","full_name":"kessler/digital-chain","owner":"kessler","description":"A linked list implementation","archived":false,"fork":false,"pushed_at":"2022-05-13T17:46:02.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-04T06:43:06.411Z","etag":null,"topics":["data-structures","javascript","nodejs","nodejs-modules","npm-package"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"davidwalter1/dirutil","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kessler.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":"2015-05-27T16:28:04.000Z","updated_at":"2022-05-04T08:19:24.000Z","dependencies_parsed_at":"2022-09-12T19:23:55.139Z","dependency_job_id":null,"html_url":"https://github.com/kessler/digital-chain","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/kessler/digital-chain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fdigital-chain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fdigital-chain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fdigital-chain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fdigital-chain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kessler","download_url":"https://codeload.github.com/kessler/digital-chain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fdigital-chain/sbom","scorecard":{"id":556421,"data":{"date":"2025-08-11","repo":{"name":"github.com/kessler/digital-chain","commit":"b87dbd3a6931bdc048a61b85c913281e31233768"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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"}}]},"last_synced_at":"2025-08-20T12:28:15.994Z","repository_id":32788107,"created_at":"2025-08-20T12:28:15.995Z","updated_at":"2025-08-20T12:28:15.995Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31749763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["data-structures","javascript","nodejs","nodejs-modules","npm-package"],"created_at":"2024-10-13T04:05:19.052Z","updated_at":"2026-04-13T11:01:20.414Z","avatar_url":"https://github.com/kessler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# digital-chain [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nA linked list implementation\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n*   [LinkedList](#linkedlist)\n    *   [length](#length)\n    *   [push](#push)\n        *   [Parameters](#parameters)\n    *   [pushAll](#pushall)\n        *   [Parameters](#parameters-1)\n    *   [pop](#pop)\n    *   [unshift](#unshift)\n        *   [Parameters](#parameters-2)\n    *   [unshiftAll](#unshiftall)\n        *   [Parameters](#parameters-3)\n    *   [shift](#shift)\n    *   [remove](#remove)\n        *   [Parameters](#parameters-4)\n    *   [swap](#swap)\n        *   [Parameters](#parameters-5)\n    *   [sort](#sort)\n        *   [Parameters](#parameters-6)\n    *   [nodes](#nodes)\n    *   [values](#values)\n    *   [iterator](#iterator)\n    *   [iterator](#iterator-1)\n    *   [reverseIterator](#reverseiterator)\n    *   [findFirst](#findfirst)\n        *   [Parameters](#parameters-7)\n    *   [findAll](#findall)\n        *   [Parameters](#parameters-8)\n    *   [findFirstBy](#findfirstby)\n        *   [Parameters](#parameters-9)\n    *   [findAllBy](#findallby)\n        *   [Parameters](#parameters-10)\n    *   [nodeIterator](#nodeiterator)\n*   [EntryIterator](#entryiterator)\n    *   [Parameters](#parameters-11)\n*   [ValueIterator](#valueiterator)\n    *   [Parameters](#parameters-12)\n*   [NodeIterator](#nodeiterator-1)\n    *   [Parameters](#parameters-13)\n*   [ListNode](#listnode)\n    *   [Parameters](#parameters-14)\n\n### LinkedList\n\na doubly linked list\n\n#### length\n\nreturns the current length of the list\n\n#### push\n\npush an item to the tail of this list\n\n##### Parameters\n\n*   `item` **Variant** any kind of item can be pushed\n\nReturns **[ListNode](#listnode)** the node wrapping the item, nodes can be used in methods such as remove()\n\n#### pushAll\n\npush all the items at the tail of the list\nthe following are equivalent:\n\n```js\nlist.pushAll(1, 2, 3)\nlist.pushAll([1, 2], 3)\nlist.pushAll([1, 2, 3])\n```\n\nto push an array as a single item use .push(arr)\n\n##### Parameters\n\n*   `args` **...\\[Variant]** an array or just arguments to be pushed to the list\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[ListNode](#listnode)\u003e** \n\n#### pop\n\nremove the tail of this list, if the list has more than 1 node in it, the previous node\nwill become the new tail of the list\n\nReturns **Variant** the data from the removed tail node or `undefined` if the list was empty\n\n#### unshift\n\ninsert an item at the head of this list\n\n##### Parameters\n\n*   `item` **Variant** any kind of item can be inserted\n\nReturns **[ListNode](#listnode)** \n\n#### unshiftAll\n\ninsert all the items at the head of the list\nthe following are all equivalent:\n\n```js\n   list.unshiftAll(1, 2, 3)\n   list.unshiftAll([1, 2], 3)\n   list.unshiftAll([1, 2, 3])\n```\n\nto push an array as a single item use .push(arr)\n\n##### Parameters\n\n*   `args` **...\\[Variant]** an array or just arguments to be pushed to the list\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[ListNode](#listnode)\u003e** \n\n#### shift\n\nremove the head of this list, if the list has more than 1 node in it, the next node\nwill become the new head of the list\n\nReturns **Variant** the data from the removed head node or `undefined` if the list was empty\n\n#### remove\n\nRemove a node from the list\n\n##### Parameters\n\n*   `node` **[ListNode](#listnode)** the node to remove\n\nReturns **Variant** the data contained in the removed node\n\n#### swap\n\nswap the positions of node A and node B inside the list\n\nthis method will throw an error if one or more of the arguments is not a `Node` or not a member\nof this list\n\n##### Parameters\n\n*   `nodeA` **[ListNode](#listnode)** \n*   `nodeB` **[ListNode](#listnode)** \n\nReturns **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** returns true if a swap did occur\n\n#### sort\n\nsort the list\n\nthe default sorting comparator is:\n\n```js\nfunction defaultComparator(a, b) {\n if (b \u003e a) return -1\n if (b \u003c a) return 1\n \n return 0\n}\n```\n\n##### Parameters\n\n*   `comparator` **function ([Node](https://developer.mozilla.org/docs/Web/API/Node/nextSibling), [Node](https://developer.mozilla.org/docs/Web/API/Node/nextSibling))?** override the default comparator with a custom one.\n\n#### nodes\n\nAn ES6 iterator of the nodes in this list, starting from the head\n\n```js\nfor (let node of list.nodes()) {\n\tconsole.log(node.data, node.next)\n}\n```\n\nReturns **[NodeIterator](#nodeiterator)** \n\n#### values\n\nAn ES6 iterator of the values in this list, starting from the head\n\n```js\nfor (let value of list.values()) {\n\tconsole.log(value)\n}\n```\n\nReturns **[ValueIterator](#valueiterator)** \n\n#### iterator\n\nAn ES6 iterator of the value and nodes in this list, starting from the head\n\n```js\nfor (let [data, node] of list) {\n\tconsole.log(data === node.data)\n}\n```\n\nReturns **[EntryIterator](#entryiterator)** \n\n#### iterator\n\nA functional iterator over the values in the list, prefer the new ES6 iteration methods over this\n\n#### reverseIterator\n\nAn ES6 iterator of the value and nodes in this list, starting from the *tail*\n\nReturns **[EntryIterator](#entryiterator)** \n\n#### findFirst\n\nfind the first occurrence of this piece of data in the list, equality test\nis performed using `===`\n\n##### Parameters\n\n*   `data` **Variant** data to find\n\nReturns **[ListNode](#listnode)** the first node that contains this data\n\n#### findAll\n\nfind all the occurrences of this piece of data in the list, equality test\nis performed using `===`\nthis will traverse the entire list\n\n##### Parameters\n\n*   `data` **Variant** data to find\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[ListNode](#listnode)\u003e** an array of nodes that contain this data\n\n#### findFirstBy\n\nfinds the first node in the list where the predicate function returns `true`\n\n##### Parameters\n\n*   `predicate` **function (Variant)** a function that returns `true` for nodes that should be included in the search results\n\nReturns **[ListNode](#listnode)** the first node that was found\n\n#### findAllBy\n\nfinds the all the nodes in the list where the predicate function returns `true`\n\n##### Parameters\n\n*   `predicate` **function (Variant)** a function that returns `true` for nodes that should be included in the search results\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[ListNode](#listnode)\u003e** an array of nodes that were found\n\n#### nodeIterator\n\nA functional iterator over the nodes in the list, prefer the new ES6 iteration methods over this\n\n### EntryIterator\n\nImplements iteration over the list's entries (pairs of value + it's hosting node).\nThis iterator is the only iterator that can change it's direction, the others are\nprovided for convenience and only iterate from head to tail.\n\n```js\nconst list = new LinkedList()\n \t\n// iterate from head to tail\nfor (const [value, node] of list) { ... } \t\t\n\n// iterate from tail to head\nfor (const [value, node] of list.reverseIterator()) { ... } \t\t\n```\n\n#### Parameters\n\n*   `list`  \n*   `direction`  \n\n### ValueIterator\n\n**Extends EntryIterator**\n\nImplements iteration over the list's values.\n\n```js\n const list = new LinkedList()\n \t\n // iterate from head to tail\n for (const value of list.values()) { ... } \t\t\n\n```\n\n#### Parameters\n\n*   `list`  \n\n### NodeIterator\n\n**Extends EntryIterator**\n\nImplements iteration over the list's nodes.\n\n```js\n const list = new LinkedList()\n \t\n // iterate from head to tail\n for (const node of list.nodes()) { ... } \t\t\n\n```\n\n#### Parameters\n\n*   `list`  \n\n### ListNode\n\na node in the list\n\n#### Parameters\n\n*   `data`  \n*   `parent`  \n\n## Extension\n\nThis implemenation uses several internal classes for iteration and for \"hosting\" values.\n\n### EntryIterator, ValueIterator, NodeIterator and ListNode\n\nThese classes can be customized via inheritance:\n\n```js\nconst LinkedList = require('digital-chain')\n\nclass MyEntryIterator extends LinkedList.EntryIterator {}\nclass MyValueIterator extends LinkedList.ValueIterator {}\nclass MyNodeIterator extends LinkedList.NodeIterator {}\nclass MyListNode extends LinkedList.ListNode {}\n\n```\n\nThese new classes can then be incorporated into the linked list's by overriding their respective factory methods:\n\n```js\nclass MyLinkedList extends LinkedList {\n    _newEntryIterator(list, direction) {\n        return new MyEntryIterator(list, direction) // direction constants are LinkedList.FROM_HEAD or LinkedList.FROM_TAIL\n    }\n\n    _newValueIterator(list) {\n        return new MyValueIterator(list)\n    }\n\n    _newNodeIterator(list) {\n        return new MyNodeIterator(list)\n    }\n\n    _newListNode(data, parent) {\n        return new MyListNode(data, parent)\n    }\n}\n\n// of course this can also be done to an existing instance:\n\nconst customList = new LinkedList()\ncustomList._newEntryIterator = (list, direction) =\u003e new MyEntryIterator(list, direction)\n\n```\n\n## docs\n\n    documentation readme index.js --section=API\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fdigital-chain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkessler%2Fdigital-chain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fdigital-chain/lists"}