util.promisify (1.0.1)
Published 2026-02-24 14:08:08 +00:00 by atheaadmin
Installation
registry=npm install util.promisify@1.0.1"util.promisify": "1.0.1"About this package
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.
Dependencies
Dependencies
| ID | Version |
|---|---|
| define-properties | ^1.1.3 |
| es-abstract | ^1.17.2 |
| has-symbols | ^1.0.1 |
| object.getownpropertydescriptors | ^2.1.0 |
Development Dependencies
| ID | Version |
|---|---|
| @es-shims/api | ^2.1.2 |
| @ljharb/eslint-config | ^15.1.0 |
| auto-changelog | ^1.16.2 |
| eslint | ^6.8.0 |
| safe-publish-latest | ^1.1.4 |
Keywords
promisify
promise
util
polyfill
shim
util.promisify