{"id":20924511,"url":"https://github.com/ericdouglas/rooted","last_synced_at":"2025-05-13T16:31:15.582Z","repository":{"id":73960214,"uuid":"39267005","full_name":"ericdouglas/rooted","owner":"ericdouglas","description":":open_file_folder: Require modules/folders/files in the right way","archived":false,"fork":false,"pushed_at":"2015-10-02T11:37:32.000Z","size":196,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T01:16:48.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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":"2015-07-17T17:40:09.000Z","updated_at":"2023-05-29T14:37:09.000Z","dependencies_parsed_at":"2023-03-06T12:30:13.660Z","dependency_job_id":null,"html_url":"https://github.com/ericdouglas/rooted","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Frooted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Frooted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Frooted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdouglas%2Frooted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericdouglas","download_url":"https://codeload.github.com/ericdouglas/rooted/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253981753,"owners_count":21994328,"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-11-18T20:22:51.996Z","updated_at":"2025-05-13T16:31:10.582Z","avatar_url":"https://github.com/ericdouglas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rooted\n\n[![Build Status](https://travis-ci.org/ericdouglas/rooted.svg)](https://travis-ci.org/ericdouglas/rooted)\n[![Coverage Status](https://coveralls.io/repos/ericdouglas/rooted/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/ericdouglas/rooted?branch=master)\n[![npm version](https://badge.fury.io/js/rooted.svg)](http://badge.fury.io/js/rooted)\n\n[![NPM](https://nodei.co/npm/rooted.png)](https://nodei.co/npm/rooted/)\n\nRequiring modules/folders/files in the right way\n\n## Installation\n\n```\nnpm i rooted --save\n```\n\n## Usage\n\n```js\n////// bad\nvar data    = require('../../../../data.json');\nvar helpers = require('../../../helpers');\n\n///// good\n// will build the path starting from the root directory of your application\n// and require the respective file/folder/module\nvar rooted  = require('rooted');\nvar data    = rooted('data.json');\nvar helpers = rooted('helpers');\n```\n\nYou can also get string representing the absolute path of the file/folder, passing `true` as the second argument.\n\n```js\nvar rooted  = require('rooted');\nvar data    = rooted('data.json', true);\n\nconsole.log(typeof data); // \"string\"\n```\n\n## Tests\n\n```\nmake test\n```\n\n## License\n\n[MIT License](http://ericdouglas.mit-license.org/) © Eric Douglas\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericdouglas%2Frooted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericdouglas%2Frooted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericdouglas%2Frooted/lists"}