Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 370 Bytes

util-file.md

File metadata and controls

13 lines (9 loc) · 370 Bytes

Create a Util-file

To avoid leftpad-type dependencies, I almost always create a Util.js class with various static methods that are useful. It prevents me from searching for a package for trivial one-function problems.

module.exports = class Util {

  static async wait(delay) {
    return new Promise(resolve => setTimeout(resolve, delay));
  }

}