Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Task functions are executed in order of addition, and passed a shared context, and a modifiable data structure. Execution is synchronous. You can exit early by returning a non-null value from a task function.
You can tag task functions, and restrict execution to the subset of task functions with matching tags.
This module is used by the Seneca framework to provide configurable extension hooks.
var Ordu = require('ordu')
var w = Ordu()
w.add(function first (ctxt, data) {
if (null == data.foo) {
return {kind: 'error', why: 'no foo'}
}
data.foo = data.foo.substring(0, ctxt.len)
})
w.add({tags: ['upper']}, function second (ctxt, data) {
data.foo = data.foo.toUpperCase()
})
var ctxt = {len: 3}
var data = {foo: 'green'}
w.process(ctxt, data)
console.log(data.foo) // prints 'GRE' (first, second)
data = {foo: 'blue'}
w.process({tags: ['upper']}, ctxt, data)
console.log(data.foo) // prints 'BLUE' (second)
data = []
var res = w.process(ctxt, data)
console.log(res) // prints {kind: 'error', why: 'no foo', ... introspection ...}
If you're using this library, feel free to contact me on twitter if you have any questions! :) @rjrodger
npm install ordu
From the Irish ordú: instruction. Pronounced or-doo.
Copyright (c) 2014-2016, Seamus D'Arcy and other contributors. Licensed under MIT.
FAQs
Execute functions in a configurable order, modifying a shared data structure.
The npm package ordu receives a total of 7,764 weekly downloads. As such, ordu popularity was classified as popular.
We found that ordu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.