Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    exercise-bikepublic

    Exercise Bike

    A CLI wrapper around handlebars

    Why nobody else ever wanted to do this I don't know

    Usage:

    $ exercise-bike 
    Exercise-Bike: A CLI wrapper around handlebars
    
      https://github.com/wycats/handlebars.js/
    
    Usage: exercise-bike --foo bar --baz quux [input-file] [output-file]
    
    All arguments other than input-file and output-file are passed to
    handlebars as "context properties." To read one of the properties
    from a file, preface the value with a "@" a la curl. To read it
    from stdin, put ":stdin:" up there instead. NOTE THAT THIS IS
    MUTUALLY EXCLUSIVE WITH READING THE TEMPLATE FROM STDIN.
    
    Without file arguments, exercise-bike defaults to reading/writing
    to/from stdio. In this case, exercise-bike times out after 2 seconds
    if nothing is ever written to stdin. Hopefully that isn't raining
    on your parade.
    
    
    $ cat input.handlebars 
    <h1>{{title}}</h1>
    <p>{{message}}</p>
    $ cat ./input.handlebars | exercise-bike --title "hello" --message "world" > output.html
    $ cat output.html 
    <h1>hello</h1>
    <p>world</p>
    

    Here's an example from irl that I'm using to generate a static page from one of my projects' READMEs:

    $ marked README.md | exercise-bike --readme :stdin: ./templates/index.handlebars ./public/index.html
    

    License

    WTFPL

    install

    npm i exercise-bike

    Downloadsweekly downloads

    5

    version

    0.0.1

    license

    WTFPL

    last publish

    collaborators

    • avatar
    • avatar