
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
Powerful string interpolation tool library
-Supports positional and dictionary interpolation -Supports multiple error handling mechanisms -Support for null value processing mechanism -Support filter chain processing of input variable values -Support variable prefix suffix -98%+unit test coverage
import {FlexVars} from "flexvars"
const flexvars = new FlexVars({
filters:{
currency:{
args:["prefix","suffix","sign"],
default:{prefix:"USD ",suffix:"",sign:"$"}
next:(value:any,args:Record<string,any>,context:FlexFilterContext)=>{
return `${args.prefix}${args.sign}${value}${args.suffix}`
}
}
}
})
const _ = flexvars.replace
console.log(_("hello {}","flexvars"))
// => hello flexvars
console.log(_("I am {}","tom")).toBe("I am tom")
// => I am tom
console.log(_("{ value | currency}",100)).toBe("USD $100"))
// => USD $100
console.log(_("{ value | currency('RMB','¥','元')}",100)).toBe("RMB ¥100元"))//
// => RMB ¥100元
console.log(_("{ value | currency({prefix:'EUR '',suffix:''',sign:'€'})}",100)).toBe("RMB €100"))
// => EUR €100
flexvars.addFilter({
name:"add",
args:["step"],
default:{step:1},
next(value:any,args:Record<string,any>,context:FlexFilterContext){
return parseInt(value)+args.step
}
})
// call chaining
console.log(_("{ value | add}",100)).toBe("101")
console.log(_("{ value | add|add }",100)).toBe("102")
console.log(_("{ value | add(2)|add(3) }",100)).toBe("105")
console.log(_("{ value | add(2)|add(3)|add(4) }",100)).toBe("109")
FAQs
Powerful string interpolation tool library
The npm package flexvars receives a total of 160 weekly downloads. As such, flexvars popularity was classified as not popular.
We found that flexvars demonstrated a healthy version release cadence and project activity because the last version was released less than 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
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.