1.1.10 • Published 6 years ago

x-time v1.1.10

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

x-time

setTimeout() with native promises

Build Status Test Coverage

bitHound Code bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies License: MIT

Installation

npm install x-time --save

Example

const xTime = require('x-time')

xTime(1000, 'one').then(value => {
  console.log(`waited ${value} second`)
})

You can also await the x-time promise:

await xTime(1000)

Import in Typescript

The default import syntax of TypeScript does not work with this module because it exports a function directly. You need to use the following syntax in order to get completions:

import xTime = require('x-time')

Function: xTime(time, value)

  • time <Number> duration of timeout in ms
  • value <any> value to resolve the promise with

Returns a promise that gets resolved to the value when the time has passed.

1.1.10

6 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago