# cms-plugin-utilst

> ``` npm install --save cms-plugin-utilst ```

Latest version **0.0.7** (published 2020-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install cms-plugin-utilst
pnpm add cms-plugin-utilst
yarn add cms-plugin-utilst
bun add cms-plugin-utilst
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-03-06 |
| First published | 2020-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | esun |

## Links

- npm: https://www.npmjs.com/package/cms-plugin-utilst
- npm.io page: https://npm.io/package/cms-plugin-utilst

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.5.5

## Recent versions

- 0.0.7 (latest) — 2020-03-06
- 0.0.4 — 2020-03-04
- 0.0.3 — 2020-03-04
- 0.0.2 — 2020-03-04
- 0.0.1 — 2020-03-04

## README

## Install
```
npm install --save cms-plugin-utilst
```

Or if you prefer yarn: 
```
yarn add cms-plugin-utilst
```

## Usage

### Adding a plugin
```
import { registerPlugins } from "cms-plugin-utilst";

// Add a plugin
registerPlugins({
    name: "my-plugin",
    type: "say-hi",
    render: () => "Hi!"
});

registerPlugins({
    name: "my-second-plugin",
    type: "say-hi",
    render: () => "Yo!"
});
```

### Getting a single plugin by name
```
// anywhere in your app
import { getPlugin } from "cms-plugin-utilst";

const plugin = getPlugin("my-plugin");
plugin.render();
```

### Getting plugins by type
```
// anywhere in your app
import { getPlugins } from "cms-plugin-utilst";

const plugins = getPlugins("say-hi");
plugins.forEach(plugin => {
    plugin.render();
});
```

### Removing a plugin
```
// anywhere in your app
import { unregisterPlugin } from "cms-plugin-utilst";

unregisterPlugin("my-plugin");
```


### renderPlugin
```
// anywhere in your app
import { renderPlugin } from "cms-plugin-utilst";

<div>
  {renderPlugin('my-plugin', {})}
</div>
```

### renderPlugins
```
// anywhere in your app
import { renderPlugins } from "cms-plugin-utilst";

<div>
  {renderPlugins('say-hi', {})}
</div>
```

---
_Source: https://npm.io/package/cms-plugin-utilst · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
