run-series

WebJar for run-series

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

run-series
Last Version

Last Version

1.1.8
Release Date

Release Date

Type

Type

jar
Description

Description

run-series
WebJar for run-series
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/feross/run-series

Download run-series

How to add to project

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

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.

run-series travis npm downloads javascript style guide

Run an array of functions in series

series Sauce Test Status

install

npm install run-series

usage

series(tasks, [callback])

Run the functions in the tasks array in series, each one running once the previous function has completed. If any functions in the series pass an error to its callback, no more functions are run, and callback is immediately called with the value of the error. Otherwise, callback receives an array of results when tasks have completed.

arguments
  • tasks - An array containing functions to run, each function is passed a callback(err, result) which it must call on completion with an error err (which can be null) and an optional result value.
  • callback(err, results) - An optional callback to run once all the functions have completed. This function gets a results array containing all the result arguments passed to the task callbacks.
example
var series = require('run-series')

series([
  function (callback) {
    // do some stuff ...
    callback(null, 'one')
  },
  function (callback) {
    // do some stuff ...
    callback(null, 'two')
  }
],
// optional callback
function (err, results) {
  // the results array will equal ['one','two']
})

This module is basically equavalent to async.series, but it's handy to just have the functions you need instead of the kitchen sink. Modularity! Especially handy if you're serving to the browser and need to reduce your javascript bundle size.

Works great in the browser with browserify!

see also

license

MIT. Copyright (c) Feross Aboukhadijeh.

Versions

Version
1.1.8