This repository was archived by the owner on Jun 2, 2026. It is now read-only.
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
ts-index - a fast typescript artifact index
1) Introduction
2) Usage
3) Emacs Integration
4) Test
5) License
------------------------------------------------------------------------
Introduction
ts-index parses typescript files in a given directory and prints
global functions, classes, etc. in a lisp format to stdout.
The intention is to be able to locate global typescript
artifacts. This could be used to go to a declaration within emacs or
generate imports.
The ts-index stdout output looks for example like this:
("+" "/path/to/some/file.ts" "function" "f" nil 12)
("+" "/path/to/some/file.ts" "class" "MyClass" t 35)
("-" "/path/to/some/file.ts")
Lists starting with a "+" indicate that global artifacts got
added. "-" indicates that all artifacts for a certain typescript file
should be discarded.
The second column is the file name of the affected typescript file.
The fourth item in the lists is a flag if the artifact is exported.
The sixth item is the byte position in the file where the name of the
global artifact starts. The first byte in the file has the position 0.
ts-index watches the file system for changes and reflects the changes
via stdout.
------------------------------------------------------------------------
Usage
$ npm install
$ node . path/to/my/ts/workspace
------------------------------------------------------------------------
Emacs Integration
emacs/ts-index.el contains a emacs integration for jumping to global
artifacts.
There are some dependencies before usage:
- helm
- elpy-project-root or find-file-in-project
The most interesting ts-index emacs function is ts-index-find.
ts-index-find will only work if the ts-index-watch-cmd variable is
configured properly. Check out the variable's documentation.
------------------------------------------------------------------------
Test
$ npm run test
------------------------------------------------------------------------
License
See file COPYING.