https://github.com/flarebyte/baldrick-whisker
Code generator for Elm and Typescript using templates
https://github.com/flarebyte/baldrick-whisker
handlebars npm-cli template-engine
Last synced: 8 months ago
JSON representation
Code generator for Elm and Typescript using templates
- Host: GitHub
- URL: https://github.com/flarebyte/baldrick-whisker
- Owner: flarebyte
- License: mit
- Created: 2022-05-27T07:55:12.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-28T13:23:18.000Z (9 months ago)
- Last Synced: 2025-09-28T13:24:30.845Z (9 months ago)
- Topics: handlebars, npm-cli, template-engine
- Language: TypeScript
- Homepage:
- Size: 343 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# baldrick-whisker
 





> Code generator for Elm and Typescript using templates
Code generator for Elm and Typescript using templates
baldrick-whisker is an ESM-only CLI that reads JSON, YAML, CSV and Elm
sources, merges them into a single object, and renders Handlebars templates
for Elm/Markdown/JSON/YAML outputs. Ships with rich helpers and supports
GitHub file URIs. Requires Node.js >= 22.

Highlights:
## CLI Examples
Merge JSON + Elm to YAML:
```bash
npx baldrick-whisker object report/out.yaml package.json
pest-spec/fixtures/Example.elm
```
Render Handlebars template:
```bash
npx baldrick-whisker render report/out.yaml pest-spec/fixtures/example.hbs
report/rendered.md
```
Show diff instead of writing:
```bash
npx baldrick-whisker render --diff report/out.yaml
pest-spec/fixtures/example.hbs report/rendered.md
```
Drop extension on destination:
```bash
npx baldrick-whisker object --no-ext report/out.json package.json
```
## Quickstart
Install globally or run with npx, then try the object and render commands.
1. yarn global add baldrick-whisker
2. baldrick-whisker --help
3. npx baldrick-whisker object out.yaml a.json b.yaml
spec/fixtures/Example.elm
4. npx baldrick-whisker render out.yaml pest-spec/fixtures/example.hbs
rendered.md
```
```
## Configuration
Config files:
- \`\`:
- \`\`:
## Architecture
- file-io reads/writes files, compiles Handlebars, and registers helpers.
- merge-objects normalizes InputContent and merges
primitives/objects/arrays.
- handlebars-helpers provides ifSatisfy, listJoin and string
transformers.
- cli wiring via Commander exposes object and render commands.
## FAQ
Q: How do I point whisker to a custom config file?
A: Set BALDRICK\_WHISKER\_CONFIG to the YAML file location. The loader will use
it instead of the default \~/.baldrick-whisker/config.yaml.
## Troubleshooting
- →
- →
- →
- →
## Documentation and links
- [Code Maintenance :wrench:](MAINTENANCE.md)
- [Code Of Conduct](CODE_OF_CONDUCT.md)
- [Api for baldrick-whisker](API.md)
- [Contributing :busts\_in\_silhouette: :construction:](CONTRIBUTING.md)
- [Diagram for the code base :triangular\_ruler:](INTERNAL.md)
- [Vocabulary used in the code base :book:](CODE_VOCABULARY.md)
- [Architectural Decision Records :memo:](DECISIONS.md)
- [Contributors
:busts\_in\_silhouette:](https://github.com/flarebyte/baldrick-whisker/graphs/contributors)
- [Dependencies](https://github.com/flarebyte/baldrick-whisker/network/dependencies)
- [Glossary
:book:](https://github.com/flarebyte/overview/blob/main/GLOSSARY.md)
- [Software engineering principles
:gem:](https://github.com/flarebyte/overview/blob/main/PRINCIPLES.md)
- [Overview of Flarebyte.com ecosystem
:factory:](https://github.com/flarebyte/overview)
- [Usage](USAGE.md)
- [API](API.md)
- [Code Maintenance](MAINTENANCE.md)
- [Contributing](CONTRIBUTING.md)
- [Glossary](GLOSSARY.md)
- [Vocabulary](CODE_VOCABULARY.md)
- [Design](INTERNAL.md)
- [ADR](DECISIONS.md)
## Related
## Installation
This package is [ESM
only](https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77).
```bash
yarn global add baldrick-whisker
baldrick-whisker --help
```
Or alternatively run it:
```bash
npx baldrick-whisker --help
```
If you want to tun the latest version from github. Mostly useful for dev:
```bash
git clone git@github.com:flarebyte/baldrick-whisker.git
yarn global add `pwd`
```