# idyll-plugin-url-state

> This plugin enables the state of an Idyll article to be serialized/deserialized from the URL's query string.

Latest version **2.0.6** (published 2018-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install idyll-plugin-url-state
pnpm add idyll-plugin-url-state
yarn add idyll-plugin-url-state
bun add idyll-plugin-url-state
```

## 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 | 2.0.6 |
| Published | 2018-11-30 |
| First published | 2018-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matthew Conlen |
| Maintainers | mathisonian |

## Links

- npm: https://www.npmjs.com/package/idyll-plugin-url-state
- Repository: https://github.com/idyll-lang/idyll-plugin-url-state
- Homepage: https://github.com/idyll-lang/idyll-plugin-url-state#readme
- Issues: https://github.com/idyll-lang/idyll-plugin-url-state/issues
- npm.io page: https://npm.io/package/idyll-plugin-url-state

## Dependencies (1)

- [query-string](https://npm.io/package/query-string.md) ^6.2.0

## Recent versions

- 2.0.6 (latest) — 2018-11-30
- 2.0.5 — 2018-11-30
- 2.0.3 — 2018-11-30
- 2.0.2 — 2018-11-30
- 2.0.1 — 2018-11-30
- 1.0.1 — 2018-11-22

## README

# idyll-plugin-url-state

This plugin enables the state of an Idyll article to be serialized/deserialized from the URL's query string.


## Usage

Install this as a dependency:

```
$ npm i --save idyll-plugin-url-state
```

This plugin requires being hooked into Idyll's context API. To do this, first you need to tell Idyll to use a custom context.

*In package.json*

```json
"idyll": {
  "context": "./context.js"
}
```

If you aren't using any other context plugins, your `context.js` file would look like this:

```js
const URLState = require('idyll-plugin-url-state');

// All keys
module.exports = URLState();

// Only certain keys
module.exports = URLState(['key1', 'key2', ...]);
```

If you are, you can use `idyll-context-compose` to compose multiple contexts together:



```js
const compose = require('idyll-context-compose');
const URLState = require('idyll-plugin-url-state');

module.exports = compose(URLState(), otherContext);
```

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