sleep-synchronously
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -8,3 +8,3 @@ /** | ||
``` | ||
import sleepSynchronously = require('sleep-synchronously'); | ||
import sleepSynchronously from 'sleep-synchronously'; | ||
@@ -20,4 +20,2 @@ console.log(new Date()); | ||
*/ | ||
declare function sleepSynchronously(milliseconds: number): void; | ||
export = sleepSynchronously; | ||
export default function sleepSynchronously(milliseconds: number): void; |
@@ -1,5 +0,3 @@ | ||
'use strict'; | ||
module.exports = milliseconds => { | ||
export default function sleepSynchronously(milliseconds) { | ||
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, milliseconds); | ||
}; | ||
} |
{ | ||
"name": "sleep-synchronously", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Block the main thread for a given amount of time", | ||
@@ -13,4 +13,6 @@ "license": "MIT", | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12" | ||
}, | ||
@@ -39,8 +41,8 @@ "scripts": { | ||
"devDependencies": { | ||
"ava": "^2.4.0", | ||
"in-range": "^2.0.0", | ||
"time-span": "^4.0.0", | ||
"tsd": "^0.13.1", | ||
"xo": "^0.33.0" | ||
"ava": "^3.15.0", | ||
"in-range": "^3.0.0", | ||
"time-span": "^5.0.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.38.2" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# sleep-synchronously [![Build Status](https://travis-ci.com/sindresorhus/sleep-synchronously.svg?branch=master)](https://travis-ci.com/github/sindresorhus/sleep-synchronously) | ||
# sleep-synchronously | ||
@@ -9,3 +9,3 @@ > Block the main thread for a given amount of time | ||
This package is better than many other similar packages as it's not a native Node.js addon, but instead uses modern JavaScript features. | ||
This package is better than many other similar packages as it's not a native Node.js addon, but instead uses modern JavaScript features. It does not work in the browser. | ||
@@ -21,3 +21,3 @@ ## Install | ||
```js | ||
const sleepSynchronously = require('sleep-synchronously'); | ||
import sleepSynchronously from 'sleep-synchronously'; | ||
@@ -24,0 +24,0 @@ console.log(new Date()); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
3980
17