{"id":22377223,"url":"https://github.com/luisreinoso/ng-filename-parser","last_synced_at":"2026-04-29T18:34:54.855Z","repository":{"id":65394457,"uuid":"326177054","full_name":"LuisReinoso/ng-filename-parser","owner":"LuisReinoso","description":"Angular file name convention parser","archived":false,"fork":false,"pushed_at":"2023-01-21T09:05:37.000Z","size":299,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T21:30:41.431Z","etag":null,"topics":["angular","parser","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ng-filename-parser","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/LuisReinoso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-02T12:22:21.000Z","updated_at":"2022-07-16T16:10:14.000Z","dependencies_parsed_at":"2023-02-12T08:30:30.177Z","dependency_job_id":null,"html_url":"https://github.com/LuisReinoso/ng-filename-parser","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisReinoso%2Fng-filename-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisReinoso%2Fng-filename-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisReinoso%2Fng-filename-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisReinoso%2Fng-filename-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuisReinoso","download_url":"https://codeload.github.com/LuisReinoso/ng-filename-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245708992,"owners_count":20659626,"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":["angular","parser","typescript"],"created_at":"2024-12-04T22:13:17.773Z","updated_at":"2026-04-29T18:34:54.826Z","avatar_url":"https://github.com/LuisReinoso.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng filename parser\n\nAngular file name convention parser\n\n```\nsrc/                                    project source code\n|- app/\n|  |- user/                             user module\n|  |- components/                       dummy components\n|  |  |- menu/\n|  |  |  |- menu.component.html\n|  |  |  |- menu.component.scss\n|  |  |  |- menu.component.spec.ts\n|  |  |  |- menu.component.ts\n|  |  |  |- menu.stories.ts\n|  |- pages/                            smart components\n|  |  |- dashboard/\n|  |  |  |- dashboard.page.html\n|  |  |  |- dashboard.page.scss\n|  |  |  |- dashboard.page.spec.ts\n|  |  |  |- dashboard.page.stories.ts   also support dashboard.stories.ts\n|  |  |  |- dashboard.page.ts\n|  +- ...\n```\n\n### Installation\n\n```bash\nnpm install --save ng-filename-parser\n```\n\n### Usage\n\nImport required helper function.\n\n```typescript\nimport {\n  getNgFilenameTokens,\n  getStyleFile,\n  getHtmlFile,\n  getSpecFile,\n  getTypescriptFile,\n  getStorybookFile,\n} from 'ng-filename-parser'\n```\n\n#### getNgFilenameTokens\n\nPass as argument the angular project filename to tokenizer to `getNgFilenameTokens`\n\n```typescript\nconst filename = '/home/angular/project/src/app/app.component.ts'\nconst tokens = getNgFilenameTokens(filename)\n```\n\nThis will return:\n\n```\n{\n  component: 'app',\n  type: ['component']\n}\n```\n\n#### getFiles functions\n\nBased on filename tokens user could request filename of styles/ts/stories/spec files.\n\n- `getStyleFile`\n- `getHtmlFile`\n- `getSpecFile`\n- `getTypescriptFile`\n- `getStorybookFile`\n\nCheckout testing files for more information.\n\n### Release\n\n- run `npm run release`\n\n### License\n\nLuis Reinoso 2021 [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisreinoso%2Fng-filename-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisreinoso%2Fng-filename-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisreinoso%2Fng-filename-parser/lists"}