
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.
@kubb/parser-ts
Advanced tools
TypeScript and TSX source file parser for Kubb. Converts AST nodes and raw TypeScript code into formatted source strings using the TypeScript compiler API.
Converts AST nodes and raw TypeScript code into formatted source strings using the TypeScript compiler API. Handles both .ts and .tsx output.
bun add @kubb/parser-ts
# or
pnpm add @kubb/parser-ts
# or
npm install @kubb/parser-ts
import { defineConfig } from 'kubb'
import { parserTs, parserTsx } from '@kubb/parser-ts'
export default defineConfig({
input: { path: './petstore.yaml' },
output: { path: './src/gen' },
parsers: [parserTs, parserTsx],
})
To render compiler AST nodes to source text from inside a plugin, call print on the parser instance:
import { parserTs } from '@kubb/parser-ts'
import ts from 'typescript'
const source = parserTs.print(
ts.factory.createVariableStatement(
[ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],
ts.factory.createVariableDeclarationList(
[ts.factory.createVariableDeclaration('hello', undefined, undefined, ts.factory.createStringLiteral('world'))],
ts.NodeFlags.Const,
),
),
)
// → export const hello = 'world'
parserTsParser instance for .ts and .js files. Pass to defineConfig({ parsers: [...] }) to emit TypeScript source files.
parserTs.parse(file, options?) — serialize a FileNode to TypeScript source.parserTs.print(...nodes) — convert TypeScript compiler Node instances to a formatted source string.parserTsxParser instance for .tsx and .jsx files. Same API as parserTs with JSX support.
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
FAQs
TypeScript and TSX source file parser for Kubb. Converts AST nodes and raw TypeScript code into formatted source strings using the TypeScript compiler API.
The npm package @kubb/parser-ts receives a total of 39,526 weekly downloads. As such, @kubb/parser-ts popularity was classified as popular.
We found that @kubb/parser-ts 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.