Registry / serialization / ftst
library1.2.2jsnpmunverified

ftst (v1.2.2) is a minimal TypeScript transpiler that removes type annotations from TypeScript files, leaving readable JavaScript where the output is line-by-line equivalent to the input. This eliminates the need for source maps during debugging. It supports only ES2019, ES2020, and ESNext script targets, and offers a command-line runner (node -r ftst filename.ts) as well as JS API functions transpileModule and transpile. Compared to tsc or other transpilers, ftst focuses solely on type stripping without full compilation, making it extremely fast and suitable for quick type removal tasks or debugging scenarios. It is dependency-free and works in Node.js environments.

npm install ftst
INSTALL
IMPORT
SIG · FTST
F
ftst
serializationjavascriptv1.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transpileModule
import { transpileModule } from 'ftst/transpiler'
import ftst from 'ftst'; ftst.transpileModule(...)
The function is exported from 'ftst/transpiler', not from the main 'ftst' package (the main export is a CommonJS module).
transpile
import { transpile } from 'ftst/transpiler'
const { transpile } = require('ftst/transpiler');
The package is ESM-only? Actually, it supports both CJS and ESM. The example uses require, but for ESM use the named import.
ModuleKind
import { ModuleKind } from 'ftst/transpiler'
const { ModuleKind } = require('ftst');
Enums like ModuleKind and ScriptTarget are exported from 'ftst/transpiler', not from the main module.
ScriptTarget
import { ScriptTarget } from 'ftst/transpiler'
Part of the transpiler module alongside ModuleKind.

Demonstrates using transpileModule to strip types from a TypeScript interface and function, returning clean JavaScript.

import { transpileModule, ModuleKind, ScriptTarget } from 'ftst/transpiler'; const source = ` interface Person { name: string; age: number; } function greet(person: Person): string { return `Hello, ${person.name}!`; } `; const options = { compilerOptions: { target: ScriptTarget.ES2020, module: ModuleKind.CommonJS, removeComments: false, noEmitHelpers: true, preserveConstEnums: true, noImplicitUseStrict: true, newLine: 'lf', downlevelIteration: true, suppressExcessPropertyErrors: true }, reportDiagnostics: true }; const result = transpileModule(source, options, true); console.log(result.outputText); // Expected output: function greet(person) { return 'Hello, ' + person.name + '!'; }
ftst --version
Debug
Known issues
gotchaOnly ES2019, ES2020, and ESNext script targets are supported. Using other targets may produce incorrect output or errors.
fix
Set compilerOptions.target to ScriptTarget.ES2019, ScriptTarget.ES2020, or ScriptTarget.ESNext.
affects: >=0.0.0
gotchaThe main module export (require('ftst')) may not expose the transpile functions directly. Use 'ftst/transpiler' instead.
fix
Import from 'ftst/transpiler' for transpileModule, transpile, and enums.
affects: >=0.0.0
gotchaThe remove parameter in transpileModule affects whether types are commented out or fully removed. When true, types are stripped entirely; when false, they are replaced with comments.
fix
Set remove to true to avoid commented types in output.
affects: >=0.0.0
breakingNo major breaking changes reported; however, the package is minimal and may not handle all TypeScript syntax (e.g., advanced type constructs or decorators).
fix
Test your code thoroughly; consider using full tsc for complex TypeScript features.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'ftst/transpiler'
Typo or incorrect path; correct path is 'ftst/transpiler'.
fix
Ensure you import from 'ftst/transpiler' (not 'ftst/transpile' or 'ftst').
TypeError: ftst.transpileModule is not a function
Importing from wrong module (main 'ftst' instead of 'ftst/transpiler') or using default import incorrectly.
fix
Use: import { transpileModule } from 'ftst/transpiler';
Unsupported target 'ES5' specified. Only ES2019, ES2020, ESNext are allowed.
Setting unsupported script target in compilerOptions.
fix
Set target to one of: ScriptTarget.ES2019, ScriptTarget.ES2020, ScriptTarget.ESNext.
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
ftst — npm install ftst · libregistry