Collection of self-written stuff
- promisify.js - exports my own implementation of
require("util").promisify
function from Node.js.
const fs = require("fs");
const promisify = require("promisify");
const readFile = promisify(fs.readFile);
// HelloWorld.txt contains "Hello, world!"
readFile("HelloWorld.txt", "utf8").then((data) => {
console.log(data); // prints "Hello, world!"
});