Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/geut/hyperdrive-promise

Promise wrapper for Hyperdrive
https://github.com/geut/hyperdrive-promise

async-await dat hyperdrive p2p

Last synced: 2 months ago
JSON representation

Promise wrapper for Hyperdrive

Awesome Lists containing this project

README

        

# hyperdrive-promise

An async/await based wrapper for [hyperdrive](https://github.com/mafintosh/hyperdrive) (v10+)

[![Build Status](https://travis-ci.com/geut/hyperdrive-promise.svg?branch=master)](https://travis-ci.com/geut/hyperdrive-promise) [![Greenkeeper badge](https://badges.greenkeeper.io/geut/hyperdrive-promise.svg)](https://greenkeeper.io/)

## Install

```
$ npm install @geut/hyperdrive-promise
```

## Usage

`hyperdrive-promise` its totally [API compatible](https://github.com/mafintosh/hyperdrive#api) with hyperdrive v10+. It's only a promise based wrapper.

E.g.:

```javascript
const hyperdrive = require('@geut/hyperdrive-promise')
const archive = hyperdrive('./my-first-hyperdrive') // content will be stored in this folder

try {
await archive.writeFile('/hello.txt', 'world')
const list = await archive.readdir('/')
console.log(list) // prints ['hello.txt']
const data = await archive.readFile('/hello.txt', 'utf-8')
console.log(data) // prints 'world'
} catch (err) {
console.log(err)
// deal with the err
}

```

## Release

`npm version` && `npm publish`

## Contributing

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

## Sponsored By

[
Liberate Science
](https://libscie.org)