{"id":13467467,"url":"https://github.com/avoidwork/tiny-graph","last_synced_at":"2025-04-14T15:55:20.755Z","repository":{"id":24748768,"uuid":"28161487","full_name":"avoidwork/tiny-graph","owner":"avoidwork","description":"Tiny graph data structure for Client or Server","archived":false,"fork":false,"pushed_at":"2018-05-05T14:26:42.000Z","size":316,"stargazers_count":74,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-18T07:30:49.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://avoidwork.github.io/tiny-graph","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avoidwork.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":"2014-12-18T00:22:17.000Z","updated_at":"2022-11-12T21:49:59.000Z","dependencies_parsed_at":"2022-08-17T17:30:32.206Z","dependency_job_id":null,"html_url":"https://github.com/avoidwork/tiny-graph","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avoidwork","download_url":"https://codeload.github.com/avoidwork/tiny-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248912401,"owners_count":21182270,"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":[],"created_at":"2024-07-31T15:00:56.906Z","updated_at":"2025-04-14T15:55:20.725Z","avatar_url":"https://github.com/avoidwork.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# tiny-graph\n\n[![build status](https://secure.travis-ci.org/avoidwork/tiny-graph.svg)](http://travis-ci.org/avoidwork/tiny-graph)\n\nTiny graph data structure for Client or Server\n\n## Example\n```javascript\nconst graph = require('tiny-graph'),\n    g = graph();\n\ng.setNodeValue('f', 3);\ng.setNodeValue('h', 21);\ng.add('f', 'h');\ng.setEdgeValue('f', 'h', 100);\n\nconsole.log(g.adjacent('f', 'h')); // true\nconsole.log(g.neighbors('f')); // ['h']\nconsole.log(g.getEdgeValue('f', 'h')); // 100\n```\n\n## How can I use tiny-graph?\ntiny-graph can be installed from npm \u0026 bower, and supports AMD loaders or script tags (`window.graph`).\n\n## API\n#### add(x, y)\nAdds the edge from `x` to `y`, if it is not there\n\n#### adjacent(x, y)\nTests whether there is an edge from node `x` to node `y`\n\n#### del(x, y)\nRemoves the edge from `x` to `y`, if it is there\n\n#### delNode(x)\nRemoves node `x` from the graph, if it is there\n\n#### fromJSON(arg)\nDeserializes arg as the graph\n\n#### getEdgeValue(x, y)\nReturns the value associated to the edge (`x`, `y`)\n\n#### getNodeValue(x)\nReturns the value associated with the node `x`\n\n#### neighbors(x)\nLists all nodes `y` such that there is an edge from `x` to `y`\n\n#### setEdgeValue(x, y, v)\nSets the value associated to the edge (`x`, `y`) to `v`\n\n#### setNodeValue(x, v)\nSets the value associated with the node `x` to `v`\n\n#### toJSON()\nSerializes the graph as JSON\n\n## License\nCopyright (c) 2018 Jason Mulligan\nLicensed under the BSD-3 license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favoidwork%2Ftiny-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favoidwork%2Ftiny-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favoidwork%2Ftiny-graph/lists"}