# typescript-ast-explorer

> Command line tool to explore TypeScript projects and SourceFile abstract syntax tree interactively

Latest version **0.0.5** (published 2019-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install typescript-ast-explorer
pnpm add typescript-ast-explorer
yarn add typescript-ast-explorer
bun add typescript-ast-explorer
```

Provides the command `typescript-ast-explorer`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2019-10-06 |
| First published | 2019-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 41.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Sebastian Gurin |
| Maintainers | cancerberosgx |
| Keywords | TypeScript, refactor, command line, interactive |

## Links

- npm: https://www.npmjs.com/package/typescript-ast-explorer
- Repository: https://github.com/cancerberoSgx/typescript-ast-explorer
- Homepage: https://github.com/cancerberoSgx/typescript-ast-explorer#readme
- Issues: https://github.com/cancerberoSgx/typescript-ast-explorer/issues
- npm.io page: https://npm.io/package/typescript-ast-explorer

## Dependencies (8)

- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3
- [accursed](https://npm.io/package/accursed.md) 0.0.7
- [ts-morph](https://npm.io/package/ts-morph.md) ^4.2.0
- [node-keys](https://npm.io/package/node-keys.md) ^0.1.5
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^14.0.0
- [ts-simple-ast-extra](https://npm.io/package/ts-simple-ast-extra.md) ^0.3.15
- [ansi-escape-sequences](https://npm.io/package/ansi-escape-sequences.md) ^4.1.0
- [misc-utils-of-mine-generic](https://npm.io/package/misc-utils-of-mine-generic.md) 0.2.35

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2019-10-06
- 0.0.4 — 2019-10-06
- 0.0.2 — 2019-04-10
- 0.0.1 — 2019-04-10

## README

# typescript-ast-explorer

## Contents

<!-- toc -->

- [Summary](#summary)
- [Install](#install)
- [Usage](#usage)
- [Options](#options)
- [TODO](#todo)

<!-- tocstop -->

## Summary

 * Demo [screen casts](https://cancerberosgx.github.io/demos/typescript-ast-explorer/index.html)
 * Explore a local TypeScript project with an Command Line interactive tool. 
 * Navigate through the AST nodes and source code at same time 
 * See it file structure and the AST nodes inside each file. 
 * JavaScript / TypeScript API for GUI component to select files/folders/nodes interactively (based on blessed/accursed/ts-morph)

## Install 
```
npm install -g typescript-ast-explorer
```

## Usage
```
cd my/typescript/project
typescript-ast-explorer
```

## Options

No options - WIP - it's mostly an interactive tool

## TODO 

 - [ ] --tsConfigPath - to load a ts project other then current folder's
 - [x] use accursed and remove a lots of files. 
 - [ ] API to reuse as AST node selector - project file / folder selector
 - [ ] query elements across the project using CSS-like language (tsquery)
 - [x] filter nodes by kind or name  or query
 - [x] apply refactors interactively
 - [ ] tree expand all - collapse all
 - [x] move the tree to its own file
 - [ ] stateful modal, selections, expansions, etc
 - [ ] show errors except in modals
 - [x] navigate with arrows 2-d instead of tab only (1-d)
 - [x] a general option/menu to hide boxes - or perhaps a halo on them to collapse ?
 - [ ] confirmation before exit
 - [x] move blessed reusable utilities to their own package
 
 * in file view - remove details parent and leave the children only.
 * should we add the code view in the file view?
 * currently, because of custom  .d.ts, the project needs to declare the types in its own ts.config.json
 * file view: expand first folder automatically.
 * when switching from files view to code view it should open in last viewed node and vice versa - auto-expanding the tree

---
_Source: https://npm.io/package/typescript-ast-explorer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
