Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/geut/hyperdrive-promise
- Owner: geut
- Created: 2019-09-13T21:28:26.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T13:01:00.000Z (over 3 years ago)
- Last Synced: 2024-05-01T21:22:16.542Z (8 months ago)
- Topics: async-await, dat, hyperdrive, p2p
- Language: JavaScript
- Size: 180 KB
- Stars: 15
- Watchers: 6
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
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 foldertry {
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
[
](https://libscie.org)