Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcoroth/stimulus-parser
Statically analyze Stimulus controllers in your project.
https://github.com/marcoroth/stimulus-parser
hacktoberfest hotwire parser static-analysis stimulus
Last synced: about 2 months ago
JSON representation
Statically analyze Stimulus controllers in your project.
- Host: GitHub
- URL: https://github.com/marcoroth/stimulus-parser
- Owner: marcoroth
- License: mit
- Created: 2023-10-01T14:50:06.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-11T22:14:02.000Z (5 months ago)
- Last Synced: 2024-04-12T10:17:45.842Z (5 months ago)
- Topics: hacktoberfest, hotwire, parser, static-analysis, stimulus
- Language: TypeScript
- Homepage: https://hotwire.io/ecosystem/tooling/stimulus-parser
- Size: 929 KB
- Stars: 26
- Watchers: 1
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
stimulus-parser
## Installation
To add `stimulus-parser` to your project, run the following command in your terminal:
```bash
yarn add stimulus-parser
```## Usage
```js
import { Project } from "stimulus-parser"const project = new Project("/Users/user/path/to/project")
const controllers = project.controllerDefinitions
const controller = controllers[0]console.log(controller.actionNames)
// => ["connect", "click", "disconnect"]console.log(controller.targetNames)
// => ["name", "output"]console.log(controller.classNames)
// => ["loading"]console.log(controller.values)
// => [{ url: { type: "String", default: "" } }]
```## Playground
You can inspect parse results on the hosted playground at https://stimulus-parser.hotwire.io.
## Development
To run the tests:
```bash
yarn install
yarn build
yarn test
```