
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.
codes-generator-js
Advanced tools
A JavaScript string library that generates batch generated code strings by template rules.
A JavaScript string library that generates batch generated code strings by template rules.
"No. 1:10" -> ["No.01", "No.02", ..., "No.10"]
const CG = require("code-generator-js");
new CG(RULES: string | Array<string|Array<string>>)
new CG("No. 1:10") //short rules
new CG(["No.", ["01", "02", ...,"10"]]) //atoms rules
Fixed: e.g."No.",":","ABC"
Number traversal:
"start:end[:step=1[:fill='0'[:len=MAX_LEN(start,end)]]]"
e.g.
"1:10" -> ["01", "02", ..., "10"]
"1:10:2" -> ["01", "03", ..., "09"]
"1:10:1:" -> ["1", "3", ..., "9"]
"1:10:2:X" -> ["X1", "X3", ..., "X9"]
"1:10:2:X:5" -> ["XXXX1", "XXXX3", ..., "XXXX9"]
Letter traversal:
"start:end"
e.g.
"a:z" -> ["a", "b", ..., "z"]
"A:Z" -> ["A", "B", ..., "Z"]
String List:
e.g.
":xyz" -> ["x", "y", "z"]
":xyz:ABC" -> ["xyz", "ABC"]
Template function:
"::tName=args" -> tFn[tName](args)
e.g.
let tFn={
YYYY:(o)=>"hello"+o
}
cg.addtFn(tFn)
"::YYYY=2022" -> ["hello2022"]
let cg = new CG("No. 1:10");
cg.toGen(); //["No.1", "No.2", ..., "No.10"]]
cg.check("test2022:1"); //true
cg.check("sdfsdf"); //false
let it = cg.iterator();
it.next(); //{value: "No.1", index: 0}
it.next(); //{value: "No.2", index: 1}
FAQs
A JavaScript string library that generates batch generated code strings by template rules.
We found that codes-generator-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
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.