{"id":15434017,"url":"https://github.com/sebinsua/get-object-paths","last_synced_at":"2025-06-15T12:39:06.653Z","repository":{"id":28957824,"uuid":"32483948","full_name":"sebinsua/get-object-paths","owner":"sebinsua","description":"Transforms collections describing paths into arrays of paths.","archived":false,"fork":false,"pushed_at":"2015-03-19T11:00:09.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-30T03:48:26.841Z","etag":null,"topics":["adjacency-lists","graph","paths"],"latest_commit_sha":null,"homepage":"","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/sebinsua.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-03-18T20:57:08.000Z","updated_at":"2015-03-19T11:00:10.000Z","dependencies_parsed_at":"2022-08-17T18:45:31.680Z","dependency_job_id":null,"html_url":"https://github.com/sebinsua/get-object-paths","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sebinsua/get-object-paths","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fget-object-paths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fget-object-paths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fget-object-paths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fget-object-paths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebinsua","download_url":"https://codeload.github.com/sebinsua/get-object-paths/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fget-object-paths/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259977641,"owners_count":22941115,"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":["adjacency-lists","graph","paths"],"created_at":"2024-10-01T18:36:44.373Z","updated_at":"2025-06-15T12:39:06.629Z","avatar_url":"https://github.com/sebinsua.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-object-paths\n\n[![Build Status](https://travis-ci.org/sebinsua/get-object-paths.png)](https://travis-ci.org/sebinsua/get-object-paths) [![npm version](https://badge.fury.io/js/get-object-paths.svg)](https://npmjs.org/package/get-object-paths)\n\nTransforms collections describing paths into arrays of paths.\n\n**NOTE:** Currently this module does not have any checks or protections against (1) cycles in a graph, and (2) stack overflows. Please use it only if you have control of the data enough to know that none of these issues will be a problem.\n\n## Installation\n\n```javascript\nnpm install [--save] get-object-paths;\n```\n\n## Usage\n\n```javascript\nvar getObjectPaths = require('get-object-paths')();\n\nvar obj = {\n  'a': 'b',\n  'b': 'c',\n  'c': 'd',\n  'd': 'e',\n  'e': ['f', 'g', 'h'],\n  'f': 'g',\n  'g': 'i',\n  'h': 'j',\n  'i': 'end',\n  'j': 'k',\n  'k': 'l',\n  'l': 'end',\n  'end': null\n};\nvar startPath = 'a';\n\nvar simplePaths = getObjectPaths(obj, startPath);\n// Gives:\n// [\n//   ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'i', 'end'],\n//   ['a', 'b', 'c', 'd', 'e', 'g', 'i', 'end'],\n//   ['a', 'b', 'c', 'd', 'e', 'h', 'j', 'k', 'l', 'end']\n// ]\n```\n\nThe module has a single options argument which you can use to pass in `options.get`, `options.to` and `options.represent`.\n\n`options.get` is meant to return the nodes a key points to. It accepts a function with this signature `(col, key)`.\n\n`options.to` is mean to return the nodes a key points to. It accepts the node and can return any of its properties.\n\n`options.id` is meant to convert between the key of a node and a representation of the node (e.g. an identifier). It accepts a function with this signature `(el)`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebinsua%2Fget-object-paths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebinsua%2Fget-object-paths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebinsua%2Fget-object-paths/lists"}