Coder Social home page Coder Social logo

handlebars-watch's Introduction

#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 [email protected]
  • Pull requests are welcome.
  • LinkedIn Pofile
  • Stack Overflow Pofile

Bitdeli Badge

handlebars-watch's People

Contributors

bitdeli-chef avatar

Stargazers

Roman avatar

Watchers

Blessan Mathew avatar

Forkers

renjithraj2005

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.