leafjs-util
Utils for building and testing leafjs library and widget writed using leafjs. Additionally you can test any coffee script with it
Last updated 4 years ago by nstal .
ISC · Original npm · Tarball · package.json
$ cnpm install leafjs-util 
SYNC missed versions from official npm registry.

leafjs-util

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.

install

sudo npm install -g leafjs-util
# or if you already setup PATH to the local modules
# run it without sudo instead

usage

leafjs-tester <path-to-your-script>
# and then visit http://localhost:8000/ to see the mockuped html

help

leafjs-tester -h

example

see example folder for detail.

rules

Every line start with "## " is considered as an inline command, you can using inline commands to make testing faster and easyer.

import css/less

The css will be put to header.

## require ./style.css
## require ./style.less

import js

The js will be put to header.

## require ./lib.js

import coffee

The coffee will be understand by the leafjs-util's rule and expanded and then compiled into js.

## require ./test.coffee

import html into body

html will be import and insert into body as the order you requires it.

## require ./header.html
## require ./body.html
## require ./footer.html

import any file as a local variable

## require ./format.html as formatTemplate
console.log("we import formatTemplate, the value is",formatTemplate)

other static resource

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.

Current Tags

  • 0.3.5                                ...           latest (4 years ago)

20 Versions

  • 0.3.5                                ...           4 years ago
  • 0.3.4                                ...           4 years ago
  • 0.3.3                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.5                                ...           6 years ago
  • 0.1.4                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |