# @debuggercrafts/story-parser

> Story Helper function to parse story files using webpack `require.context` api.

Latest version **1.0.0** (published 2019-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @debuggercrafts/story-parser
pnpm add @debuggercrafts/story-parser
yarn add @debuggercrafts/story-parser
bun add @debuggercrafts/story-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-02-21 |
| First published | 2019-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | rihdus |
| Maintainers | rihdus |
| Keywords | storybook, react |

## Links

- npm: https://www.npmjs.com/package/@debuggercrafts/story-parser
- npm.io page: https://npm.io/package/@debuggercrafts/story-parser

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-02-21

## README

Story 
Helper function to parse story files using webpack `require.context` api.

## Format

- storyPath
  Path of the story file 
- storyName
  Name of the story
- DefaultStoryComponent
  Default story exported from the story file. 

# Usage

```js
// .storybook/config.js
import { storiesOf, configure } from '@storybook/react'
import { loadStories } from '@debuggercrafts/story-parser'

const req = require.context('../src', true, /\.story\.js$/)

configure(() => {
  const stories = loadStories(req)

  stories.forEach(({ storyPath, storyName, DefaultStoryComponent }) => {
    const storyRoot = storiesOf(storyPath)

    storyRoot.add(storyName, DefaultStoryComponent)
  })
}, module)
```

---
_Source: https://npm.io/package/@debuggercrafts/story-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
