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

worksmith

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worksmith - npm Package Compare versions

Comparing version 0.0.18 to 0.0.19

test/workflow-task-resolver-test.js

96

index.js

@@ -10,6 +10,9 @@ var debug = require('debug')('workflow:common')

var taskPath
var resolvers = {};
var workflow = {
use: function(ns, taskLibrary) {
resolvers[ns] = taskLibrary;
},
discoverTaskType: function(taskType) {

@@ -21,3 +24,11 @@ var processRelativePath = path.join(process.cwd(), taskPath, taskType + ".js");

getTaskType: function(taskType) {
if (taskType.indexOf("/") > -1) {
var taskSpec = taskType.split("/");
var ns = taskSpec[0];
if (resolvers[ns]) {
return resolvers[ns](taskSpec[1]);
}
}
var taskFile = taskTypeCache[taskType] || (taskTypeCache[taskType] = workflow.discoverTaskType(taskType))
return require(taskFile);

@@ -202,81 +213,2 @@ },

module.exports = wfLoader;
// var result
// var builders = {
// "[object Array]": function(o) {
// return o.map(function(item) {
// return workflow.readValue(item, object)
// })
// },
// "[object Object]": function(o) {
// var result = {}
// Object.keys(o).forEach(function(key) {
// result[key] = workflow.readValue(key, object)
// })
// return result
// }
// }
// value = (builders[Object.prototype.toString.call(mapDef)] || (function(o) { return o })) (mapDef)
module.exports = wfLoader;
{
"name": "worksmith",
"version": "0.0.18",
"version": "0.0.19",
"description": "A purely functional workflow engine ",

@@ -29,6 +29,8 @@ "main": "index.js",

"lodash": "^3.7.0",
"mocha": "^2.2.5",
"pg": "^4.3.0",
"xregexp": "^2.0.0"
},
"devDependencies": {
"mocha": "^2.2.5"
}
}

@@ -0,0 +0,0 @@ var debug = require('debug')('worksmith:activities:workflow')

@@ -0,0 +0,0 @@ var assert = require('assert')

@@ -0,0 +0,0 @@ var assert = require('assert')

@@ -0,0 +0,0 @@ var assert = require('assert')

@@ -0,0 +0,0 @@ module.exports = {

@@ -238,4 +238,20 @@ # worksmith tutorial

});
```
## Using a task collection module
```javascript
var worksmith = require('worksmith')
worksmith.use("more", require('worksmith_example_module'))
var wf = worksmith({
"task":"more/random",
resultTo: "rnd"
});
wf({},console.log)
```
## How to create a task collection module
Check out an example module [here](https://github.com/PeterAronZentai/worksmith_example_module).
## The `workflow' task type

@@ -242,0 +258,0 @@ You can execute a complete workflow as a task.

Sorry, the diff of this file is not supported yet

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