{"id":15391372,"url":"https://github.com/sultan99/sexy-require","last_synced_at":"2025-07-30T23:36:03.912Z","repository":{"id":57357156,"uuid":"87395633","full_name":"sultan99/sexy-require","owner":"sultan99","description":"💃🏻 No more ugly path.","archived":false,"fork":false,"pushed_at":"2018-12-01T17:13:44.000Z","size":16,"stargazers_count":40,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-26T22:27:55.415Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sultan99.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-04-06T06:45:08.000Z","updated_at":"2024-10-08T10:33:03.000Z","dependencies_parsed_at":"2022-09-26T16:32:25.766Z","dependency_job_id":null,"html_url":"https://github.com/sultan99/sexy-require","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sultan99/sexy-require","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan99%2Fsexy-require","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan99%2Fsexy-require/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan99%2Fsexy-require/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan99%2Fsexy-require/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sultan99","download_url":"https://codeload.github.com/sultan99/sexy-require/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan99%2Fsexy-require/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267960889,"owners_count":24172511,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-10-01T15:10:52.756Z","updated_at":"2025-07-30T23:36:03.851Z","avatar_url":"https://github.com/sultan99.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💃🏻 Sexy require v 1.1\nNo more ugly path inside the `require`. \u003cbr/\u003e\n```js\nconst user = require('../../../database/user') // 👎 what you have\n// OR\nconst user = require('$db/user') // 👍 no matter how deep you are\nconst product = require('/database/product') // 👍 alias or pathing from application directory\n```\n\n## Getting started\nThree simple steps to use it.\n1. Install the package: `npm install sexy-require --save`\n\n2. Include `require('sexy-require')` once on the top of your main application file.\n```js\nrequire('sexy-require')\nconst routers = require('/routers')\nconst api = require('$api')\n...\n```\n\n3. Optional step. Path configuration can be defined in `.paths` file on root directory of your project.\n```\n$db = /server/database\n$api-v1 = /server/api/legacy\n$api-v2 = /server/api/v2\n```\n\n## List of paths\nAnywhere in your project you can get the defined shortcut paths:\n```js\nconst path = require(`sexy-require`)\nconsole.log(path.$db) // -\u003e '/full/path/to/app/server/database'\n```\n\n## Changelog\n### v 1.1\n - Seamless module require. If a given path doesn't exist in the app directory it will be ignored by sexy-require.\n### v 1.0\n - definition of path shortcuts moved from `package.json` to `.paths` config file\n - depending modules can use `sexy-require` too, previously it was not possible\n - supporting pathing from root directory, now it is not required to define shortcuts\n - caching and optimized code for higher performance\n\n### v 0.1\n - returns defined shortcut list with absolute path\n - minor bug fixes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultan99%2Fsexy-require","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsultan99%2Fsexy-require","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultan99%2Fsexy-require/lists"}