
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.
macros for javascript
install
npm install lazymacro
require lazymacro in your source code
require('lazymacro');
enjoy the macros:
["I", "am"].WITH(v => v.push("lazynode.")).WITH(console.log).PIPE(v => v.join(" ")).PIPE(v => console.log(`${v}`))?.PIPE(v => console.log("null safety features can be used together!"));
the macros provided in lazymacro
PIPE: O.PIPE(F) returns F(O)
"OK".PIPE(v => v + "!") == "OK!"
WITH: O.WITH(F) runs F(O) and returns O
["O", "K"].WITH(v => v.push("!")).PIPE(v => v.join('')) == 'OK!'
"OK".WITH(v => v + "!") == "OK!"
THEN: O.THEN(F) returns O.then(F)
await Promise.resolve(5).THEN(v => v + 1) === 6
WAIT: O.WAIT(F) awaits O.then(F) returns O
await Promise.resolve(["O", "K"]).WAIT(async v => await new Promise(resolve => setTimeout(() => resolve(v.push("!")), 1000))).THEN(v => v.join('')) == "OK!"
XMAP: O.XMAP(F) returns an array of F(o, k) where o and k are each element of O
["O", "K"].XMAP(v => v.toLowerCase()).PIPE(v => v.join('')) == "ok"
({ o: "O", k: "K" }).XMAP((v, k) => k + v.toLowerCase()).PIPE(v => v.join('')) == "ookk"
LAZY will automatically choose one from PIPE, WITH, THEN and WAIT for you
for O.LAZY(F):
WAITis chosen if O is a Promise and O.then(F) is an empty promiseTHENis chosen if O is a Promise and O.then(F) is not an empty promiseWITHis chosen if O is not a Promise and F(O) is an empty promisePIPEis chosen if O is not a Promise and F(O) is not an empty promiseexample:
["I", "am"].LAZY(v => { v.push("lazynode.") }).LAZY(v => { console.log(v) }).LAZY(v => v.join(" ")).LAZY(v => { console.log(`${v}`) })?.LAZY(v => console.log("null safety features can be used together!"));
same as the related basic macro but use this instead of the function paramter
arrow fuction expressions cannot be used as parameter of this macros because this is lost in arrow function expressions
PIPETHIS
"OK".PIPETHIS(function () { return this.toLowerCase() }) == "ok"
WITHTHIS
["O", "K"].WITHTHIS(function () { this.push("!") }).PIPE(v => v.join('')) == 'OK!'
THENTHIS
await Promise.resolve("OK").THENTHIS(function () { return this.toLowerCase() }) == "ok"
WAITTHIS
await Promise.resolve(["O", "K"]).WAITTHIS(async function () { await new Promise(resolve => setTimeout(resolve, 1000)); this.push("!") }).THEN(v => v.join('')) == "OK!"
XMAPTHIS
["O", "K"].XMAPTHIS(function () { return this.toLowerCase() }).PIPE(v => v.join('')) == "ok"
FAQs
macros for javascript
We found that lazymacro 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.