
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
behavior-js
Advanced tools

Provide a minimal way to represent a behavior, whether it's allowed and the exceptions to the allowance.
npm install behavior-js
Let
var Behavior = require('behavior-js');
// Whether the behavior is allowed
var politenessAllowed = true;
// The exception to the behavior
var politenessException = 'crude honesty';
Instantiation
var politeness = new Behavior(politenessAllowed,politenessException);
Let
var Behavior = require('behavior-js');
// Whether the behavior is allowed
var leadershipAllowed = true;
// The exceptions to the behavior
var leadershipExceptions = [
'ego',
'superiority'
];
Instantiation
var leadership = new Behavior(leadershipAllowed,leadershipExceptions);
Let
var Behavior = require('behavior-js');
// Whether the behavior is allowed
var agressionAllowed = false;
// The exceptions to the behavior
var agressionExceptions = [
// These are good to have, will be allowed.
'competitiveness',
'power desire'
];
// The initialization
var agression = new Behavior(agressionAllowed,agressionExceptions);
Evaluation with an exempted value
// Returns true
agression.isAllowed('competitiveness');
Evaluation with a non-exempted value
// Returns false
agression.isAllowed('anger');
I have a library that parses url query parameters but I would like to prevent some parameters from getting parsed
var Behavior = require('behavior-js');
// These are the query parameters we want to prevent from getting parsed
var parsingExceptions = [
'onSuccess',
'isNewUser'
];
// We instantiate the behavior, allow it and pass it's exceptions
var parsing = new Behavior(true,parsingExceptions);
// .. somewhere in your awesome query parsing library
queryParser.parseParameter = function(name,value){
if(parsing.isAllowed(name)){
// Do your parsing with complete peace of mind
}
}
All of the tests are written in Jasmine with the BDD process
npm install gulp typescript tslint tsd -g
npm test
FAQs
Simple objects that represent simple behavior
We found that behavior-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
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.