GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JYcoding-Blog/node_modules/after at master · zhonghanyong/JYcoding-Blog

Expand file tree

/

after

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

after

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
test
test
 
 
.npmignore
.npmignore
 
 
.travis.yml
.travis.yml
 
 
LICENCE
LICENCE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

README.md

Outline

After Build Status

Invoke callback after n calls

Status: production ready

Example

var after = require("after")
    , next = after(3, logItWorks)

next()
next()
next() // it works

function logItWorks() {
    console.log("it works!")
}

Example with error handling

var after = require("after")
    , next = after(3, logError)

next()
next(new Error("oops")) // logs oops
next() // does nothing

function logError(err) {
    console.log(err)
}

After < 0.6.0

Older versions of after had iterators and flows in them.

These have been replaced with seperate modules

  • iterators
  • composite

Installation

npm install after

Tests

npm test

Blog post

  • Flow control in node.js

Examples :

  • Determining the end of asynchronous operations
  • In javascript what are best practices for executing multiple asynchronous functions
  • JavaScript performance long running tasks
  • Synchronous database queries with node.js

Contributors

  • Raynos

MIT Licenced

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.