Skip to content

flarebyte/baldrick-whisker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

baldrick-whisker

npm Build status npm bundle size

npm type definitions node-current NPM

Experimental

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.

Hero image for baldrick-whisker

Highlights:

CLI Examples

Merge JSON + Elm to YAML:

npx baldrick-whisker object report/out.yaml package.json
pest-spec/fixtures/Example.elm

Render Handlebars template:

npx baldrick-whisker render report/out.yaml pest-spec/fixtures/example.hbs
report/rendered.md

Show diff instead of writing:

npx baldrick-whisker render --diff report/out.yaml
pest-spec/fixtures/example.hbs report/rendered.md

Drop extension on destination:

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

Related

Installation

This package is ESM only.

yarn global add baldrick-whisker
baldrick-whisker --help

Or alternatively run it:

npx baldrick-whisker --help

If you want to tun the latest version from github. Mostly useful for dev:

git clone git@github.com:flarebyte/baldrick-whisker.git
yarn global add `pwd`

About

Code generator for Elm and Typescript using templates

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published