
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Bare bones Empirical Modelling support for Node.JS, allowing any Javascript value to be established as an observable and Javascript functions to be used to establish a dependency.
To use neden, add it to your package using npm in the normal way:
npm install --save neden
The package has one function that you require in your code:
var eden = require('neden');
This code is intended to be used in the Node.JS REPL for interactive and iterative experimentation.
Declare observables as follows:
var a = eden(1);
var b = eden(true);
var c = eden('hello');
var d = eden([1, 2, 3]);
Each declaration returns a function.
To read the values of observables, call the associated function with no arguments:
a();
# 1
b();
# true
c();
# 'hello'
d();
# [1, 2, 3]
To change the value of an observable, call the association function with a single argument containing the replacement value:
a(2);
# 2
b(false);
# false
c(7);
# 7 - note that the observable changes type
d({ key: 'value'});
# { key : 'value' } - also changes type
Do not declare the variables again as this will orphan the observable and not trigger any changes of dependent values.
Create a new dependency using a function and the observables that it depends upon.
var s = eden((x, y) => x + y, a, c);
Note that you could also do the same assuming with an unbounded argument list:
var t = eden((...x) => x.reduce((y, z) => y + z), a, c);
In both cases, the value returned is a function.
To read the value of an evaluated dependency, call the associated function with no arguments:
s();
# 9
Call the associated function with a replacement function and dependencies:
s(x => x - 1, a);
s();
# 1
To break all dependencies, change s into an observable, perhaps setting the value to null:
s(null);
Observables and definitions have a property called deps which is an object containing a map from the unique internal identifier of any value that depends on this value and the function to call to update the dependent value.
Definitions have a value called dpnd which is an array of all the observables that are depended on. They also have a value called f which is the function to call to update the values.
These values can be inspected in the REPL by typing the function name without calling the function, for example:
a;
# { [Function: ob]
# deps: { '0fdacd4d-9257-42c1-889d-a631507d3172': [Function: fn] },
# dpnd: [],
# f: undefined }
s;
# { [Function: ob]
# deps: {},
# dpnd: [ { [Function: ob] deps: [Object], dpnd: [], fn: undefined } ],
# f: [Function] }
s.f.toString();
# 'x => x - 1'
Neden can be used with Node.JS promises. For example:
var tp = (v, t) => new Promise((f, r) => { setTimeout(() => f(v), t); });
var ta = (...x) => Promise.all(x).then(y => y.reduce((x, y) => x + y));
var a = eden(tp(7, 3000));
var b = eden(tp(42, 8000));
var c = eden(ta, a, b);
c();
# Promise { <pending> }
# Wait 8 seconds
c();
# Promise { 49 }
This is an experimental prototype for research purposes only with no commitment to further development.
FAQs
Empirical Modelling for node.js
The npm package neden receives a total of 1 weekly downloads. As such, neden popularity was classified as not popular.
We found that neden 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.