hw

handlebars-watch

A node module that executes Handlebars precompiler commands whenever a change happens in the watched directories.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

0

Maintenance

Last Commit

8yrs ago

Contributors

1

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

#handlebars-watch

A node package that executes Handlebars precompiler commands whenever a change happens in the watched directories.

There are a couple of node packages that does the same thing and even more, but I noticed that most of them are implementing there own precompiler for Handlebars. I just wanted to use the existing Handlebars precompiler and trigger it by watching a folder structure.

Installation

The package may be installed via npm using the npm install -g handlebars-watch command.

Usage

Options:
  -c, --config     Path to Config File   [string]

In CLI

handlebars-watch -c ../build/hbw-config.json

May need to use 'sudo' along with the command in the linux and mac OS.

Inside a node file

var hbw = require('handlebars-watch');
hbw.watchAndCompile('../build/hbw-config.json');

The config file is a simple json array and is required for this package. Each item in the array is a combination of a path and command. The path is the location of the folder to watch and command is the command to execute when the watch is triggered.

Eg.

[{
  "path": "templates/pages/",
  "command": "handlebars templates/pages>pageTemplates.js -a -e html"
},{
  "path": "templates/partials/",
  "command": "handlebars templates/partials>partialTemplates.js -a -p -e html"
}]
  1. The path should be relative to the location of the config file.
  2. Install Handlebars as a global package.

##Issues Or Contributions

  • If you have an idea to improve the package, let me know. It will help the community.
  • If this helped you, spread the word and don't forget to star the repo.
  • Post issues in the github issue tracker.
  • My email is blessenm@gmail.com
  • Pull requests are welcome.
  • LinkedIn Pofile
  • Stack Overflow Pofile

Bitdeli Badge

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial