https://github.com/fakorede/js-state
JavaScript static code analysis using the Babel parser
https://github.com/fakorede/js-state
Last synced: about 2 months ago
JSON representation
JavaScript static code analysis using the Babel parser
- Host: GitHub
- URL: https://github.com/fakorede/js-state
- Owner: Fakorede
- Created: 2023-09-03T20:20:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-03T21:25:26.000Z (almost 2 years ago)
- Last Synced: 2025-04-22T23:16:27.892Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-state
js-state is a static analysis tool that runs through a given snippet of code and logs the state variables. It uses the [babel parser](https://babeljs.io/docs/babel-parser) to build an Abstract Syntax Tree (AST) and traverses through it using the [visitor pattern](https://en.wikipedia.org/wiki/Visitor_pattern).
# setup
```
git clone https://github.com/Fakorede/js-state.git
cd js-state
npm install
npm start
```# limitations
It currently supports only js and jsx code. Futher work would involve the following:
- convert it to a node package so it can be installed and used in javascript projects
- make it flexible so that once installed as a node package, it can scan through js files and identify the state in those files as opposed to hard coding.
- make it highly customizable so it can support different javascript frameworks (ex the ast for vue.js is completely different from that of jsx)
- add support for state management tools such as redux, vuex etc.