Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.16.212.224
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp /
node_modules /
p-try /
Delete
Unzip
Name
Size
Permission
Date
Action
index.d.ts
1.06
KB
-rw-r--r--
1985-10-26 08:15
index.js
211
B
-rw-r--r--
1985-10-26 08:15
license
1.08
KB
-rw-r--r--
1985-10-26 08:15
package.json
1.61
KB
-rw-r--r--
2021-05-07 15:02
readme.md
1.3
KB
-rw-r--r--
1985-10-26 08:15
Save
Rename
# p-try [](https://travis-ci.org/sindresorhus/p-try) > Start a promise chain [How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) ## Install ``` $ npm install p-try ``` ## Usage ```js const pTry = require('p-try'); (async () => { try { const value = await pTry(() => { return synchronousFunctionThatMightThrow(); }); console.log(value); } catch (error) { console.error(error); } })(); ``` ## API ### pTry(fn, ...arguments) Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. #### fn The function to run to start the promise chain. #### arguments Arguments to pass to `fn`. ## Related - [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome - [More…](https://github.com/sindresorhus/promise-fun) ## License MIT © [Sindre Sorhus](https://sindresorhus.com)