Socket
Socket
Sign inDemoInstall

catering

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

catering

Cater to callback and promise crowds, internally use callbacks.


Version published
Weekly downloads
153K
increased by2.94%
Maintainers
1
Weekly downloads
 
Created
Source

catering

Cater to callback and promise crowds.
Internally use callbacks, because you an old-school chef.

npm status node Travis build status AppVeyor build status Dependency status JavaScript Style Guide

Menu

const catering = require('catering').array

module.exports = function (maybeCallback) {
  const [callback, promise] = catering(maybeCallback)
  fs.readFile('example', callback)
  return promise
}
const catering = require('catering').object

module.exports = function (maybeCallback) {
  const { callback, promise } = catering(maybeCallback)
  fs.readFile('example', callback)
  return promise
}
const catering = require('catering').attach

module.exports = function (maybeCallback) {
  const callback = catering(maybeCallback)
  fs.readFile('example', callback)
  return callback.promise
}

Consume

// Don't force promises on people.
example((err, result) => ..)

// Don't force callbacks on people.
const result = await example()

// Enjoy.
example.then(result => ..)

Install

With npm do:

npm install catering

License

MIT © 2018-present Vincent Weevers. Originally extracted from levelup.

Keywords

FAQs

Package last updated on 01 Sep 2018

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc