Tabnine Logo For Javascript
util.promisify
Code IndexAdd Tabnine to your IDE (free)

How to use util.promisify

Best JavaScript code snippets using util.promisify(Showing top 4 results out of 315)

origin: netlify/zip-it-and-ship-it

const unzipFile = async function({ path }) {
 const zip = new AdmZip(path)
 const pExtractAll = promisify(zip.extractAllToAsync.bind(zip))
 await pExtractAll(`${path}/..`, false)
}
origin: netlify/zip-it-and-ship-it

// End zipping files
const endZip = async function(archive, output) {
 archive.finalize()
 await pEndOfStream(output)
}
origin: delvedor/rinvoke

promisify(function fire (opts, cb) {
 assert(typeof opts.procedure === 'string', 'Procedure must be a string')
 cb = cb || noop

 if (!this.isReady) {
  debug('client not ready yet, wait for connect')
  this.once('connect', () => {
   debug('fire', opts)
   this._client.fire(opts, cb)
  })
  return
 }

 debug('fire', opts)
 this._client.fire(opts, cb)
})
origin: delvedor/rinvoke

promisify(function invoke (opts, cb) {
 assert(typeof opts.procedure === 'string', 'Procedure must be a string')

 if (!this.isReady) {
  debug('client not ready yet, wait for connect')
  this.once('connect', () => {
   debug('invoke', opts)
   this._client.request(opts, cb)
  })
  return
 }

 debug('invoke', opts)
 this._client.request(opts, cb)
})
util.promisify(npm)

JSDoc

Polyfill/shim for util.promisify in node versions < v8

Most used util.promisify functions

  • promisify
  • pEndOfStream

Popular in JavaScript

  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • ms
    Tiny millisecond conversion utility
  • express
    Fast, unopinionated, minimalist web framework
  • js-yaml
    YAML 1.2 parser and serializer
  • async
    Higher-order functions and common patterns for asynchronous code
  • commander
    the complete solution for node.js command-line programs
  • chalk
    Terminal string styling done right
  • request
    Simplified HTTP request client.
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now