Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nextjs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs

The fastest async handler in node.js

  • 0.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
decreased by-13.09%
Maintainers
1
Weekly downloads
 
Created
Source

Next

Because asynchronous calls suck out your brain without a proper async handler. This one is just 4 lines yet it solves a huge issue.

Install

	npm install nextjs

How it works?

  1. Create a Next Instance: var next = new Next(2, finish)
  2. Then you call next() as many times as you specified in the count. In this example it is 2.
  3. After next was called 2 times, the finish function will be called.

Example

	// Include
	var Next = require('nextjs');
	
	// CREATE a Next Instance
	var next = new Next(2, finish);
	
	// Log Start
	console.log('start');
	
	// Will happen after 5 seconds passed
	setTimeout(function(){ console.log('A'); next(); }, 5000); 
	
	// Will happen after 2 seconds passed
	setTimeout(function(){ console.log('B'); next(); }, 2000); 
	
	// Will happen in the end after 5 seconds passed
	function finish(){ console.log('finished'); } 
	
	// output result
	// 0 second => start
	// 2 second => B
	// 5 second => A
	// 5 second => finished

Next parameters

  • count: the number of times you will have to call the next() instance. required integer
  • finish: finishing callback required function

Key features

  • It's just 4 lines - 0.16kb
  • Easy to use
  • Its part of dietjs

Keywords

FAQs

Package last updated on 14 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc