New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ddatabase/promisifier

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ddatabase/promisifier

A DDatabase wrapper that lets you switch between callback and Promise APIs.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

ddatabase-promisifier

A wrapper that provides conversion to/from callback/promise interfaces in DDatabase and RemoteDDatabase.

Installation

npm i @ddatabase/promisifier

Usage

const ddatabase = require('ddatabase')
const ram = require('random-access-memory')
const { toPromises } = require('@ddatabase/promisifier')

const base = ddatabase(ram)

// A promisified DDatabase interface
const wrapper = toPromises(base)

API

The API supports two methods, each one returning a compatibilty wrapper around DDatabase.

const { toCallbacks, toPromises, unwrap } = require('@ddatabase/promisifier')

toCallbacks(base) takes a DDatabase-like object with a Promises API, and returns a wrapper with a callbacks interfaced.

toPromises(base) takes a DDatabase-like object with a callbacks API, and returns a wrapper with a Promises interface.

unwrap(base) takes either a wrapper object, or a normal DDatabase, and returns a normal (callbacks API) DDatabase.

License

MIT

Keywords

ddatabase

FAQs

Package last updated on 12 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts