{"id":29405066,"url":"https://github.com/the-pied-piper/b-cache","last_synced_at":"2026-05-18T19:05:17.548Z","repository":{"id":29990240,"uuid":"121635379","full_name":"The-Pied-Piper/B-Cache","owner":"The-Pied-Piper","description":"Simple data abstraction layer to use in a brower","archived":false,"fork":false,"pushed_at":"2023-01-03T23:02:54.000Z","size":872,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-24T04:29:31.442Z","etag":null,"topics":["browser-cache","data-abstraction","graph","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://the-pied-piper.github.io/B-Cache","language":"TypeScript","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/The-Pied-Piper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-15T13:53:28.000Z","updated_at":"2022-01-09T15:32:08.000Z","dependencies_parsed_at":"2023-01-14T16:03:33.658Z","dependency_job_id":null,"html_url":"https://github.com/The-Pied-Piper/B-Cache","commit_stats":null,"previous_names":["the-pied-piper/browserdb"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/The-Pied-Piper/B-Cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Pied-Piper%2FB-Cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Pied-Piper%2FB-Cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Pied-Piper%2FB-Cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Pied-Piper%2FB-Cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/The-Pied-Piper","download_url":"https://codeload.github.com/The-Pied-Piper/B-Cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Pied-Piper%2FB-Cache/sbom","scorecard":{"id":139709,"data":{"date":"2025-08-11","repo":{"name":"github.com/The-Pied-Piper/B-Cache","commit":"a15e54549ec085596e93bb9feb536577b0b287e7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"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":"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":"Code-Review","score":0,"reason":"Found 0/28 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":"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":"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":"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":"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":"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":"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 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":"74 existing vulnerabilities detected","details":["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-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-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","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-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-vfrc-7r7c-w9mx","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","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-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2","Warn: Project is vulnerable to: GHSA-ch52-vgq2-943f","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","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-hj48-42vr-x3v9","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-c2qf-rxjj-qqgw","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-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","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-16T07:39:31.877Z","repository_id":29990240,"created_at":"2025-08-16T07:39:31.878Z","updated_at":"2025-08-16T07:39:31.878Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278873063,"owners_count":26060697,"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-07T02:00:06.786Z","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":["browser-cache","data-abstraction","graph","javascript","typescript"],"created_at":"2025-07-10T21:13:18.508Z","updated_at":"2025-10-08T01:13:29.563Z","avatar_url":"https://github.com/The-Pied-Piper.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# B-Cache\n\n\n[![CircleCI](https://img.shields.io/circleci/project/github/The-Pied-Piper/B-Cache.svg?style=plastic)](https://circleci.com/gh/The-Pied-Piper/B-Cache)\n[![npm](https://img.shields.io/npm/dm/b-cache.svg?style=plastic)](https://www.npmjs.com/package/b-cache)\n[![GitHub package version](https://img.shields.io/github/package-json/v/The-Pied-Piper/B-Cache.svg?style=plastic)](https://github.com/The-Pied-Piper/B-Cache)\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/The-Pied-Piper/B-Cache.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/The-Pied-Piper/B-Cache/context:javascript)\n\n\n\nA simple to use memory based storage for complex data types. Currently only a graph like implementation is avalible. This works by defining vertices and edges and adding them to an instance of a graph. At its heart this is a data abstraction layer that makes it simple to hold complex data types that may or may not be related in some way.\n\n## Installation\n\nTo install the package for use in your own project just use npm\n```\nnpm install b-cache\n```\n\n## Usage\n\nThree copies are provided for convenience. A minified browser version, an es6 version, and an es5 version.\n\nTo use the browser version simply include `b-cache/dist/bcache.min.js` in a script tag and use it by referring to the class you need\n```javascript\nvar Vertex = bcache.Vertex;\nvar Edge = bcache.Edge;\nvar Graph = bcache.Graph;\n```\n\nfor the es5 version (default) you can use\n```javascript\nvar Vertex = require(\"b-cache\").Vertex;\nvar Edge = require(\"b-cache\").Edge;\nvar Graph = require(\"b-cache\").Graph;\n```\n\nAnd for es6\n```javascript\nimport { Vertex } from \"b-cache/lib-esm/index\";\nimport { Edge } from \"b-cache/lib-esm/index\";\nimport { Graph } from \"b-cache/lib-esm/index\";\n```\n\nBelow is a simple use case writen in typescript. You can find other examples writen in both javascript and typescript in the [examples folder](https://github.com/The-Pied-Piper/B-Cache/tree/master/examples) of this repository.\n```typescript\n\n// First lets extend vertex with our own class.\n\nclass Employee extends Vertex {\n\n    /**\n     * This edge defines a coworker as someone who works in the same team\n     */\n    public static coworkers = new Edge(\n        (from, to) =\u003e from.team === to.team \u0026\u0026 from !== to,\n    );\n\n    /** An employee's manager is a member of the team the employee works in who\n     * has the isManager designation. The false passed in the second argument\n     * tells the graph that this will not return an Array of vertices but rather\n     * a single vertex.\n     */\n    public static manager = new Edge(\n        (from, to) =\u003e from.team === to.team \u0026\u0026 to.isManager,\n        false,\n    );\n\n    // Define our instance attributes\n    public team: string;\n    public name: string;\n    public isManager: boolean;\n\n    constructor(id: number | string, team: string, name: string, isManager: boolean) {\n        super(id);\n        this.team = team;\n        this.name = name;\n        this.isManager = isManager;\n    }\n}\n\n// Create a new graph\nconst graph = new Graph();\n\n// Create some instances of our Employee Vertex\nconst employee1 = new Employee(1, \"marketing\", \"Akbar Koya\", false);\nconst employee2 = new Employee(2, \"marketing\", \"Ann Mathews\", false);\nconst employee3 = new Employee(3, \"marketing\", \"David Boyle\", true);\n\n// Add the Employees to the graph\ngraph.add_vertex(employee1, employee2, employee3);\n\n// The graph automatically populates the edges for us.\nconsole.log(employee1.coworkers);    // [employee2, employee3]    Notice that this is an Array\nconsole.log(employee1.manager.name);    // David Boyle    Notice that manager is a single edge\n\n// We can also retrieve individual edges from the graph\nconsole.log(graph.get_vertex({id: 2}).name)    // Ann Mathews\n\n```\nIt is possible and often useful to have multiple sub-classes of Vertex and store them in the same graph. Since it is conceivable that in this case vertices might have the same id we can also specify a vertex type by passing a second string argument to the Vertex super class.\n```typescript\nsuper(id, \"employee\");\n```\nIn this way we can prevent collisions between our Employee vertices and, lets say, Department vertices which we want to store in the same graph so that we can define edges between them. By specifying the type of the vertices we can now store a Department with id 1 in the same graph as an employee also with id 1 as long as their vertex type is different.\n\nTo retrieve a vertex with from the graph which has a defined type we must also pass the type to the get_vertex function\n```typescript\nconsole.log(graph.get_vertex({id: 2, type: \"employee\"}).name)    // Ann Mathews.\n```\n\n## Getting Started\n\nTo get started you can download or clone the repository from [github](https://github.com/The-Pied-Piper/B-Cache). You will also need typescript in order to compile the project.\n\n### Prerequisites\n\nYou only need typescript to get the project up and running\n\n### Installing\n\nThe easiest and simplest way to install the app is via npm and the CL interface. Navigte over to the project directory then call\n```\nnpm install\n```\nThis will install typescript for compiling the app as well as a few other dependencies for testing (mocha, chia, ts-node), building (webpack and ts-loader), documentation (typedoc) and linting (tslint)\n\n## Running the tests\n\nTo run the tests will additionally require [mocha](https://mochajs.org/) and\n[chai](http://chaijs.com/) and their typing information as well as ts-node. If you\ninstalled the app as noted above then you are already all set otherwise these\ncan be installed via the CL\n\n```\nnpm install --save-dev mocha chai ts-node @types/chai @types/mocha\n```\n\nYou can now run the tests!\n```\nnpm run test\n```\nOnce the tests run you will get an annoying error about missing tslint. We use this to test compliance with the style guide. To fix the message read on.\n\n### Coding style tests\n\nWe use the  tslint recomended style guide for coding. For more information you can visit the [tslint](https://palantir.github.io/tslint/) website. The package can be installed using npm\n```\nnpm install --save-dev tslint\n```\nyou can then test that you are following the style by running\n```\nnpm run lint\n```\n\n## Deployment\n\nThis package can be used both in a browser and on Node.js. To build the package you will need a few more packages. If you installed the application as noted above then you are already all set otherwise you will additionally need to install webpack as well as the ts-loaded webpack plugin. This is easily done via npm and the CL interface.\n```\nnpm install --save-dev webpack ts-loader\n```\nYou can now build the package using\n```\nnpm run build\n```\nThis will build the package for you, though, you will get an annoying error at the end mentioning that the documentation could not be generated. To fix this install typedoc\n```\nnpm install --save-dev typedoc\n```\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/The-Pied-Piper/B-Cache/tags).\n\n## Author\n\n* **Umar Khan** a.k.a [The-Pied-Piper](https://github.com/The-Pied-Piper)\n\nSee also the list of [contributors](https://github.com/The-Pied-Piper/B-Cache/graphs/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/The-Pied-Piper/B-Cache/blob/master/LICENSE) file for details\n\n## Acknowledgments\n\n* This README.md file was generated using the template at https://gist.github.com/PurpleBooth/109311bb0361f32d87a2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-pied-piper%2Fb-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-pied-piper%2Fb-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-pied-piper%2Fb-cache/lists"}