# @f/channel

> Simple CSP channel implemented with promises.

Latest version **1.1.0** (published 2016-03-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/channel
pnpm add @f/channel
yarn add @f/channel
bun add @f/channel
```

## 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.1.0 |
| Published | 2016-03-22 |
| First published | 2016-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/channel
- Repository: https://github.com/micro-js/channel
- Homepage: https://github.com/micro-js/channel#readme
- Issues: https://github.com/micro-js/channel/issues
- npm.io page: https://npm.io/package/@f/channel

## Dependencies (2)

- [@f/foreach](https://npm.io/package/@f/foreach.md) ^1.2.2
- [@f/defer-promise](https://npm.io/package/@f/defer-promise.md) ^1.0.0

## Recent versions

- 1.1.0 (latest) — 2016-03-22
- 1.0.0 — 2016-02-25

## README

# channel

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Simple CSP channel implemented with promises.

## Installation

    $ npm install @f/channel

## Usage

```js
import channel from '@f/channel'

let {take, put} = channel()

take().then(val => val) // => 42
put(42).then(val => val) // => true

```

## API

### channel()

**Returns:** bound channel methods

### take()

**Returns:** promise that resolves to a value that is put on channel

### put(value)

- `value` - value to put

**Returns**: promise that resolves to true or false indicating whetehr value is taken

### close()
Close the channel. All pending takes resolve to CLOSED. All pending puts resolve to false.

### open()
Open the channel. Open a closed channel.

### CLOSED
Closed value.

## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/channel.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/channel
[git-image]: https://img.shields.io/github/tag/micro-js/channel.svg?style=flat-square
[git-url]: https://github.com/micro-js/channel
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/channel.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/channel

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