
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.
node-select
Advanced tools
Select is syntactic sugar to help maintain a functional approach to assigning to variables.
Select is syntactic sugar to help maintain a functional approach to assigning to variables. It lets you avoid reassigning, so you can keep things const-y, if you're into that sort of thing. 🤷🏽
Please don't look at the source code, as it's embarassingly small. This is a grower, not a shower, ok?
Lets say you have something like this.
let o = null;
if (someCondition) {
o = someConstructorMaybe();
} else if (someOtherCondition) {
o = somethingElse;
}
Maybe you, like me, don't really like the look of that snippet, and would prefer it if you could assign directly to o with a single statement, and keep it as a const. You could do something like this instead:
const o = (() => {
if (someCondition) {
return someConstructorMaybe();
} else if (someOtherCondition) {
return somethingElse;
} else {
return null;
}
})();
Good old self-invocing function pattern. Well, if you're still not quite happy, you can use select. Like this:
const o = select(criteriaObject, (criteria) => {
if (criteria.someCondition) {
return someConstructorMaybe();
} else if (criteria.someOtherCondition) {
return somethingElse;
} else {
return null;
}
});
In my future, ECMAScript will support this syntax:
const o = select (criteriaObject) {
if (this.someCondition) {
return someConstructorMaybe();
} else if (this.someOtherCondition) {
return somethingElse;
} else {
return null;
}
}
One can always dream...
FAQs
Select is syntactic sugar to help maintain a functional approach to assigning to variables.
We found that node-select 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.