{"id":16252982,"url":"https://github.com/neki-dev/alias-reuse","last_synced_at":"2026-03-02T22:03:12.943Z","repository":{"id":57684853,"uuid":"477108004","full_name":"neki-dev/alias-reuse","owner":"neki-dev","description":"⚙️ Reuse custom or existing aliases from one configuration in others","archived":false,"fork":false,"pushed_at":"2024-07-19T13:11:35.000Z","size":342,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T10:52:13.277Z","etag":null,"topics":["alias","config","jest","path","reuse","tsconfig","vite","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/neki-dev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-02T16:20:32.000Z","updated_at":"2024-08-25T22:34:35.000Z","dependencies_parsed_at":"2023-11-22T15:58:20.705Z","dependency_job_id":"be05db9b-4e31-469a-b92f-d27c145b5af8","html_url":"https://github.com/neki-dev/alias-reuse","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":"0.17647058823529416","last_synced_commit":"3d957ae81716aeda02b95cf19626bf0386bb5a9d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Falias-reuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Falias-reuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Falias-reuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Falias-reuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neki-dev","download_url":"https://codeload.github.com/neki-dev/alias-reuse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244501455,"owners_count":20462863,"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":["alias","config","jest","path","reuse","tsconfig","vite","webpack"],"created_at":"2024-10-10T15:15:35.932Z","updated_at":"2026-03-02T22:03:12.861Z","avatar_url":"https://github.com/neki-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ⚙️ Alias reuse\n[![Version](https://badgen.net/npm/v/alias-reuse)](https://npmjs.com/package/alias-reuse)\n[![Small size](https://img.badgesize.io/neki-dev/alias-reuse/master/dist/index.js)](https://github.com/neki-dev/alias-reuse/blob/master/dist/index.js)\n[![Build](https://github.com/neki-dev/alias-reuse/actions/workflows/build.yml/badge.svg)](https://github.com/neki-dev/alias-reuse/actions/workflows/build.yml)\n[![Test](https://github.com/neki-dev/alias-reuse/actions/workflows/test.yml/badge.svg)](https://github.com/neki-dev/alias-reuse/actions/workflows/test.yml)\n\nReuse custom or existing aliases from one configuration in others.\n\n.\n\n## Install\n\n```sh\nnpm i alias-reuse --save-dev\n```\n\n.\n\n## Usage\n\n### Import \nImport aliases from existing configuration.\nThe library will automatically detect the configuration source type.\n\nSupported configuration sources:\n* `tsconfig`\n* `webpack` / `vite`\n* `object`\n```ts\nreuse().from(pathToConfig: string);\n```\n... and also from custom object.\n```ts\nreuse().from(config: Record\u003cstring, string\u003e);\n```\n\n### Configure\nSet custom root directory.\n```ts\nreuse().from(...).at(pathToRoot: string);\n```\n\n### Export \nExport of aliases in a required configuration target.\n\nSupported configuration targets:\n* `tsconfig`\n* `webpack` / `vite`\n* `jest`\n* `object`\n```ts\nreuse().from(...).for(target: string);\n```\n\n.\n\n## Examples\n\n* #### Example for Webpack\n\n```js\nconst { reuse } = require('alias-reuse');\nconst tsconfigPath = path.join(__dirname, 'tsconfig.json');\n\nmodule.exports = {\n  resolve: {\n    alias: reuse()\n      .from(tsconfigPath) // Import aliases from tsconfig.json\n      .for(\"webpack\"), // And convert to webpack format\n  },\n  // ...\n};\n```\n\n* #### Example for TSConfig\n\n```js\nconst { reuse } = require('alias-reuse');\nconst configPath = path.join(__dirname, 'configs/aliases.json');\n\nmodule.exports = {\n  compilerOptions: {\n    paths: reuse()\n      .from(configPath) // Import aliases from custom config\n      .for(\"tsconfig\"), // And convert to tsconfig format\n  },\n  // ...\n};\n```\n\n* #### Example with custom root directory\n\n```js\nconst { reuse } = require('alias-reuse');\nconst rootPath = path.join(__dirname, 'root');\nconst configPath = path.join(__dirname, 'configs/aliases.json');\n\nmodule.exports = {\n  resolve: {\n    alias: reuse()\n      .from(configPath) // Import aliases from custom config\n      .at(rootPath) // Set root directory\n      .for(\"vite\"), // And convert to vite format\n  },\n  // ...\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneki-dev%2Falias-reuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneki-dev%2Falias-reuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneki-dev%2Falias-reuse/lists"}