# nanoresource-promise

> Promises based nanoresource

Latest version **3.2.0** (published 2022-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install nanoresource-promise
pnpm add nanoresource-promise
yarn add nanoresource-promise
bun add nanoresource-promise
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2022-10-23 |
| First published | 2020-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 94.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | GEUT |
| Maintainers | tinchoz49 |
| Keywords | nanoresource, promises |

## Links

- npm: https://www.npmjs.com/package/nanoresource-promise
- Repository: https://github.com/geut/nanoresource-promise
- Homepage: https://github.com/geut/nanoresource-promise#readme
- Issues: https://github.com/geut/nanoresource-promise/issues
- npm.io page: https://npm.io/package/nanoresource-promise

## Dependencies (3)

- [emittery](https://npm.io/package/emittery.md) ^1.0.0
- [eventemitter2](https://npm.io/package/eventemitter2.md) ^6.4.9
- [proc-nexttick](https://npm.io/package/proc-nexttick.md) ^1.0.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 3.2.0 (latest) — 2022-10-23
- 2.0.0-beta.2 (beta) — 2020-05-28
- 3.1.0 — 2022-09-19
- 3.0.4 — 2022-09-17
- 3.0.3 — 2021-12-03
- 3.0.2 — 2021-09-15
- 3.0.1 — 2021-08-17
- 3.0.0 — 2021-08-05
- 2.0.0 — 2020-07-15
- 2.0.0-beta.1 — 2020-05-28
- 2.0.0-beta.0 — 2020-05-19
- 1.2.2 — 2020-05-19
- 1.2.1 — 2020-03-27
- 1.2.0 — 2020-03-13
- 1.1.1 — 2020-03-13
- … 3 more at https://npm.io/package/nanoresource-promise/versions

## README

# nanoresource-promise

[![Build Status](https://travis-ci.com/geut/nanoresource-promise.svg?branch=master)](https://travis-ci.com/geut/nanoresource-promise)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

> Promises based [nanoresource](https://github.com/mafintosh/nanoresource)

## <a name="install"></a> Install

```
$ npm install nanoresource-promise
```

## <a name="usage"></a> Usage

```javascript
import { NanoresourcePromise } from 'nanoresource-promise'

;(async () => {
  const resource = new NanoresourcePromise({
    async open() {
      // open the resource
    },
    async close() {
      // close the resource
    }
  })

  await resource.open()
  await resource.close()
})()
```

### Event support

```javascript
import { NanoresourcePromise } from 'nanoresource-promise/emitter' // for emittery support uses 'nanoresource-promise/emittery'

;(async () => {
  const resource = new NanoresourcePromise({
    async open() {
      // open the resource
    },
    async close() {
      // close the resource
    }
  })

  resource.on('open', () => {})
  resource.on('opened', () => {})
  resource.on('close', () => {})
  resource.on('closed', () => {})

  await resource.open()
  await resource.close()
})()
```

## <a name="issues"></a> Issues

:bug: If you found an issue we encourage you to report it on [github](https://github.com/geut/nanoresource-promise/issues). Please specify your OS and the actions to reproduce it.

## <a name="contribute"></a> Contributing

:busts_in_silhouette: Ideas and contributions to the project are welcome. You must follow this [guideline](https://github.com/geut/nanoresource-promise/blob/master/CONTRIBUTING.md).

## License

MIT © A [**GEUT**](http://geutstudio.com/) project

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