To add stimulus-parser
to your project, run the following command in your terminal:
yarn add stimulus-parser
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.methods)
// => ["connect", "click", "disconnect"]
console.log(controller.targets)
// => ["name", "output"]
console.log(controller.classes)
// => ["loading"]
console.log(controller.values)
// => [{ url: { type: "String", default: "" } }]
To run the tests:
yarn install
yarn build
yarn test