Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
A seriously functional
workflow library, that lets you build composable and configurable process definitions for various reasons.
npm i worksmith --save
For a step by step tutorial click here
##Worksmith activities / task types
Worksmith comes with an extensible task library built up from the core
and the extension modules
.
group | activities | description |
---|
sequence
, parallel
and warezSequence
log
,sql/pg
map
, regex
, set
code
activity , create custom task types by creating files in the tasks foldername | description |
---|---|
worksmith_salesforce | Interact with salesforce in a workflow |
worksmith_etcd | Use network based locking via etcd service |
coming | soon |
worksmith_postgres | Execute SQL statements as part of the workflow, supports transactions |
worksmith_assert | An assertion library to be used conventional workflows or workflows built for testing |
worksmith_fs | Read/write files from a workflow |
if(err) return next(err)
This can be in a config file, or as part of your js code as a variable.
{ "task": "sequence",
"items": [
{
task:"log", message:"hello workflow"
},
{
task: "map",
">insertParams": ["@req.params.id", 1, 1]
},
{
task:"sql/pg",
connection: "@connection",
command: "insert into order (order_id, version, type) \
values ($1, $2, $3) returning id",
params: "@insertParams",
resultTo: "insertResult"
},
{...}
]
}
var worksmith = require('worksmith')
var workflow = worksmith('./workflow.json')
var context = {
connection:"postgres://login:pw@host/db",
other:"data"
}
workflow(context, function(err, result) {
console.log("workflow completed, %", context.insertResult)
})
worksmith lets you build your activities on a super easy way
Place the following code as "hello-world.js"
in the tasks
folder
var utils = require('worksmith')
module.exports = function (node) {
//use the node variable to access workflow params
return function(context) {
//use the context to access workflow execution state
return function(done) {
//set done when your acitivity finished its job
//read and write data from the context
console.log("Hello world", context.get(node.inParam))
context.set("myresult","myvalue")
done();
}
}
}
Now you can use it the same way as the core activities
var wf = workflow( {"task":"hello-world", "inParam":"some thing"} );
var ctx = {"some":"value"};
wf(ctx, function(err) {
console.log(ctx)
})
Write a log to the console
message
Waits a bit
duration
Like the name suggests
table data connection resultTo
Execute sub tasks in parallel
items array
Execute sub tasks in sequence
items array
Define a sequence on a patching compatible way
items array
Set variable on the workflow context
name value
FAQs
A purely functional workflow engine
The npm package worksmith receives a total of 15 weekly downloads. As such, worksmith popularity was classified as not popular.
We found that worksmith demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.