{"id":20654944,"url":"https://github.com/sposhe/component-indexer","last_synced_at":"2025-06-23T15:33:44.859Z","repository":{"id":57204765,"uuid":"276965203","full_name":"sposhe/component-indexer","owner":"sposhe","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-29T01:55:15.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-17T22:08:15.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sposhe.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":"2020-07-03T18:36:42.000Z","updated_at":"2020-07-29T01:55:01.000Z","dependencies_parsed_at":"2022-09-18T00:41:56.855Z","dependency_job_id":null,"html_url":"https://github.com/sposhe/component-indexer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sposhe/component-indexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sposhe%2Fcomponent-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sposhe%2Fcomponent-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sposhe%2Fcomponent-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sposhe%2Fcomponent-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sposhe","download_url":"https://codeload.github.com/sposhe/component-indexer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sposhe%2Fcomponent-indexer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259977364,"owners_count":22941111,"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-16T18:07:24.035Z","updated_at":"2025-06-23T15:33:44.831Z","avatar_url":"https://github.com/sposhe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# component-indexer\n\nNode module. Creates an `_index` file in a specified directory that references all of the files in that directory. This is useful for bulk importing SCSS modules or Pug mixins. Contains presets for SCSS and Pug, or options can be specified manually.\n\n## Usage\n\nGiven this file structure—\n\n```\n  .\n  └── src\n      └── pug\n          └── mixins\n              ├── _blockquote.pug\n              ├── _section.pug\n              └── _card.pug\n```\n\n```js\nconst componentIndexer = require('component-indexer')\ncomponentIndexer('src/pug/mixins', 'pug')\n```\n—the above will create `./src/pug/mixins/_index.pug` with this content:\n\n```pug\ninclude _blockquote\ninclude _card\ninclude _section\n```\n\n## Syntax\n\n```js\ncomponentIndexer(path, filetype [,{prefix, suffix, extension}])\n```\n\n### Options\n\n* `path` (String) Relative path to the directory to be indexed\n* `filetype`: (String) Extension of the files to be indexed\n* `prefix`: (String, optional) Prepended before each file name in the index file\n* `suffix`: (String, optional) Appended after each file name in the index file\n* `extension`: (Boolean, optional) Include extension of each file in the index file\n\n## Presets\n\nIf the `filetype` matches one of the presets, the values of `prefix`, `suffix`, and `extension` will use the preset values by default.\n\n```js\npresets: {\n  pug:  { prefix: `include `,  suffix: ``,   extension: false },\n  scss: { prefix: `@import '`, suffix: `';`, extension: false },\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsposhe%2Fcomponent-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsposhe%2Fcomponent-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsposhe%2Fcomponent-indexer/lists"}