Socket
Socket
Sign inDemoInstall

hypercore-promisifier

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

.github/workflows/test-node.yml

3

package.json
{
"name": "hypercore-promisifier",
"version": "1.0.1",
"version": "1.0.2",
"description": "A Hypercore wrapper that lets you switch between callback and Promise APIs",

@@ -31,4 +31,5 @@ "main": "index.js",

"dependencies": {
"call-me-maybe": "^1.0.1",
"inspect-custom-symbol": "^1.1.1"
}
}
# hypercore-promisifier
![Test on Node.js](https://github.com/andrewosh/hypercore-promisifier/workflows/Test%20on%20Node.js/badge.svg)
A wrapper that provides conversion to/from callback/promise interfaces in Hypercore and RemoteHypercore.
## Installation
```
npm i hypercore-promisifier
```
## Usage
```js
const hypercore = require('hypercore')
const ram = require('random-access-memory')
const { toPromises } = require('hypercore-promisifier')
const core = hypercore(ram)
// A promisified Hypercore interface
const wrapper = toPromises(core)
```
## API
The API supports two methods, each one returning a compatibilty wrapper around Hypercore.
#### `const { toCallbacks, toPromises } = require('hypercore-promisifier')`
`toCallbacks(core)` takes a Hypercore-like object with a Promises API, and returns a wrapper with a
callbacks interfaced.
`toPromises(core)` takes a Hypercore-like object with a callbacks API, and returns a wrapper with a
Promises interface.
## License
MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc