Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bscotch/utility

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bscotch/utility - npm Package Compare versions

Comparing version 0.5.2 to 0.6.0

6

build/lib/wait.d.ts

@@ -1,3 +0,5 @@

export declare function waitForMillis(millis: number): Promise<unknown>;
export declare function waitForSeconds(seconds: number): Promise<unknown>;
/** Get a promise that resolves in some number of milliseconds. */
export declare function resolveInMillis(millis: number): Promise<unknown>;
/** Get a promise that resolves in some number of seconds. */
export declare function resolveInSeconds(seconds: number): Promise<unknown>;
//# sourceMappingURL=wait.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.waitForSeconds = exports.waitForMillis = void 0;
function waitForMillis(millis) {
exports.resolveInSeconds = exports.resolveInMillis = void 0;
/** Get a promise that resolves in some number of milliseconds. */
function resolveInMillis(millis) {
return new Promise(res => setTimeout(res, millis));
}
exports.waitForMillis = waitForMillis;
function waitForSeconds(seconds) {
return waitForMillis(seconds * 1000);
exports.resolveInMillis = resolveInMillis;
/** Get a promise that resolves in some number of seconds. */
function resolveInSeconds(seconds) {
return resolveInMillis(seconds * 1000);
}
exports.waitForSeconds = waitForSeconds;
exports.resolveInSeconds = resolveInSeconds;
//# sourceMappingURL=wait.js.map

@@ -0,1 +1,10 @@

# [0.6.0](https://github.com/bscotch/node-util/compare/v0.5.2...v0.6.0) (2020-11-11)
### Features
* Rename wait methods to 'resolveInSeconds' etc to be more explicit about what's happening. ([df5c6ab](https://github.com/bscotch/node-util/commit/df5c6abd41c4c60587e26d4a8e9f3fde04c67cea))
## [0.5.2](https://github.com/bscotch/node-util/compare/v0.5.1...v0.5.2) (2020-11-11)

@@ -2,0 +11,0 @@

{
"name": "@bscotch/utility",
"version": "0.5.2",
"version": "0.6.0",
"description": "Bscotch Utilities: Methods for common Node.js needs.",

@@ -5,0 +5,0 @@ "engines": {

@@ -126,1 +126,17 @@ # Bscotch Utilities

```
## Waits
```ts
import {
resolveInMillis,
resolveInSeconds,
} from '@bscotch/utility';
async myAsynFunction(){
// Wait for 1 second
await resolveInMillis(1000);
// Wait for 1 second
await resolveInSeconds(1);
}
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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