Registry / testing / fta-cli

fta-cli

JSON →
library3.0.0jsnpmunverified

FTA (Fast TypeScript Analyzer) is a static analysis tool designed for TypeScript and JavaScript code, implemented in Rust for superior performance. It utilizes the SWC parser to efficiently analyze codebases and generate metrics concerning complexity and maintainability. The current stable version is 3.0.0, which features upgraded SWC libraries for enhanced accuracy in operand/operator counting and includes support for modern JavaScript/TypeScript syntax such as `import with`. The project exhibits an active release cadence, with frequent updates and major versions, reflecting continuous development. A key differentiator is its exceptional speed, capable of processing up to 1600 files per second on typical hardware, making it highly suitable for large-scale projects. It provides clear, actionable analytics to help developers identify and address potential maintainability issues.

npm install fta-cli
INSTALL
IMPORT
SIG · FTA-CLI
F
fta-cli
testingjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

FtaAnalysisOptions
import type { FtaAnalysisOptions } from 'fta-cli'
While primarily a CLI, this package ships TypeScript types. `FtaAnalysisOptions` might be used for programmatic configuration when integrating the core logic or interpreting results.
FtaReportEntry
import type { FtaReportEntry } from 'fta-cli'
Represents a single row of the analysis output, containing metrics like line count, FTA score, and assessment. Useful for typing programmatic handling of CLI output.
FtaAssessment
import type { FtaAssessment } from 'fta-cli'
A type representing the assessment category (e.g., 'OK', 'Needs improvement'). For robust type-checking when processing FTA results.
ftaCliCommand
import { ftaCliCommand } from 'fta-cli'
The `fta-cli` package is primarily a command-line interface. There is no direct JavaScript/TypeScript function to import and run its CLI commands programmatically within your code. Instead, use `npx fta-cli` or `child_process.spawn('fta-cli', ...)`.

Demonstrates the basic usage of the `fta-cli` command-line tool to analyze a project directory or specific files.

npx fta-cli ./src --format table --exclude-under 10 # Example of running against a specific file or directory npx fta-cli my-project/index.ts # To analyze your current project directory npx fta-cli .
fta --version
Debug
Known issues
breakingVersion 3.0.0 includes an upgrade to underlying SWC libraries. This results in material changes to how operands and operators are counted, leading to different FTA scores compared to previous versions. It may require recalibrating thresholds or expectations for existing projects.
fix
Review your analysis output and adjust any custom thresholds or baseline expectations for FTA scores to account for the updated calculation methodology.
affects: >=3.0.0
breakingVersion 2.0.0 introduced corrections to the Halstead calculations. This change materially affects the reported Halstead and FTA scores, making direct comparison with results from v1.x inaccurate.
fix
Re-run analysis on your codebase with v2.0.0+ to establish new baselines for Halstead and FTA scores. Do not directly compare scores from v1.x with v2.x or v3.x.
affects: >=2.0.0 <3.0.0
breakingIn v1.0.0, the `include_comments` option's default value changed to `false`, meaning comments are no longer included in scoring by default. Also, the `exclude_under` option was added with a default of `6`, excluding files under 6 lines of code.
fix
If you relied on comments being included in scores or need to analyze very small files, explicitly set `--include-comments true` or `--exclude-under 0` when running the CLI. The `output_limit` option's behavior also changed in v1.0.0, now only affecting `table` format output.
affects: >=1.0.0 <2.0.0
Errors
Common errors & fixes
Error: Command not found: fta-cli
`fta-cli` is not installed globally or `npx` cannot locate it.
fix
Ensure you run `npx fta-cli ...` to execute the package without global installation, or install it globally with `npm install -g fta-cli` if preferred.
Error: The specified path does not exist: /path/to/nonexistent/project
The directory or file path provided to `fta-cli` does not exist on your file system.
fix
Double-check the provided path. Ensure it's an existing directory or file, and that your current working directory is correct if using relative paths.
Failed to parse TypeScript/JavaScript file: Syntax Error...
`fta-cli` encountered modern or non-standard syntax that its underlying SWC parser version does not yet support.
fix
Update `fta-cli` to the latest version. Version 3.0.0 and above significantly improve support for modern syntax due to SWC upgrades. If the issue persists, report it to the `fta-cli` GitHub repository.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
fta-cli — npm install fta-cli · libregistry