{"id":25610,"library":"ftst","title":"ftst - Fast TypeScript Transpiler (Type Stripping)","description":"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.","status":"active","version":"1.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/mkslanc/ftst","tags":["javascript"],"install":[{"cmd":"npm install ftst","lang":"bash","label":"npm"},{"cmd":"yarn add ftst","lang":"bash","label":"yarn"},{"cmd":"pnpm add ftst","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The function is exported from 'ftst/transpiler', not from the main 'ftst' package (the main export is a CommonJS module).","wrong":"import ftst from 'ftst'; ftst.transpileModule(...)","symbol":"transpileModule","correct":"import { transpileModule } from 'ftst/transpiler'"},{"note":"The package is ESM-only? Actually, it supports both CJS and ESM. The example uses require, but for ESM use the named import.","wrong":"const { transpile } = require('ftst/transpiler');","symbol":"transpile","correct":"import { transpile } from 'ftst/transpiler'"},{"note":"Enums like ModuleKind and ScriptTarget are exported from 'ftst/transpiler', not from the main module.","wrong":"const { ModuleKind } = require('ftst');","symbol":"ModuleKind","correct":"import { ModuleKind } from 'ftst/transpiler'"},{"note":"Part of the transpiler module alongside ModuleKind.","wrong":"","symbol":"ScriptTarget","correct":"import { ScriptTarget } from 'ftst/transpiler'"}],"quickstart":{"code":"import { transpileModule, ModuleKind, ScriptTarget } from 'ftst/transpiler';\n\nconst source = `\ninterface Person {\n  name: string;\n  age: number;\n}\nfunction greet(person: Person): string {\n  return `Hello, ${person.name}!`;\n}\n`;\n\nconst options = {\n  compilerOptions: {\n    target: ScriptTarget.ES2020,\n    module: ModuleKind.CommonJS,\n    removeComments: false,\n    noEmitHelpers: true,\n    preserveConstEnums: true,\n    noImplicitUseStrict: true,\n    newLine: 'lf',\n    downlevelIteration: true,\n    suppressExcessPropertyErrors: true\n  },\n  reportDiagnostics: true\n};\n\nconst result = transpileModule(source, options, true);\nconsole.log(result.outputText);\n// Expected output: function greet(person) { return 'Hello, ' + person.name + '!'; }","lang":"typescript","description":"Demonstrates using transpileModule to strip types from a TypeScript interface and function, returning clean JavaScript."},"warnings":[{"fix":"Set compilerOptions.target to ScriptTarget.ES2019, ScriptTarget.ES2020, or ScriptTarget.ESNext.","message":"Only ES2019, ES2020, and ESNext script targets are supported. Using other targets may produce incorrect output or errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Import from 'ftst/transpiler' for transpileModule, transpile, and enums.","message":"The main module export (require('ftst')) may not expose the transpile functions directly. Use 'ftst/transpiler' instead.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set remove to true to avoid commented types in output.","message":"The 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.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Test your code thoroughly; consider using full tsc for complex TypeScript features.","message":"No major breaking changes reported; however, the package is minimal and may not handle all TypeScript syntax (e.g., advanced type constructs or decorators).","severity":"breaking","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure you import from 'ftst/transpiler' (not 'ftst/transpile' or 'ftst').","cause":"Typo or incorrect path; correct path is 'ftst/transpiler'.","error":"Cannot find module 'ftst/transpiler'"},{"fix":"Use: import { transpileModule } from 'ftst/transpiler';","cause":"Importing from wrong module (main 'ftst' instead of 'ftst/transpiler') or using default import incorrectly.","error":"TypeError: ftst.transpileModule is not a function"},{"fix":"Set target to one of: ScriptTarget.ES2019, ScriptTarget.ES2020, ScriptTarget.ESNext.","cause":"Setting unsupported script target in compilerOptions.","error":"Unsupported target 'ES5' specified. Only ES2019, ES2020, ESNext are allowed."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}