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

promise-delay

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-delay - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

8

index.js

@@ -1,5 +0,4 @@

try {
// optional dependency on polyfill-promise
global.Promise = global.Promise || require('polyfill-promise')
} finally {}
if (!global.Promise) {
throw new Error('No Promise found, please install `polyfill-promise`')
}

@@ -12,5 +11,4 @@ function promiseDelay (delay, val) {

})
}
module.exports = promiseDelay
{
"name": "promise-delay",
"author": "jden <jason@denizac.org>",
"version": "1.0.1",
"version": "2.0.0",
"engines": {
"node": ">=0.12"
},
"description": "like Promise.cast with a delay in milliseconds",

@@ -13,2 +16,3 @@ "keywords": [

"scripts": {
"pretest": "standard",
"test": "mochi"

@@ -19,8 +23,6 @@ },

"readmeFilename": "README.md",
"optionalDependencies": {
"polyfill-promise": "~4.0.1"
},
"devDependencies": {
"mochi": "0.3.0"
"mochi": "0.3.0",
"standard": "^6.0.7"
}
}
# promise-delay
like Promise.cast with a delay in milliseconds
[![Circle CI](https://circleci.com/gh/jden/node-promise-delay.svg?style=svg)](https://circleci.com/gh/jden/node-promise-delay)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
**Note**: For node 0.10 support, use promise-delay@1.x to include [polyfill-promise](http://npm.im/polyfill-promise)
## usage

@@ -5,0 +11,0 @@ ```js

@@ -1,11 +0,11 @@

var mochi = require('mochi')
/* globals describe, it */
var expect = require('mochi').expect
describe('promise-delay', function () {
var promiseDelay = require('../')
it('delays a promise', function (end) {
var start = Date.now()
promiseDelay(100, Promise.cast(10))
promiseDelay(100, Promise.resolve(10))
.then(function (val) {

@@ -15,3 +15,3 @@ val.should.equal(10)

elapsed.should.be.within(90, 110)
expect(elapsed).to.be.within(90, 110)
})

@@ -22,10 +22,8 @@ .then(end, end)

it('casts', function (end) {
promiseDelay(10, 'hi')
.then(function (val) {
val.should.equal('hi')
expect(val).to.equal('hi')
})
.then(end, end)
})
})
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