![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/dceprojects.corals.io/node_modules/util.promisify/ |
# 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** ```js const promisify = require('util.promisify'); // Use `promisify` just like the built-in method on `util` ``` **Shim** ```js 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`](https://www.npmjs.com/package/util.promisify-all).