swisstool

1.0.0 • Public • Published

swisstool

Small helper functions needed in every project

asyncFilter

  const items = [1, 2, 3, 4];
  const isEven = n => new Promise(res => res(n % 2 === 0));
  const evenNumbers = await asyncFilter(items, isEven);
  // [2, 4]

wait

const { wait } = require("scraping-toolbox");

// Wait 80ms, plus a random number between 0 and 20 additional milliseconds
await wait(80, 20); 

Readme

Keywords

none

Package Sidebar

Install

npm i swisstool

Weekly Downloads

1

Version

1.0.0

License

GPL-2.0-only

Unpacked Size

20.3 kB

Total Files

8

Last publish

Collaborators

  • luispablo