You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

promisified

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promisified

This is a simple module to save you from manually calling `util.promisify`.

0.5.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Promisified Node.js

This is a simple module to save you from manually calling util.promisify.

For every Node.js module that contains async functions, there is an equivalent module in promisified where those functions have been promisified using util.promisify.

const fs = require('promisified/fs');

async function main() {
  const data = await fs.readFile('data.txt', 'utf8');
}

main().catch(e => {
  console.error(e);
  process.exit(1);
});

Note that in some cases there are already promisified versions built into Node.js itself, such as fs.promises, also available as require('fs/promises') in Node.js v14. This package does not use those; it always uses util.promisify.

FAQs

Package last updated on 23 Apr 2020

Did you know?

Socket

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