Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ts-creator
Advanced tools
A code generator to generate TypeScript code generator from TypeScript code
If you want to write a TypeScript codegen.
You got TypeScript code:
function foo(bar: number): number {
return bar + 1
}
ts-creator generate TypeScript factory from given code to:
ts.updateSourceFileNode(
ts.createSourceFile('test.ts', '', ts.ScriptTarget.Latest),
[
ts.createFunctionDeclaration(
undefined,
undefined,
undefined,
ts.createIdentifier('foo'),
undefined,
[
ts.createParameter(
undefined,
undefined,
undefined,
ts.createIdentifier('bar'),
undefined,
ts.createToken(ts.SyntaxKind.NumberKeyword),
undefined
)
],
ts.createToken(ts.SyntaxKind.NumberKeyword),
ts.createBlock(
[
ts.createReturn(
ts.createBinary(
ts.createIdentifier('bar'),
ts.createToken(ts.SyntaxKind.PlusToken),
ts.createNumericLiteral('1')
)
)
],
true
)
)
]
)
Result after run the generated factory code:
function foo(bar: number): number {
return bar + 1;
}
import creator from 'ts-creator'
const generatedFactoryCode = creator(`const foo = "your code here"`)
FAQs
A code generator to generate TypeScript code generator from TypeScript code
The npm package ts-creator receives a total of 11 weekly downloads. As such, ts-creator popularity was classified as not popular.
We found that ts-creator 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.