{"id":20924518,"url":"https://github.com/ericdouglas/path-to","last_synced_at":"2026-03-12T08:01:57.848Z","repository":{"id":25036475,"uuid":"28456154","full_name":"ericdouglas/path-to","owner":"ericdouglas","description":"A simple abstraction to identify the path and request your files and folders in a Node.js project","archived":false,"fork":false,"pushed_at":"2014-12-26T10:51:08.000Z","size":336,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-31T10:18:33.574Z","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/ericdouglas.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":"2014-12-24T16:48:43.000Z","updated_at":"2020-08-08T02:18:20.000Z","dependencies_parsed_at":"2022-08-23T11:31:34.623Z","dependency_job_id":null,"html_url":"https://github.com/ericdouglas/path-to","commit_stats":null,"previous_names":["thothjs/pathto"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ericdouglas/path-to","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Fpath-to","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Fpath-to/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Fpath-to/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Fpath-to/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericdouglas","download_url":"https://codeload.github.com/ericdouglas/path-to/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Fpath-to/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30419265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T07:30:13.030Z","status":"ssl_error","status_checked_at":"2026-03-12T07:29:54.885Z","response_time":114,"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-18T20:22:57.537Z","updated_at":"2026-03-12T08:01:57.610Z","avatar_url":"https://github.com/ericdouglas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# path-to\n\n[![Build Status](https://travis-ci.org/thothJS/path-to.svg?branch=master)](https://travis-ci.org/thothJS/path-to)\n[![Coverage Status](https://coveralls.io/repos/thothJS/path-to/badge.png)](https://coveralls.io/r/thothJS/path-to)\n\n[![NPM](https://nodei.co/npm/path-to.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/path-to/)\n\n## Description\n\nA simple abstraction to identify the path and request your files and folders in a Node.js project.\n\n## Installation\n\n```sh\nnpm install path-to --save\n```\n\n## Usage\n\n**Without** `path-to` module:\n\n```js\n\nvar dep1 = require( '../../../../file' );\nvar dep2 = require( '../../../../../../folder' );\nvar dep3 = require( '../../../folder' );\nvar dep4 = require( '../../../another-folder' );\n\n```\n\n**With** `path-to` module:\n\n```js\n\nvar path = require( 'path-to' );\n\nvar dep1 = require( path( 4, 'file' ));\nvar dep2 = require( path( 6, 'folder' ));\nvar dep3 = require( path( 3, 'folder' ));\nvar dep4 = require( path( 3, 'another-folder' ));\n\n```\n\nIf you want to use just the `../../../` abstraction, you could use the `path-to` in that manner:\n\n```js\n\nvar path = require( 'path-to' )( 4 );\n\nvar dep1 = require( path + 'file' );\nvar dep2 = require( path + 'folder' );\nvar dep4 = require( path + 'another-folder' );\n\n```\n\n## Real Example\n\nYou could look at [this](https://github.com/ericdouglas/labs/tree/master/nodejs/practice/006) folder to see a *working* example.\n\nIn [app.js](https://github.com/ericdouglas/labs/blob/master/nodejs/practice/006/some/folder/here/app.js) file, we loaded the `path-to` module and used it in two different forms.\n\n## Tests\n\n```sh\nnpm test\n```\n\n## Contributing\n\n* Take care to maintain the existing coding style.\n* Add unit tests for any new or changed functionality. \n* Lint and test your code.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014-2015 **Eric Douglas**\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericdouglas%2Fpath-to","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericdouglas%2Fpath-to","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericdouglas%2Fpath-to/lists"}