passerror

WebJar for passerror

License

License

BSD 3-Clause
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

passerror
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

passerror
WebJar for passerror
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/papandreou/passerror

Download passerror

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/passerror/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>passerror</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/passerror/
implementation 'org.webjars.npm:passerror:1.1.1'
// https://jarcasting.com/artifacts/org.webjars.npm/passerror/
implementation ("org.webjars.npm:passerror:1.1.1")
'org.webjars.npm:passerror:jar:1.1.1'
<dependency org="org.webjars.npm" name="passerror" rev="1.1.1">
  <artifact name="passerror" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='passerror', version='1.1.1')
)
libraryDependencies += "org.webjars.npm" % "passerror" % "1.1.1"
[org.webjars.npm/passerror "1.1.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.

passError

Handle success and failure with two different callbacks. Lets you get rid of most if (err) return cb(err); constructs.

Example

Send errors reported by fs.readFile straight to cb:

var passError = require('passerror'),
    fs = require('fs');

function getLines(fileName, cb) {
    fs.readFile(fileName, 'utf-8', passError(cb, function (contents) {
        cb(null, contents.split(/\r?\n|\n?\r/));
    }));
}

License

Licensed under a standard 3-clause BSD license -- see the LICENSE-file for details.

Versions

Version
1.1.1