Socket
Socket
Sign inDemoInstall

onedionys-promise-utilities

Package Overview
Dependencies
132
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    onedionys-promise-utilities

One Dionys (Promise Utilities) - A set of utility functions for working with Promise such as all, race, and resolve.


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Welcome to One Dionys - Promise Utilities! 👋

A set of utility functions for working with Promise such as all, race, and resolve. 💖

💾 Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

🎯 How To Use

Example Syntax
const { promiseAll, promiseRace, promiseTimeout } = require('promise-utilities');

const promises = [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)];

// Example of using promiseAll
promiseAll(promises).then(result => {
    console.log('All promises resolved:', result);
});

// Example of using promiseRace
promiseRace(promises).then(result => {
    console.log('First resolved promise:', result);
});

// Example of using promiseTimeout
const timeout = 1000;
promiseTimeout(timeout).then(() => {
    console.log('Timeout reached after', timeout, 'milliseconds');
});
Explanation
  • promiseAll(promises): Resolves all promises in the given array and returns a new promise that resolves with an array of results.
  • promiseRace(promises): Resolves the promise that resolves first in the given array and returns a new promise.
  • promiseTimeout(ms): Creates a promise that resolves after the specified time (in milliseconds).
Return Value
  • promiseAll: Returns a promise that resolves with an array containing the results of all input promises.
  • promiseRace: Returns a promise that resolves with the value of the first input promise to resolve.
  • promiseTimeout: Returns a promise that resolves after the specified timeout.

📆 Release Date

  • v1.0.0 : 07 March 2024
  • v1.0.1 : 11 March 2024
  • v4.0.0 : 11 March 2024
  • v4.0.1 : 13 March 2024
  • v4.0.2 : 18 March 2024
  • v5.0.0 : 31 March 2024

🧑 Author

  • Facebook : Oned Ionys
  • Instagram : @onedionys
  • Twitter : @onedionys
  • LinkedIn : @onedionys

📝 License

  • Copyright © 2024 One Dionys
  • One Dionys - Promise Utilities is an open source project licensed under the MIT license

☕️ Suppport & Donation

Love One Dionys - Promise Utilities? Support this project by donating or sharing with others in need.

Made with ❤️ One Dionys

Keywords

FAQs

Last updated on 31 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc