1.0.2 • Published 3 years ago

call-me-maybe v1.0.2

Weekly downloads
7,449,700
License
MIT
Repository
github
Last release
3 years ago

call-me-maybe Continuous Release

Let your JS API users either give you a callback or receive a promise.

Usage

var maybe = require("call-me-maybe")

module.exports = function asyncFunc (cb) {
  return maybe(cb, new Promise(function(resolve, reject) {
    // ...
  }))
}

API

maybe(cb, promise)

If the callback cb is truthy, returns undefined and will call cb when promise is settled. The parameters passed to cb are standard error-first:

  • If promise is fulfilled, then it is called with the result of the promise: cb(null, result)
  • If promise is rejected, then it is called with the rejection error: cb(err)

If cb is falsey, then promise is returned.

@mrmlnc/readdir-enhanced@iamjoeker/swaggerize-routesvuedragdropuploadimages@kaishuu0123/oas-validator@kaishuu0123/swagger2openapi@jopaw/json-schema-ref-parser-with-used-ref-listbb-chat@frxf/frxf@fundefund/funde_cknoresca-tools-dev444js4cytoscape@saaspe/components@everything-registry/sub-chunk-1287swagger-jsblade-json-schema-ref-parserswagger-jsblade-swagger-parserswagger-harswagger-combineswaggerize-content-type-validated-routesvue-button-test1x-mocksvelte-component-libswagmockswagmock-allofswagmock-specificswagger-parser-kill-circularswagger-parser-xswagger2openapiswagger2openapi-lxwang2vue-compmentuui-json-schema-ref-parser@coboxcoop/drive@coboxcoop/log@coboxcoop/replicator@coboxcoop/repository@coboxcoop/space@coboxcoop/superusers@corestore/networker@bpinternal/json-schema-to-typescript@blkmarketco/components-library@paztis/json-schema-ref-parsergenerator-bootstrap-boilerplate-templatejesusdemojson-schema-ref-parser-altjson-schema-ref-parser-kill-circularjson-schema-id-ref-parserjamuskalimkaba-dat-apikapok-jskappa-drivekappa-drive-mountkappa-scopeslazy-buildchain_diggerswagger-parser-reftychenud7-act2tingzi-vuepressu-libraryusemail@anttiviljami/json-schema-ref-parser@apidevtools/swagger-parser@andrewosh/corestore-migration@aleung/swagger2openapi@basestorex/networker@basestore/networker@bcherny/json-schema-ref-parser@cappasityinc/json-schema-ref-parser@chiaraani/bouncing-ball@abios/abios-redoc@ddatabase/promisifier@ddrive/daemon-client@devorso/dcountdown@dhub/client@dhub/ddriveypt-partverify-img-codevformlmq@fedorif/json-schema-ref-parser@hawkingnetwork/react-native-tab-view@haggholm/json-schema-ref-parser@harsha-jalan/ckeditor5-custom-build@gr2m/json-schema-ref-parser@logoran/swagger-parser@lego-js/tests@mathieudutour/json-schema-ref-parser@marinaga/bananize@nesto-software/json-schema-ref-parser@nandhakumarb/npm_sample@eeston/grpc-caller@meeshkanml/json-schema-ref-parser@mendee/utils@mobicom/openapi-utils@jopaw/json-schema-ref-parser-used-ref-list@jopaw/json-schema-ref-parser-used-ref-paths@jsdevtools/ez-spawn@ikon-x/ckeditor5-custom-build-for-irrosoft@jellywelly/iterare@hieuquang2212/form@hyperspace/client@hyperspace/hyperdrive@react-18-pdf/root
1.0.2

3 years ago

1.0.2-beta.1

3 years ago

1.0.1

10 years ago

1.0.0

10 years ago