{"id":20852379,"url":"https://github.com/fuzzicallogic/pathfinder","last_synced_at":"2026-04-26T01:31:43.479Z","repository":{"id":8314629,"uuid":"9862406","full_name":"FuzzicalLogic/PathFinder","owner":"FuzzicalLogic","description":"A lightweight JS Namespacing module that has allows for full path navigation.","archived":false,"fork":false,"pushed_at":"2013-05-05T02:19:57.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T13:11:21.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/FuzzicalLogic.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":"2013-05-05T00:57:40.000Z","updated_at":"2013-10-27T00:56:33.000Z","dependencies_parsed_at":"2022-07-19T15:04:35.738Z","dependency_job_id":null,"html_url":"https://github.com/FuzzicalLogic/PathFinder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FuzzicalLogic/PathFinder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuzzicalLogic%2FPathFinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuzzicalLogic%2FPathFinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuzzicalLogic%2FPathFinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuzzicalLogic%2FPathFinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FuzzicalLogic","download_url":"https://codeload.github.com/FuzzicalLogic/PathFinder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuzzicalLogic%2FPathFinder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32283294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2024-11-18T03:17:27.729Z","updated_at":"2026-04-26T01:31:43.464Z","avatar_url":"https://github.com/FuzzicalLogic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PathFinder\n\nPathFinder is a lightweight JS object that allows creation and addition of path-like namespacing.\n\n### Usage\n\n#### Add a Namespace\n    PathFinder.add('namespace'[,'namespace']...[,object/function])\ncreates the given namespace(s) in the given object/function. If the last argument is not a valid object/function, it will create them from the window namespace.\n\n    namespace.add('namespace'[,'namespace']...[,object/function])\ncreates the given namespace(s) in the given object/function. If the last argument is not a valid object/function, it will create them within the calling namespace.\n\n##### Examples\n    PathFinder.add('a.b.c.d')\nWill create window.a, window.a.b, window.a.b.c, and window.a.b.c.d in one step. Returns PathFinder for further chaining.\n\n    PathFinder.add('c.d', a.b)\nWill create window.a.b.c, and window.a.b.c.d in one step, if a.b exists. Otherwise, it will create them in the window namespace. Returns PathFinder for further chaining.\n\n    PathFinder.add('a1','a2.b','a3.c')\nWill create `a1`, `a2`, `a2.b`, `a3`, `a3.c` in the window namespace.\n    \n    a.add('b.c.d')\nWill create a.b, a.b.c, and a.b.c.d in one step, provided that a is a Namespace created by Pathfinder. Returns a for further chaining.\n\n    a.add('c.d', b)\nWill create b.c and b.c.d, provided that b is a valid object/function. If b is not a valid object/function, will create a.c and a.d. Returns a for further chaining.\n\n\n#### Get a Namespace\n    `PathFinder('namespace')` \nReturns the defined namespace, if it exists. Otherwise, it returns `null`.\n\n##### Examples\n    PathFinder('a.b.c') \nReturns `c`, if `a`,`b` and `c` exist **and** are located in each other. \n\n#### Getting to Root Namespace\n    namespace.top()\n    namespace.root()\nReturns the recorded root namespace of the namespace.\n\n##### Example\n    a.b.c.d.root()\nWill return `a`, if `a`,`b`,`c` and `d` were accessed at any point using `PathFinder.add()`.\n\n#### Moving Up\n    namespace.up()\nWill return the recorded parent namespace of the namespace.\n\n##### Example\n    a.b.c.d.up()\nWill return `c`, if `a`,`b`,`c` and `d` were accessed at any point using `PathFinder.add()`.\n\n#### Getting the Full Namespace Path\n    namespace.fullPath()\nWill return the recorded `fullPath` of the namespace.\n\n##### Example (using a.b.c.d)\n    d.fullPath()\nWill return `a.b.c.d`\n\n### Special Usage\n    PathFinder()\nOne nice thing is that PathFinder will get any object along the chain, as long as the chain is valid. This means that you can do a simple multi-namespace check for validity. Or, if you have the `fullPath` of the object/function, you can get it easily.\n\n    PathFinder.add()\nPathFinder uses non-destructive, non-referential objects to minimize on leakage and provide maximum benefit. What does this mean? Let's assume that `a`, `a.b`, and `a.b.c` exist. When we `PathFinder('a.b.c.d')`, PathFinder will determine that `a`, `a.b`, and `a.b.c` are valid and will add only a pfcfg object to them. Then it will create `a.b.c.d` giving it the appropriate methods. To avoid incompatibilities, it will not add the `up()` and `root()` methods. Additionally, all pfcfg properties are text, not references.\n\n#### Example of Non-referential Navigation\nAssuming that we have a namespace `a.b.c.d` and all parents were 'touched' by `PathFinder.add()`, the following command will work easily (provided `d` is a valid reference).\n\n   PathFinder(d.up().fullPath())\n    \n### PathFinder Alias\n\nFor convenience, if `pf()` is not defined, PathFinder will define it. Use `pf()` exactly as you use `PathFinder()`.\n\n### The PFCFG Object\n`pfcfg` stores only strings that can be used by `PathFinder()`. These strings are calculated whenever you `PathFinder.add()` a namespace (even if a namespace is not created). Current properties in the `pfcfg` include `name`,`root`,`fullPath`, and `parent`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuzzicallogic%2Fpathfinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuzzicallogic%2Fpathfinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuzzicallogic%2Fpathfinder/lists"}