Getting started

From an empty folder to a live, reloading web component in about a minute.

Install

banira ships as a single package — a library you import and a banira command-line tool. Install it, or run the CLI without installing via npx.

install
# library + CLI
npm install banira

# or use the CLI without installing
npx banira --help

Scaffold a component

banira init writes a starter vanilla web component — a TypeScript source file (shadow DOM, an observed attribute, an event, and the jsdoc tags banira's tooling reads) plus a demo HTML page wired for the dev server.

scaffold
$ banira init my-button src

Existing files are left untouched unless you pass --force.

The dev loop

banira dev is watch, compile, and serve in one command: edit the source and the browser refreshes. The served root defaults to the output directory.

dev loop
$ banira dev src/my-button.ts -o demo/dist -r demo
Skip the build during development. Add --ts and banira serves TypeScript transpiled on the fly — a request for foo.js falls back to a sibling foo.ts when no compiled file exists.

Smoke-test it

banira test mounts every custom element it finds and asserts the tag registers and upgrades — no per-component test code, and it exits non-zero on failure so it drops straight into CI.

test
$ banira test src/*.ts

Next steps