p-finally

WebJar for p-finally

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

p-finally
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

p-finally
WebJar for p-finally
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/p-finally

Download p-finally

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/p-finally/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>p-finally</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/p-finally/
implementation 'org.webjars.npm:p-finally:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/p-finally/
implementation ("org.webjars.npm:p-finally:2.0.1")
'org.webjars.npm:p-finally:jar:2.0.1'
<dependency org="org.webjars.npm" name="p-finally" rev="2.0.1">
  <artifact name="p-finally" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='p-finally', version='2.0.1')
)
libraryDependencies += "org.webjars.npm" % "p-finally" % "2.0.1"
[org.webjars.npm/p-finally "2.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

p-finally

Promise#finally() ponyfill - Invoked when the promise is settled regardless of outcome

Useful for cleanup.

Install

$ npm install p-finally

Usage

const pFinally = require('p-finally');

const directory = createTempDirectory();

(async () => {
	await pFinally(write(directory), () => {
		cleanup(directory);
	});
});

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 - Promise.try() ponyfill - Starts a promise chain
  • More…

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
2.0.1
1.0.0