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: 6 days 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-07T01:45:33.000Z (14 days ago)
- Last Synced: 2025-01-07T19:11:39.915Z (14 days ago)
- Topics: hacktoberfest, hotwire, parser, static-analysis, stimulus
- Language: TypeScript
- Homepage: https://hotwire.io/ecosystem/tooling/stimulus-parser
- Size: 1.44 MB
- Stars: 35
- Watchers: 1
- Forks: 7
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-hotwire - stimulus-parser - A simple parser for Stimulus values. (**Awesome Hotwire** [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) / Stimulus)
- awesome-hotwire - stimulus-parser - A simple parser for Stimulus values. (**Awesome Hotwire** [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) / Stimulus)
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
```