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

procedure

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

procedure - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

8

package.json
{
"name": "procedure",
"description": "Simple JS async develpoment, easy error handling, chained results, declarative way.",
"version": "0.3.3",
"version": "0.3.4",
"author": {

@@ -15,9 +15,9 @@ "name": "Javier Gallego Martín",

],
"homepage": "https://github.com/bifuer/procedure",
"homepage": "https://github.com/pillarsjs/procedure",
"repository": {
"type": "git",
"url": "git://github.com/bifuer/procedure"
"url": "git://github.com/pillarsjs/procedure"
},
"bugs": {
"url": "https://github.com/bifuer/procedure/issues",
"url": "https://github.com/pillarsjs/procedure/issues",
"email" : "cheloq@gmail.com"

@@ -24,0 +24,0 @@ },

@@ -1,1 +0,42 @@

# Procedure
# Procedure
Simple JS async development.
```javascript
function fileLoader(path,done){ // File loader simulation.
console.log("Opening file:'"+path+"'...");
if(path==='./secundary2.key'){
//throw new Error("Ops!"); // Error simulation
}
done.result({file:path}); // Finalize task & return result
}
var shared = {}; // Shared closure
var procedure = new Procedure(); // Create procedure
procedure
.add("Load primary",fileLoader,'./primary.key') // Add new task
.add("Load secundary",fileLoader,'./secundary.key') // Add new task
.add("Load shared",fileLoader,'./shared.key') // Add new task
.race() // Resolve tasks in race mode
.add(function(files,done){ // Add new task
shared.files1 = files;
console.log(shared);
done(); // Finalize task
})
.queue() // Resolve tasks in queue mode
.add("Load primary",fileLoader,'./primary2.key') // Add new task
.add("Load secundary",fileLoader,'./secundary2.key') // Add new task
.add("Load shared",fileLoader,'./shared2.key') // Add new task
.race() // Resolve tasks in race mode
.add(function(files,done){ // Add new task
shared.files2 = files;
console.log(shared);
done.result(shared); // Finalize task & return result
})
.launch(function(errors){ // Procedure controller.
if(errors){ // Array of Errors || undefined
console.log("END[ERROR]",arguments);
} else {
console.log("END[OK]",arguments);
}
})
;
```
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