@jrc03c/pause 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +17 -0
- package/package.json +16 -0
package/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function pause(ms) {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
try {
|
|
4
|
+
return setTimeout(() => resolve(), ms)
|
|
5
|
+
} catch (e) {
|
|
6
|
+
return reject(e)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (typeof module !== "undefined") {
|
|
12
|
+
module.exports = pause
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof window !== "undefined") {
|
|
16
|
+
window.pause = pause
|
|
17
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jrc03c/pause",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "a simple async pause function",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"pub": "npm version patch --force && npm publish --access=public"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"pause",
|
|
11
|
+
"js",
|
|
12
|
+
"settimeout"
|
|
13
|
+
],
|
|
14
|
+
"author": "jrc03c",
|
|
15
|
+
"license": "ISC"
|
|
16
|
+
}
|