New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

everytask

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

everytask

<img src="https://img.shields.io/badge/license-MIT-blue.sv

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

:package: :sparkles: Everytask

npm version Everytask is released under the MIT license.

The API for sheduling tasks with the event loop is very counter intuitive. It's sometimes hard to choose between Promise.resolve().then(), setTimeout() and queueMicrotask(). Don't get me started with the differences between node and the browser.

This library aims to provide a clear isomorphic API to schdelule tasks without having to deal with all the nuances.

Installation

yarn add everytask

Usage

import * as tasks from 'everytask';

tasks.task(() => console.log('called fourth'));
tasks.microtask(() => console.log('called third'));
tasks.macrotask(() => console.log('called second'));
tasks.synchonouse(() => console.log('called first'));

Tests

The package is 100% tested on node as well as on safari, firefox and chrome ( using jest the awesome playwright package ).

In order to reproduce the tests type the command below:

yarn build & yarn test

Credit

  • This package is heavility inspired from the HTTP 204 video below. While writing the package I found out that there where some errors in the video that are fixed in this package. (Source: https://www.youtube.com/watch?v=8eHInw9_U8k)

FAQs

Package last updated on 24 Feb 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc