{"id":13524534,"url":"https://github.com/lukechilds/this","last_synced_at":"2025-04-28T10:46:36.915Z","repository":{"id":57250409,"uuid":"97693147","full_name":"lukechilds/this","owner":"lukechilds","description":"Traverses up the directory tree and returns the first module found","archived":false,"fork":false,"pushed_at":"2019-10-10T23:38:57.000Z","size":28,"stargazers_count":6,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T15:16:35.233Z","etag":null,"topics":["module","package","require","test","test-utilities","test-utils","testing","testing-tools"],"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/lukechilds.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":"2017-07-19T08:36:10.000Z","updated_at":"2024-12-06T22:24:55.000Z","dependencies_parsed_at":"2022-08-24T16:51:40.950Z","dependency_job_id":null,"html_url":"https://github.com/lukechilds/this","commit_stats":null,"previous_names":["lukechilds/get-root-module"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fthis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fthis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fthis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fthis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukechilds","download_url":"https://codeload.github.com/lukechilds/this/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250994183,"owners_count":21519780,"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":["module","package","require","test","test-utilities","test-utils","testing","testing-tools"],"created_at":"2024-08-01T06:01:11.004Z","updated_at":"2025-04-28T10:46:36.891Z","avatar_url":"https://github.com/lukechilds.png","language":"JavaScript","readme":"# this\n\n\u003e Traverses up the directory tree and returns the first module found\n\n[![Build Status](https://travis-ci.org/lukechilds/this.svg?branch=master)](https://travis-ci.org/lukechilds/this)\n[![Coverage Status](https://coveralls.io/repos/github/lukechilds/this/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/this?branch=master)\n[![npm](https://img.shields.io/npm/v/this.svg)](https://www.npmjs.com/package/this)\n\nUseful in tests so you don't have to require the package you're testing via relative paths.\n\nStarts directory traversal from `process.cwd()` so this should really only be used in tests or CLI apps.\n\n## Install\n\n```shell\nnpm install --save this\n```\n\nOr if using for tests you'll probably want:\n\n```shell\nnpm install --save-dev this\n```\n\n## Usage\n\nJust require `this` the same way you would require the root module with a relative path.\n\ne.g instead of:\n\n```js\nimport test from 'ava';\nimport myPackage from '../';\n\n// and then in sub folders\nimport myPackage from '../../';\n```\n\nYou can now do:\n\n```js\nimport test from 'ava';\nimport myPackage from 'this';\n\n// and then in sub folders it's still just:\nimport myPackage from 'this';\n```\n\ne.g without import transpilation:\n\n```js\nconst test = require('tape');\nconst myPackage = require('this');\n```\n\n## License\n\nMIT © Luke Childs\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fthis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukechilds%2Fthis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fthis/lists"}