
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.
electre-js
Advanced tools
ELECTRE is a set of multi-criteria decision analysis methods.
If you've never heard of these methods, you can have a look at this document from José Rui FIGUEIRA.
You can use this package in your Node.js and / or web projects.
It uses Workers to calculate results in a separated thread.
Algorithms come from J-Electre.
Only checked methods are implemented at this time, I'll slowly implement the others but tell me if you want to focus on a particular one.
If you want to use this package in its web version and are using a bundler, you'll have to manually copy web workers.
By using copy-webpack-plugin in your app.js:
const CopyWebpackPlugin = require('copy-webpack-plugin')
const path = require('path')
module.exports = {
// ...
afterSpikePlugins: [
new CopyWebpackPlugin([{
from: path.resolve(__dirname, 'node_modules/electre-js/lib/workers'),
to: path.resolve(__dirname, 'public/workers')
}])
]
}
import electre from 'electre-js';
where electre is an object with two methods : start & kill as described bellow.
You can only run one calculation at a time.
Set calculator state to busy (electre._idle = false) and send a message to related worker that will handle calculation. Throws an error if calculator isn't idle.
An object with following properties :
| properties | mandatory | expected in methods | type | rules |
|---|---|---|---|---|
| numberOfCriterias | true | I | number | > 0 |
| numberOfAlternatives | true | I | number | > 1 |
| criterias | true | I | array of strings | size = numberOfCriterias, all values are unique, no undefined |
| weights | true | I | array of numbers | size = size of criterias, no undefined |
| alternatives | true | I | array of strings | size = numberOfAlternatives, all values are unique, no undefined |
| evaluations | true | I | array of arrays of numbers | matrix n * p where n = size of alternatives & p = size of criterias, no undefined |
| cThreshold | true | I | number | 0 < value < 1 |
| dThreshold | true | I | number | 0 < value < 1 |
A promise of an object with following properties :
| properties | type | rules | returned in methods |
|---|---|---|---|
| inputData | object | inputData passed to the worker | I |
| concordance | array of arrays of numbers | square matrix n * n where n = alternatives size | I |
| discordance | array of arrays of numbers | square matrix n * n where n = alternatives size | I |
| credibility | array of arrays of numbers | square matrix n * n where n = alternatives size. Values = 0 or 1 | I |
| kernel | array of strings | partition of alternatives | I |
| dominated | array of strings | partition of alternatives | I |
Ask to terminate busy worker and set calculator state back to idle (electre._idle = true).
Promise returned when electre.start() is rejected.
On electre-www, you can discover electre-js and use ELECTRE methods
Algorithms come from J-Electre.
FAQs
Multi-criteria decision analysis methods written in JS
We found that electre-js 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.