{"id":20054363,"url":"https://github.com/divriots/csf-helpers","last_synced_at":"2026-06-08T12:32:01.899Z","repository":{"id":46746907,"uuid":"515628754","full_name":"divriots/csf-helpers","owner":"divriots","description":"Created with Components.studio","archived":false,"fork":false,"pushed_at":"2022-08-01T09:35:33.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-19T11:38:27.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://app.components.studio/view/ZDRAF9DebzEFyYzY4TAS","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/divriots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-19T14:54:31.000Z","updated_at":"2022-07-26T12:08:31.000Z","dependencies_parsed_at":"2022-09-26T18:10:34.496Z","dependency_job_id":null,"html_url":"https://github.com/divriots/csf-helpers","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/divriots/csf-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fcsf-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fcsf-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fcsf-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fcsf-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divriots","download_url":"https://codeload.github.com/divriots/csf-helpers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fcsf-helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34063149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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-11-13T12:40:05.842Z","updated_at":"2026-06-08T12:32:01.882Z","avatar_url":"https://github.com/divriots.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSF helpers [![npm Version](https://img.shields.io/npm/v/@divriots/csf-helpers?cacheSeconds=1800)](https://npmjs.com/package/divriots/csf-helpers)\n\nThis is a collection of helper functions to manipulate, combine and resolve CSF stories.\nSome helpers were extracted from storybook store, with modifications to work standalone.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n\n## Install\n\n\n```sh\n$ npm install --save @divriots/csf-helpers\n```\n\n```javascript\nimport { ... } from \"@divriots/csf-helpers\";\n```\n\n## Usage\n\n```js\nimport {\n  normalizeProjectAnnotations,\n  processCSFFile,\n  prepareStory,\n  renderStory\n} from \"@divriots/csf-helpers\";\n\n// normalizes project annotations (render, renderToDOM, globals, parameters ...)\nconst projectAnnotations = normalizeProjectAnnotations({\n  parameters: {\n    layout: 'centered'\n  }\n});\n\nconst module = await import('./stories.js')\n\n// returns normalized component annotations, plus list of (normalized)\n//  stories in the given module\nconst { meta, stories } = processCSFFile(module, './stories.js');\n\n// prepares story for rendering, binds decorators, loaders, renderers\nconst prepared = prepareStory(stories[0], meta, projectAnnotations);\n\n// renders story in given DOM element, returns dispose function to unmount\nconst dispose = await renderStory(\n  prepared,\n  document.getElementById('root')\n)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivriots%2Fcsf-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivriots%2Fcsf-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivriots%2Fcsf-helpers/lists"}