Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
mrules-engine
Advanced tools
A package for generating objects via a set of rules.
npm install mrules-engine
const engine = require('mrules-engine');
const exampleRules1 = [{
pathTo: 'data.name',
pathFor: 'name'
}];
const example1 = engine({ data: { name: 'Name' } }, exampleRules1);
console.log(example1);
> { name: 'Name' };
const engine = require('mrules-engine');
const exampleRules2 = [{
pathTo: 'data.name',
pathFor: 'name'
selectorFn: (name) => `My Name: ${name}`
}];
const example2 = engine({ data: { name: 'Name' } }, exampleRules2);
console.log(example2);
> { name: 'My Name: Name' };
const engine = require('mrules-engine');
const exampleRules3 = [{
pathTo: 'data.nameDoesNotExist',
pathFor: 'name',
fallback: 'Fallback Name'
}];
const example3 = engine({ data: { name: 'Name' } }, exampleRules3);
console.log(example3);
> { name: 'Fallback Name' };
const engine = require('mrules-engine');
const exampleRules4 = [{
pathTo: 'data.nameDoesNotExist',
pathFor: 'name',
selectorFn: (name) => `Your Fallback Name: ${name}`,
fallback: 'Fallback Name'
}];
const example4 = engine({ data: { name: 'Name' } }, exampleRules4);
console.log(example4);
> { name: 'Your Fallback Name: Fallback Name' };
const engine = require('mrules-engine');
const exampleRules5 = [{
pathTo: 'data.name',
pathFor: 'name',
selectorFn: (name) => `Forename: ${name}`
}, {
pathTo: 'data.surname',
pathFor: 'surname',
selectorFn: (name) => `Surname: ${name}`
}];
const example5 = engine({ data: { name: 'Foo', surname: 'Bar' } }, exampleRules5);
console.log(example5);
> { name: 'Forename: Foo', surname: 'Surname: Bar' };
FAQs
A package for generating objects via a set of rules.
The npm package mrules-engine receives a total of 2 weekly downloads. As such, mrules-engine popularity was classified as not popular.
We found that mrules-engine 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
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.