# stimulus-parser

> Statically analyze Stimulus controllers

Latest version **0.3.2** (published 2026-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install stimulus-parser
pnpm add stimulus-parser
yarn add stimulus-parser
bun add stimulus-parser
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2026-04-07 |
| First published | 2023-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 230.8 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 44 |
| Author | Marco Roth |
| Maintainers | marcoroth |

## Links

- npm: https://www.npmjs.com/package/stimulus-parser
- Repository: https://github.com/marcoroth/stimulus-parser
- Homepage: https://github.com/marcoroth/stimulus-parser#readme
- Issues: https://github.com/marcoroth/stimulus-parser/issues
- npm.io page: https://npm.io/package/stimulus-parser

## Dependencies (7)

- [fs](https://npm.io/package/fs.md) ^0.0.1-security
- [glob](https://npm.io/package/glob.md) ^13.0.0
- [astring](https://npm.io/package/astring.md) ^1.9.0
- [acorn-walk](https://npm.io/package/acorn-walk.md) ^8.3.4
- [@typescript-eslint/visitor-keys](https://npm.io/package/@typescript-eslint/visitor-keys.md) ^8.46.2
- [@hotwired/stimulus-webpack-helpers](https://npm.io/package/@hotwired/stimulus-webpack-helpers.md) ^1.0.1
- [@typescript-eslint/typescript-estree](https://npm.io/package/@typescript-eslint/typescript-estree.md) ^8.46.2

## Recent versions

- 0.3.2 (latest) — 2026-04-07
- 0.3.1 — 2025-10-24
- 0.3.0 — 2025-05-30
- 0.2.2 — 2024-07-21
- 0.2.1 — 2024-07-14
- 0.2.0 — 2024-05-22
- 0.1.6 — 2024-04-25
- 0.1.5 — 2024-04-24
- 0.1.4 — 2024-04-11
- 0.1.3 — 2024-03-02
- 0.1.2 — 2024-03-02
- 0.1.1 — 2024-02-25
- 0.1.0 — 2024-02-25
- 0.0.14 — 2023-11-26
- 0.0.13 — 2023-11-26
- … 12 more at https://npm.io/package/stimulus-parser/versions

## README

<h1 align="center">stimulus-parser</h1>

<p align="center">
  <a href="https://github.com/marcoroth/stimulus-parser">
    <img src="https://github.com/marcoroth/stimulus-parser/actions/workflows/tests.yml/badge.svg">
  </a>
  <a href="https://www.npmjs.com/package/stimulus-parser">
    <img alt="NPM Version" src="https://img.shields.io/npm/v/stimulus-parser?logo=npm&color=38C160">
  </a>
  <a href="https://www.npmjs.com/package/stimulus-parser">
    <img alt="NPM Downloads" src="https://img.shields.io/npm/dm/stimulus-parser?logo=npm&color=38C160">
  </a>
  <a href="https://bundlephobia.com/package/stimulus-parser">
    <img alt="NPM Bundle Size" src="https://img.shields.io/bundlephobia/minzip/stimulus-parser?label=bundle%20size&logo=npm">
  </a>
</p>


## 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")

await project.initialize()

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
```

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