# @junk-temporary-prototypes/postinstall

> Storybook addons postinstall utilities

Latest version **7.2.5** (published 2023-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @junk-temporary-prototypes/postinstall
pnpm add @junk-temporary-prototypes/postinstall
yarn add @junk-temporary-prototypes/postinstall
bun add @junk-temporary-prototypes/postinstall
```

## Health

**Score 50/100 (C)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 7.2.5 |
| Published | 2023-06-08 |
| First published | 2023-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 90979 |
| Maintainers | kasperpeulen, jreinhold |
| Keywords | api, storybook |

## Links

- npm: https://www.npmjs.com/package/@junk-temporary-prototypes/postinstall
- Repository: https://github.com/storybookjs/storybook
- Homepage: https://github.com/storybookjs/storybook/tree/main/lib/postinstall
- Issues: https://github.com/storybookjs/storybook/issues
- Funding: https://opencollective.com/storybook
- npm.io page: https://npm.io/package/@junk-temporary-prototypes/postinstall

## Recent versions

- 7.2.5 (latest) — 2023-06-08
- 7.2.0-pr-47-60d512b.0 (pr-47) — 2023-07-06
- 7.2.1 (next) — 2023-06-07
- 7.2.0-pr-46-b35a952.0 (pr-46) — 2023-06-06
- 7.2.0-pr-43-e055456.0 (pr-43) — 2023-06-05
- 7.2.0-pr-40-asdf123.0 (pr-40) — 2023-06-01
- 7.0.8-alpha.4 (next}) — 2023-05-25
- 7.1.0-beta.2 (beta) — 2023-05-01
- 7.1.0-alpha.1 (alpha) — 2023-05-01
- 7.2.4 — 2023-06-08
- 7.2.3 — 2023-06-08
- 7.2.2 — 2023-06-08
- 7.2.0 — 2023-06-06
- 7.2.0-pr-43-b6a1f17.0 — 2023-06-05
- 7.2.0-pr-43-3a3d678.0 — 2023-06-05
- … 16 more at https://npm.io/package/@junk-temporary-prototypes/postinstall/versions

## README

# Storybook Postinstall Utilties

A minimal utility library for addons to update project configurations after the addon is installed via the [Storybook CLI](https://github.com/storybookjs/storybook/tree/main/lib/cli), e.g. `sb add docs`.

Each postinstall is written as a [jscodeshift](https://github.com/facebook/jscodeshift) codemod, with the naming convention `addon-name/postinstall/<file>.js` where `file` is one of { `config`, `addons`, `presets` }.

If these files are present in the addon, the CLI will run them on the existing file in the user's project (or create a new empty file if one doesn't exist). This library exists to make it really easy to make common modifications without having to muck with jscodeshift internals.

## Adding a preset

To add a preset to `presets.js`, simply create a file `postinstall/presets.js` in your addon:

```js
import { presetsAddPreset } = require('@storybook/postinstall');
export default function transformer(file, api) {
  const root = api.jscodeshift(file.source);
  presetsAddPreset(`@storybook/addon-docs/preset`, { some: 'options' }, { root, api });
  return root.toSource();
};
```

---
_Source: https://npm.io/package/@junk-temporary-prototypes/postinstall · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
