open-index/open-npm huggingface dataset:
npm package: @rilix/ajv-keywords
Description: extra keywords for ajv
Author: Rilix, LTDA
Latest version: 0.1.1

# @rilix/ajv-keywords

[![Build Status](https://travis-ci.org/rilix-global/ajv-keywords.svg?branch=master)](https://travis-ci.org/rilix-global/ajv-keywords)
[![Test Coverage](https://codeclimate.com/github/rilix-global/ajv-keywords/badges/coverage.svg)](https://codeclimate.com/github/rilix-global/ajv-keywords/coverage)
[![Code Climate](https://codeclimate.com/github/rilix-global/ajv-keywords/badges/gpa.svg)](https://codeclimate.com/github/rilix-global/ajv-keywords)
[![Issue Count](https://codeclimate.com/github/rilix-global/ajv-keywords/badges/issue_count.svg)](https://codeclimate.com/github/rilix-global/ajv-keywords)

This lid adds some keywords to ajv, mainly to facilitate our translations.

How to user:

```javascript
import Ajv from 'ajv';
import rilixAjvKeywords from '@rilix/ajv-keywords';

const ajv = new Ajv();
rilixAjvKeywords(ajv);

ajv.validate({ email: true }, 'example@example.com'); // true
ajv.validate({ email: true }, 'example'); // false
```

For more usage examples please refer to the spec folder or open an issue with a question.
npm package: @rilke/cli
Description: A Schematic for Rilke Architect
Author: Kant Yazılım A.Ş.
Latest version: 17.0.2

<p align="center"><a href="https://rilke.ist" target="_blank" rel="noopener noreferrer"><img width="320" src="https://rilke.ist/assets/logo/logo-stroked.png" alt="Rilke logo"></a></p>
<p align="center">
	<a href="https://npmcharts.com/compare/@rilke/cli?minimal=true"><img src="https://img.shields.io/npm/dm/@rilke/cli.svg?sanitize=true" alt="Downloads"></a>
	<a href="https://www.npmjs.com/package/@rilke/cli"><img src="https://img.shields.io/npm/v/@rilke/cli.svg?sanitize=true" alt="Version"></a>
	<a href="https://www.npmjs.com/package/@rilke/cli"><img src="https://img.shields.io/npm/l/@rilke/cli.svg?sanitize=true" alt="License"></a>
	<br>
	<img src="https://github.com/kantist/rilke-cli/actions/workflows/npm-publish.yml/badge.svg" alt="status">
</p>
<h1 align="center">Rilke CLI - Developed schematic for Rilke Architecture.</h1>
<p align="center">
	<br>
	<i>Rilke. An Advanced Architecture. Developed for complex and modular projects.
	<br> using Angular Framework.</i>
	<br>
</p>
<p align="center">
	<a href="https://rilke.ist/cli/">Getting Started</a>
	·
	<a href="https://github.com/kantist/rilke-cli/issues">Submit an Issue</a>
	<br>
	<br>
</p>

<hr>

## Documentation

Get started with Rilke, learn the fundamentals and explore advanced topics on our documentation website.

-   [Getting Started][quickstart]
-   [Architecture][architecture]

## Development Setup

### Prerequisites

-   Install [Node.js] which includes [Node Package Manager][npm]

### Setting Up a Project

Install the Rilke CLI globally:

```
npm install -g @rilke/cli
```

Create workspace:

```
rilke new [PROJECT NAME]
```

Run the application:

```
cd [PROJECT NAME]
rilke serve
```

## Ecosystem

| Project                                                     | Package                                                                                                                                      | Description                        |
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| <a href="https://github.com/kantist/rilke">Rilke UI</a>     | <a href="https://npmjs.com/package/@rilke/ui"><img src="https://img.shields.io/npm/v/@rilke/ui.svg?sanitize=true" alt="Version"></a>         | Modern UI Kit for Rilke Architect  |
| <a href="https://github.com/kantist/rilke">Rilke Common</a> | <a href="https://npmjs.com/package/@rilke/common"><img src="https://img.shields.io/npm/v/@rilke/common.svg?sanitize=true" alt="Version"></a> | A Core library for Rilke Architect |

[quickstart]: https://rilke.ist/cli/
[architecture]: https://rilke.ist/architecture/
[node.js]: https://nodejs.org/
[npm]: https://www.npmjs.com/get-npm
[angular]: https://angular.io/cli
npm package: @rilke/common
Description: Rilke Common Library
Author: Kant Yazılım A.Ş.
Latest version: 17.0.4

<p align="center"><a href="https://rilke.ist" target="_blank" rel="noopener noreferrer"><img width="320" src="https://rilke.ist/assets/logo/logo-stroked.png" alt="Rilke logo"></a></p>
<p align="center">
	<a href="https://npmcharts.com/compare/@rilke/common?minimal=true"><img src="https://img.shields.io/npm/dm/@rilke/common.svg?sanitize=true" alt="Downloads"></a>
	<a href="https://npmjs.com/package/@rilke/common"><img src="https://img.shields.io/npm/v/@rilke/common.svg?sanitize=true" alt="Version"></a>
	<a href="https://npmjs.com/package/@rilke/common"><img src="https://img.shields.io/npm/l/@rilke/common.svg?sanitize=true" alt="License"></a>
	<br>
	<img src="https://github.com/kantist/rilke/actions/workflows/publish.yml/badge.svg" alt="status">
</p>
<h1 align="center">Rilke Common - A Core library for Rilke Architecture.</h1>
<p align="center">
	<br>
	<i>Rilke. An Advanced Architecture. Developed for complex and modular projects.
	<br> using Angular Framework.</i>
	<br>
</p>
<p align="center">
	<a href="https://rilke.ist/">Getting Started</a>
	·
	<a href="https://github.com/kantist/rilke/issues">Submit an Issue</a>
	<br>
	<br>
</p>

<hr>

## Documentation

Get started with Rilke, learn the fundamentals and explore advanced topics on our documentation website.

-   [Getting Started][quickstart]
-   [Architecture][architecture]
-   [CLI][cli]
-   [UI][ui]

## Development Setup

### Prerequisites

-   Install [Node.js] which includes [Node Package Manager][npm]

### Setting Up a Project

Install the Rilke UI to Rilke or Angular Application:

```
npm i @rilke/common
```

## Ecosystem

| Project                                                     | Package                                                                                                                                      | Description                        |
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| <a href="https://github.com/kantist/rilke">Rilke UI</a>     | <a href="https://npmjs.com/package/@rilke/ui"><img src="https://img.shields.io/npm/v/@rilke/ui.svg?sanitize=true" alt="Version"></a>         | Modern UI Kit for Rilke Architect  |
| <a href="https://github.com/kantist/rilke">Rilke Common</a> | <a href="https://npmjs.com/package/@rilke/common"><img src="https://img.shields.io/npm/v/@rilke/common.svg?sanitize=true" alt="Version"></a> | A Core library for Rilke Architect |

[quickstart]: https://rilke.ist/
[architecture]: https://rilke.ist/architecture/
[cli]: https://rilke.ist/cli/
[ui]: https://rilke.ist/ui/
[node.js]: https://nodejs.org/
[npm]: https://www.npmjs.com/get-npm
npm package: @rilke/store
Description: Rilke State Management Library
Author: Kant Yazılım A.Ş.
Latest version: 17.0.1

<p align="center"><a href="https://rilke.ist" target="_blank" rel="noopener noreferrer"><img width="320" src="https://rilke.ist/assets/logo/logo-stroked.png" alt="Rilke logo"></a></p>
<p align="center">
	<a href="https://npmcharts.com/compare/@rilke/ui?minimal=true"><img src="https://img.shields.io/npm/dm/@rilke/ui.svg?sanitize=true" alt="Downloads"></a>
	<a href="[rilke-ui-package]"><img src="https://img.shields.io/npm/v/@rilke/ui.svg?sanitize=true" alt="Version"></a>
	<a href="[rilke-ui-package]"><img src="https://img.shields.io/npm/l/@rilke/ui.svg?sanitize=true" alt="License"></a>
	<br>
	<img src="https://github.com/kantist/rilke/actions/workflows/publish.yml/badge.svg" alt="status">
</p>
<h1 align="center">Rilke UI - Advanced customizable UI components for Rilke Architecture.</h1>
<p align="center">
	<br>
	<i>Rilke. An Advanced Architecture. Developed for complex and modular projects.
	<br> using Angular Framework.</i>
	<br>
</p>
<p align="center">
	<a href="https://rilke.ist/ui/">Getting Started</a>
	·
	<a href="https://github.com/kantist/rilke/issues">Submit an Issue</a>
	<br>
	<br>
</p>

<hr>

## Documentation

Get started with Rilke, learn the fundamentals and explore advanced topics on our documentation website.

-   [Getting Started][quickstart]
-   [Typography][typography]
-   [Color Palettes][color_palettes]
-   [Theme Generator][theme_generator]

## Development Setup

### Prerequisites

-   Install [Node.js] which includes [Node Package Manager][npm]

### Setting Up a Project

Install the Rilke UI to Rilke or Angular Application:

```
rilke add @rilke/ui
```

[rilke-ui]: https://github.com/kantist/rilke
[rilke-ui-package]: https://npmjs.com/package/@rilke/ui
[quickstart]: https://rilke.ist/ui/
[typography]: https://rilke.ist/ui/typography/
[color_palettes]: https://rilke.ist/ui/color-palette/
[theme_generator]: https://rilke.ist/ui/theme-generator/
[node.js]: https://nodejs.org/
[npm]: https://www.npmjs.com/get-npm
[angular]: https://angular.io/cli
npm package: @rilke/ui
Description: Rilke UI Library
Author: Kant Yazılım A.Ş.
Latest version: 15.0.39

<p align="center"><a href="https://rilke.ist" target="_blank" rel="noopener noreferrer"><img width="320" src="https://rilke.ist/assets/logo/logo-stroked.png" alt="Rilke logo"></a></p>
<p align="center">
	<a href="https://npmcharts.com/compare/@rilke/ui?minimal=true"><img src="https://img.shields.io/npm/dm/@rilke/ui.svg?sanitize=true" alt="Downloads"></a>
	<a href="https://npmjs.com/package/@rilke/ui"><img src="https://img.shields.io/npm/v/@rilke/ui.svg?sanitize=true" alt="Version"></a>
	<a href="https://npmjs.com/package/@rilke/ui"><img src="https://img.shields.io/npm/l/@rilke/ui.svg?sanitize=true" alt="License"></a>
	<br>
	<img src="https://github.com/kantist/rilke/actions/workflows/publish.yml/badge.svg" alt="status">
</p>
<h1 align="center">Rilke UI - Advanced customizable UI components for Rilke Architecture.</h1>
<p align="center">
	<br>
	<i>Rilke. An Advanced Architecture. Developed for complex and modular projects.
	<br> using Angular Framework.</i>
	<br>
</p>
<p align="center">
	<a href="https://rilke.ist/ui/">Getting Started</a>
	·
	<a href="https://github.com/kantist/rilke/issues">Submit an Issue</a>
	<br>
	<br>
</p>

<hr>

## Documentation

Get started with Rilke, learn the fundamentals and explore advanced topics on our documentation website.

-   [Getting Started][quickstart]
-   [Typography][typography]
-   [Color Palettes][color_palettes]
-   [Theme Generator][theme_generator]

## Development Setup

### Prerequisites

-   Install [Node.js] which includes [Node Package Manager][npm]

### Setting Up a Project

Install the Rilke UI to Rilke or Angular Application:

```
rilke add @rilke/ui
```

## Ecosystem

| Project                                                     | Package                                                                                                                                      | Description                        |
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| <a href="https://github.com/kantist/rilke">Rilke UI</a>     | <a href="https://npmjs.com/package/@rilke/ui"><img src="https://img.shields.io/npm/v/@rilke/ui.svg?sanitize=true" alt="Version"></a>         | Modern UI Kit for Rilke Architect  |
| <a href="https://github.com/kantist/rilke">Rilke Common</a> | <a href="https://npmjs.com/package/@rilke/common"><img src="https://img.shields.io/npm/v/@rilke/common.svg?sanitize=true" alt="Version"></a> | A Core library for Rilke Architect |

[quickstart]: https://rilke.ist/ui/
[typography]: https://rilke.ist/ui/typography/
[color_palettes]: https://rilke.ist/ui/color-palette/
[theme_generator]: https://rilke.ist/ui/theme-generator/
[node.js]: https://nodejs.org/
[npm]: https://www.npmjs.com/get-npm
npm package: @rill/batch
Description: Handle batch requests with a Rill server.
Author: Dylan Piercey
Latest version: 0.4.1

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/batch
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/batch">
    <img src="https://img.shields.io/npm/v/@rill/batch.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/batch">
    <img src="https://img.shields.io/npm/dm/@rill/batch.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Batch API requests with Rill.

If you need to perform several different requests to your API simultaneously, you could combine them all together (in one querystring or body) and send only one request to the server, improving latency in the browser.

Currently, only `GET` requests can be batched.

# Installation

```console
npm install @rill/batch
```

# Example

#### app.js

```js
const rill = require('rill')
const app = rill()
const batch = require('@rill/batch')
const loadUser = require('./load-user.js')

// Setup the middleware.
app.get('/batch', batch())

// Example routes.
app.get("/page1", ({ res })=> {
	res.body = { name: 'page1' }
})

app.get("/page2", ({ res })=> {
	res.body = { name: 'page2' }
})
```

#### somewhere.js

```js
fetch('myapi.com/batch?a=/page1&b=/page2')
	.then((res)=> res.json())
	.then((data)=> {
		/**
		 * {
		 * 	a: { status: 200, headers: {...}, body: { name: 'page1' } }
		 * 	b: { status: 200, headers: {...}, body: { name: 'page2' } }
		 * }
		 */
	})
```

# API

+ **batch({ from: 'query' || 'body', concurrency: Infinity, forwardIP: true })** : Creates a middleware that will batch api requests.

```javascript
// Handle batch requests at 'GET /batch' using request query.
app.get('/batch', batch({ from: 'query' }))

// Handle batch requests at 'POST /patch' using request body.
app.post('/batch', batch({ from: 'body' }))

// Limit concurrent batch request to 5 (default is infinity).
app.get('/batch', batch({ concurrency: 5 }))

// Disable automatic `X-Forwarded-For` header.
app.get('/batch', batch({ forwardIP: false }))
```
---

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/body
Description: Isomorphic body parsing for Rill.
Author: Dylan Piercey
Latest version: 1.3.0

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/body
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/body">
    <img src="https://img.shields.io/npm/v/@rill/body.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/body">
    <img src="https://img.shields.io/npm/dm/@rill/body.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Isomorphic request body parser for Rill.
Uses [formidable](http://github.com/felixge/node-formidable) to parse form data.

# Installation

```console
npm install @rill/body
```

# Example

```javascript
const app = require("rill")()
const bodyParser = require("@rill/body")

app.use(bodyParser())
app.use(function ({ req, res }, next) {
	req.body // Object containing parsed form fields.
	req.files // Object of form fields with files.
})
```

# API Options / Defaults.

```javascript
{
	// Form encoding.
	encoding: "utf-8",
	// Max size (in bytes) for forms.
	limit: "2mb",
	// Max number of fields (0 for unlimited).
	limitFields: 1000,
	// Ignore form data parsing on GET, HEAD and DELETE requests.
	strict: true,
	// When flat is false fields such as a[b][c] won't be expanded.
	flat: false,
	// A function that can modify all fields parsed.
	transformField: (field, value)=> ...,
	// A function that can modify all files parsed.
	transformFile: (field, file)=> ...,
}
```


### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/chain
Description: Compose all functions and Rill apps provided into a valid middleware.
Author: Dylan Piercey
Latest version: 1.1.1

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/chain
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg" alt="API Stability"/>
  </a>
  <!-- TypeScript -->
  <a href="http://typescriptlang.org">
    <img src="https://img.shields.io/badge/%3C%2F%3E-typescript-blue.svg" alt="TypeScript"/>
  </a>
  <!-- Prettier -->
  <a href="https://github.com/prettier/prettier">
    <img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with prettier"/>
  </a>
  <!-- Travis build -->
  <a href="https://travis-ci.org/rill-js/@rill/chain">
  <img src="https://img.shields.io/travis/rill-js/@rill/chain.svg" alt="Build status"/>
  </a>
  <!-- Coveralls coverage -->
  <a href="https://coveralls.io/github/rill-js/@rill/chain">
    <img src="https://img.shields.io/coveralls/rill-js/@rill/chain.svg" alt="Test Coverage"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/chain">
    <img src="https://img.shields.io/npm/v/@rill/chain.svg" alt="NPM Version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/chain">
    <img src="https://img.shields.io/npm/dm/@rill/chain.svg" alt="Downloads"/>
  </a>
  <!-- Size -->
  <a href="https://npmjs.org/package/@rill/chain">
    <img src="https://img.shields.io/badge/size-766b-green.svg" alt="Browser Bundle Size"/>
  </a>
</h1>

This module is used internally by Rill but is extracted for convenience.
Composes all functions and Rill apps provided into a valid middleware function that returns a promise.

# Installation

```console
npm install @rill/chain
```

# Example

```javascript
import chain from "@rill/chain";

const stack = [];

// Regular functions that return anything
// but they will be resolved as promises.
stack.push((ctx, next)=> {
  return Promise.resolve(true);
})

// Async/await functions
stack.push(async (ctx, next)=> {
  await Promise.resolve(true);
});

// Other apps.
const app = new Rill();
app.use(...);
stack.push(app);

// Compose it into a function (returns a promise).
const fn = chain(stack)

// Call the function with a context.
fn({}).catch((err)=> {
  console.error(err.stack);
  process.exit(1);
});
```

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/compress
Description: Response compression middleware for Rill.
Author: Dylan Piercey
Latest version: 1.0.5

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/compress
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/compress">
    <img src="https://img.shields.io/npm/v/@rill/compress.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/compress">
    <img src="https://img.shields.io/npm/dm/@rill/compress.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Isomorphic response body compression middleware for Rill using gzip or deflate if available.

# Installation

```console
npm install @rill/compress
```

# Example

```javascript
const app = require('rill')()
const compress = require('@rill/compress')

app.use(compress())
app.use(({ req, res }, next)=> {
	// Send this file.
	// Supported encodings: gzip, deflate and identity.
	res.body = fs.createReadStream(__filename)
})
```

# API Options / Defaults.

```javascript
{
	// The minimum response size to compress.
	threshold: "1kb",
	// Optional function to filter compressed responses by content-type.
	filter: function (contentType) { ... }
}
```


### Contributions

* Use gulp to run tests.

Please feel free to create a PR!
npm package: @rill/cookies
Description: Isomorphic cookie parser and serializer.
Author: Dylan Piercey
Latest version: 2.0.0
Deprecated: Please use jshttp/cookie instead

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/cookies
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/cookies">
    <img src="https://img.shields.io/npm/v/@rill/cookies.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/cookies">
    <img src="https://img.shields.io/npm/dm/@rill/cookies.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

## DEPRECATED: Rill now uses [jshttp/cookie](https://github.com/jshttp/cookie).

A cookie parser and serializer used internally for Rill that works isomorphically.

# Installation

```console
npm install @rill/cookies
```

# Example

```javascript
const { parse, serialize } = require("@rill/cookies")

parse("a=1") // -> { a: 1 }
serialize("a", 1, { httpOnly: true }) // "a=1; httponly"
```

# API

**parse(cookie)** - Parse a cookie string into an object.

**serialize(cookie, value, options)** - Turn a cookie with options into a string.

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/delegate
Description: Isomorphic request based event delegation for Rill.
Author: Dylan Piercey
Latest version: 5.0.0

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/delegate
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/delegate">
    <img src="https://img.shields.io/npm/v/@rill/delegate.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/delegate">
    <img src="https://img.shields.io/npm/dm/@rill/delegate.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Isomorphic event delegation utility for Rill. This allows for isomorphic DOM event binding with any templating language.

# Installation

#### Npm
```bash
npm install @rill/delegate
```

# API

### delegate(options)

  Setups up a middleware that will reset event listeners once per request.
  This allows for page specific delegators.

```javascript
const app = require('rill')()
const delegate = require('@rill/delegate')

// Setup middleware.
app.use(delegate())
```

### delegate.on(event, [selector=document], handler)

  Registers a delegated event listener for the request.

```javascript
app.get('/', (ctx) => {
  // Here we listen for `keyup` events that match a `.verification-code` element.
  delegate.on('keyup', '.verification-code', (ev, go) => {
      // `currentTarget` will be the element that matched the selector.
      const input = ev.currentTarget;
      const code = input.value

      // The second argument is the 'go' utility, which is much like native fetch but tells Rill to navigate.
      if (code.length === 5) {
        // In this case when we have 5 characters, we navigate to the submission page.
        go('/submit', {
          method: 'POST',
          body: { code }
        })
      }
  })

  // We can also add event listeners to the window by omitting the selector.
  delegate.on('scroll', ev => ...)

  // Finally, #on returns a function which can be used to stop the listener.
  const cancel = delegate.on('scroll', ev => ...)
})
```

### delegate.once(event, [selector=document], handler)

  Registers a delegated event listener for the request that is canceled after the first run.

```javascript
app.get('/', (ctx) => {
  // Scroll will only fire at most once per request.
  const cancel = delegate.once('scroll', (ev, go) => ...)
});
```

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/error
Description: HttpError instance used in the Rill framework.
Author: Dylan Piercey
Latest version: 1.3.3

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/error
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg" alt="API Stability"/>
  </a>
  <!-- TypeScript -->
  <a href="http://typescriptlang.org">
    <img src="https://img.shields.io/badge/%3C%2F%3E-typescript-blue.svg" alt="TypeScript"/>
  </a>
  <!-- Prettier -->
  <a href="https://github.com/prettier/prettier">
    <img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with prettier"/>
  </a>
  <!-- Travis build -->
  <a href="https://travis-ci.org/rill-js/@rill/error">
  <img src="https://img.shields.io/travis/rill-js/@rill/error.svg" alt="Build status"/>
  </a>
  <!-- Coveralls coverage -->
  <a href="https://coveralls.io/github/rill-js/@rill/error">
    <img src="https://img.shields.io/coveralls/rill-js/@rill/error.svg" alt="Test Coverage"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/error">
    <img src="https://img.shields.io/npm/v/@rill/error.svg" alt="NPM Version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/error">
    <img src="https://img.shields.io/npm/dm/@rill/error.svg" alt="Downloads"/>
  </a>
  <!-- Size -->
  <a href="https://npmjs.org/package/@rill/error">
    <img src="https://img.shields.io/badge/size-766b-green.svg" alt="Browser Bundle Size"/>
  </a>
</h1>

This module is used internally by Rill but is extracted for convenience.
Utility for generating HttpError's with messages, codes and meta data.

# Installation

```console
npm install @rill/error
```

# Example
```javascript
import HttpError, { assert, fail } from "@rill/error";

new HttpError(404); //-> [HttpError Not Found]

fail(404); //-> throws [HttpError Not Found]

assert(false, 404); //-> throws [HttpError Not Found]
assert(true, 404); //-> Does nothing
```

# API
+ **HttpError(statusCode, [statusMessage], [metaData])** : Creates a new HttpError.
+ **HttpError.fail(statusCode, [statusMessage], [metaData])** : Creates a new HttpError and automatically throws it.
+ **HttpError.assert(value, statusCode, [statusMessage], [metaData])** : Creates a new HttpError and automatically throws it if value is falsey.

### Contributions

Use `npm test` to run tests.
Please feel free to create a PR!
npm package: @rill/etag
Description: Add ETag header to Rill responses.
Author: Dylan Piercey
Latest version: 1.1.1

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/etag
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/etag">
    <img src="https://img.shields.io/npm/v/@rill/etag.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/etag">
    <img src="https://img.shields.io/npm/dm/@rill/etag.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

<div align="center">
  Automatically generate ETag http headers for responses with Rill.
</div>

## Installation

```console
npm install @rill/etag
```

## Example

```js
const rill = require('rill')
const app = rill()
const fresh = require('@rill/fresh')
const etag = require('@rill/etag')

// ETag works together with fresh
app.use(fresh())
app.use(etag())

// Response will be sent with ETag header.
app.use((ctx, next) => {
  this.body = 'Hello World'
})

app.listen(3000)
```

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/expose
Description: Expose each request on the window for easier debugging with Rill.
Author: Dylan Piercey
Latest version: 1.0.0

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/expose
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/expose">
    <img src="https://img.shields.io/npm/v/@rill/expose.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/expose">
    <img src="https://img.shields.io/npm/dm/@rill/expose.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Rill middleware to attach each request on the window for easier debugging.

# Installation

```console
npm install @rill/expose
```

# Example

```js
const app = require('rill')()
const expose = require('@rill/expose')

// Setup the middleware.
app.use(expose())

// Optionally change the namespace for the global variable used.
app.use(expose('mycontext'))
```

## Later in the console

```js
window.ctx.req.href // -> https://...
window.ctx.req.query // -> {...}
window.ctx.locals // -> {...}
```

---

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/flash
Description: Flash messages between requests for Rill.
Author: Dylan Piercey
Latest version: 2.1.2

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/flash
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/flash">
    <img src="https://img.shields.io/npm/v/@rill/flash.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/flash">
    <img src="https://img.shields.io/npm/dm/@rill/flash.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Flash messages between requests for your Rill application.

A flashed message will persist through multiple requests until it is read.
After a flashed message has been read it will be deleted.

# Installation

```console
npm install @rill/flash
```

# Example

```javascript
const app = require("rill")()

// A session is required to use flash messages.
app.use(require("@rill/session")())

// Setup the flash middleware.
app.use(require("@rill/flash")())

// Use it!
app.use(({ req, res, flash })=> {
	if (req.method === "POST") {
		// Here we trigger an error in a post request
		// and wait to retrieve the flashed message (usually rendering a view).
		flash("error", "This is a flash error message.")
	} else {
    // After we read the 'error' flash it is marked to be removed after the request is finished.
		res.body = flash("error") || "No flash message"
	}
})
```

# API

**ctx.flash(key, value)** - Sets a value to be flashed.

**ctx.flash(key)** - Retrieves a flashed value. (Marks a key as expired and removes it after the request)

### Server Side rendering
To help with browser bootstrapping (when using server side rendering) @rill/flash will return the most recent expired flash message on the first request when running in the browser.

This means that if the server renders a page with one flash message, then the browser tries to display that same message when it bootstraps on page load, both the server and the browser will have the same message.

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/forwarded-from
Description: Safe X-Forwarded-For header handling for Rill.
Author: Dylan Piercey
Latest version: 1.1.1

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/forwarded-from
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/forwarded-from">
    <img src="https://img.shields.io/npm/v/@rill/forwarded-from.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/forwarded-from">
    <img src="https://img.shields.io/npm/dm/@rill/forwarded-from.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Safely handle the `X-Forwarded-For` header in [Rill](https://gitter.im/rill-js/rill).

This middleware will update "ctx.req.ip" if a "X-Forwarded-For" header is present from a trusted ip.

It will also update "ctx.req.host, ctx.req.hostname and ctx.req.port" if an "X-Forwarded-Host" header is provided from a trusted ip.

# Installation

```console
npm install @rill/forwarded-from
```

# Example

#### app.js

```js
const app = rill()
const forwarded = require("@rill/forwarded-from")

// This will only trust X-Forwarded-For from incomming requests with the provided ips and any local requests.
app.use(forwarded({ from: ['184.1.2.3', '184.2.3.4'] }))

// Example request with `X-Forwarded-For` and `X-Forwarded-Host` from valid ip.
app.get('/test', ({ req, res })=> {
  req.forwarded //-> true

  req.get('X-Forwarded-For') //-> 178.1.2.3
  req.ip //-> 178.1.2.3

  req.get('X-Forwarded-Host') //-> test.com:3000
  req.host //-> test.com:3000
  req.hostname //-> test.com
  req.port //-> 3000
})
```

# API

+ **forwarded({ from: String..., local: Boolean  })** : Creates a middleware that will update `ctx.req.ip` with a valid `X-Forwarded-For` header.

```javascript
// Without any options this will only allow `X-Forwarded-For` on local requests.
app.use(forwarded())

// Any ip's specified in the `from` option will also be valid.
app.use(forwarded({ from: '184.1.2.3' }))

// You can disable local ip's by setting `options.local=false` (default true).
app.use(forwarded({ from: '184.1.2.3', local: false }))
```

---

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/fresh
Description: HTTP response freshness testing middleware for Rill.
Author: Dylan Piercey
Latest version: 1.0.1

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/fresh
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/fresh">
    <img src="https://img.shields.io/npm/v/@rill/fresh.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/fresh">
    <img src="https://img.shields.io/npm/dm/@rill/fresh.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

<div align="center">
  Check if a response is fresh and automatically send a 304 (not modified) status.
</div>

## Installation

```console
npm install @rill/fresh
```

## Example

```js
var fresh = require('@rill/fresh')
var etag = require('@rill/etag')
var rill = require('rill')
var app = rill()

// use it upstream from etag so
// that they are present

app.use(fresh())

// add etags

app.use(etag())

// respond

app.use(function ({ res }, next){
  res.body = {
    name: 'tobi',
    species: 'ferret',
    age: 2
  }
})

```

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/html
Description: HTML views rendering for Rill.
Author: Dylan Piercey
Latest version: 6.1.0

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/html
  <br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/html">
    <img src="https://img.shields.io/npm/v/@rill/html.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/html">
    <img src="https://img.shields.io/npm/dm/@rill/html.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Universal html rendering middleware for [Rill](https://github.com/rill-js/rill).
Uses [set-dom](https://github.com/DylanPiercey/set-dom) to update html in the browser.

Need isomorphic event handling? Check out [@rill/delegate](https://github.com/rill-js/delegate)!

# Installation

```console
npm install @rill/html
```

# Example

```javascript
// We will use handlebars for our example.
const hbs = require('handlebars')
const homePage = hbs.compile(`
  <html>
    <head>
      <title>My App</title>
      <meta name="description" content="Rill Application">
    </head>
    <body>
      {{title}}
      <script src="/app.js"/>
    </body>
  </html>
`)

// Setup a universal Rill application.
const app = require('rill')()

// Setup the html diffing/rendering middleware.
app.use(require('@rill/html')())

// Setup a homepage route.
app.get('/', ({ req, res }, next)=> {
  // Just set the response body to some html.
  // updates the dom in the browser, or render a string in the server.
  res.body = homePage({ title: '@rill/html' });

  // On the server the final response will be.
  `
    <!DOCTYPE html>
    <html>
      <head>
        <title>My App</title>
        <meta name="description" content="Rill Application">
      </head>
      <body>
        @rill/html
        <script src="/app.js"></script>
      </body>
    </html>
  `
})
```

# Sub page rendering.
Sometimes the goal is not to diff the entire page, or you want to use something like [@rill/page](https://github.com/rill-js/page) to handle the document.

@rill/html adds the ability to change the root element with an option for this purpose.

```js
// Use a query selector to set the root element to diff.
app.use(require('@rill/html')({ root: '#my-element' }))
```

### Contributions

* Use `npm test` to run tests.

Please feel free to create a PR!
npm package: @rill/https
Description: Isomorphic https module with createServer support.
Author: Dylan Piercey
Latest version: 7.0.0

<h1 align="center">
  <!-- Logo -->
  <img src="https://raw.githubusercontent.com/rill-js/rill/master/Rill-Icon.jpg" alt="Rill"/>
  <br/>
  @rill/https
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square" alt="API stability"/>
  </a>
  <!-- Standard -->
  <a href="https://github.com/feross/standard">
    <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/@rill/https">
    <img src="https://img.shields.io/npm/v/@rill/https.svg?style=flat-square" alt="NPM version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/@rill/https">
    <img src="https://img.shields.io/npm/dm/@rill/https.svg?style=flat-square" alt="Downloads"/>
  </a>
  <!-- Gitter Chat -->
  <a href="https://gitter.im/rill-js/rill">
    <img src="https://img.shields.io/gitter/room/rill-js/rill.svg?style=flat-square" alt="Gitter Chat"/>
  </a>
</h1>

Bring a nodejs style server into the client by listening to link clicks and form submissions.

# Why
People love node, people love the programming style and it's flexibility. This api exposes the "http" module as an isomorphic server. It essentially allows you to run your nodejs server in the browser for epic progressive enhancement and an isomorphic paradise. This is a low level library used by [Rill](https://github.com/rill-js/rill) which implements an express style api on top of this.

# Installation

```console
npm install @rill/https
```

# Example

```javascript
var https = require('@rill/https')

window; //-> [Object object]

var server = https.createServer({ ... }, (req, res)=> {
	console.log(req.method, req.url)
	res.end()
});

/**
 * Listening in the browser will intelegently intercept link clicks and form
 * submissions and feed them into the registered handler.
 */
server.listen()
```

### Contributions

* Use gulp to run tests.

Please feel free to create a PR!