A handy util for easy testing UI components written in coffee inside browser environment. With a given coffee script, it will mockup an temporary html and import all you needs and make them available at http://localhost:8000/ by default. Currently only support and tested under linux and darwin.
sudo npm install -g leafjs-util
# or if you already setup PATH to the local modules
# run it without sudo instead
leafjs-tester <path-to-your-script>
# and then visit http://localhost:8000/ to see the mockuped html
leafjs-tester -h
see example forlder for detail
Every line start with "## " is considered as an inline command, you can using inline commands to make testing faster and easyer
The css will be put to header
## require ./style.css
## require ./style.less
The js will be put to header
## require ./lib.js
The coffee will be understand by the leafjs-util's rule and expanded and then compiled into js.
## require ./test.coffee
html will be import and insert into body as the order you requires it.
## require ./header.html
## require ./body.html
## require ./footer.html
## require ./format.html as formatTemplate
console.log("we import formatTemplate, the value is",formatTemplate)
Any file inside the working directory you call the command will be available as long as it's name not conflict with the imported file's base name. Say ./example.json will be available at http://localhost:8000/example.json.