Socket
Socket
Sign inDemoInstall

util.promisify

Package Overview
Dependencies
68
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    util.promisify

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


Version published
Weekly downloads
11M
decreased by-2.01%
Maintainers
1
Install size
1.24 MB
Created
Weekly downloads
 

Changelog

Source

v1.0.1 - 2020-01-16

Fixed

Commits

  • [Tests] use shared travis-ci configs f1b5e43
  • [Tests] up to node v10.0, v9.11, v8.11, v6.14, 4.9; use nvm install-latest-npm; pin included builds to LTS e89390f
  • [meta] add auto-changelog fe8e751
  • [Tests] up to node v11.0, v10.12, v8.12 e09b894
  • [Refactor] use callBound helper from es-abstract for robustness baa0cf6
  • [actions] add automatic rebasing / merge commit blocking 24912f4
  • [Docs] Add usage information for the shim/monkey-patch 38b1ee5
  • [Refactor] use __proto__ instead of ES6’s Object.setPrototypeOf 02ec7e2
  • [meta] create FUNDING.yml 076b8b5
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest 4cedaa9
  • Adds usage information to the README ddb4556
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest 95362c0
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, eslint fd79a58
  • [Dev Deps] update eslint, @ljharb/eslint-config 2cf792b
  • [Docs] Link to util.promisify-all 032ff5c
  • [Tests] allow node 0.10 and 0.8 to fail again c2f8418
  • [Tests] remove mistakenly added travis jobs 13a242f
  • [Tests] on node v10.1 8244578
  • [meta] add funding field e1645ca
  • [New] add auto entry point 2c48047
  • [Fix] use has-symbols package to ensure we support Symbol shams too. 75135c8
  • [Deps] update es-abstract 32aa5cc
  • [Dev Deps] update eslint c3043e6
  • [Deps] update object.getownpropertydescriptors 521ed25
  • [Deps] update has-symbol 16d91ec
  • [Deps] update define-properties 532915e
  • [Tests] npm v5+ breaks on node < v4 0647c63

Readme

Source

util.promisify

Polyfill for util.promisify in node versions < v8

node v8.0.0 added support for a built-in util.promisify: https://github.com/nodejs/node/pull/12442/

This package provides the built-in util.promisify in node v8.0.0 and later, and a replacement in other environments.

Usage

Direct

const promisify = require('util.promisify');
// Use `promisify` just like the built-in method on `util`

Shim

require('util.promisify/shim')();
// `util.promisify` is now defined
const util = require('util');
// Use `util.promisify`

Note: this package requires a native ES5 environment, and for Promise to be globally available. It will throw upon requiring it if these are not present.

Promisifying modules

If you want to promisify a whole module, like the fs module, you can use util.promisify-all.

Keywords

FAQs

Last updated on 16 Jan 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc