Permalink
Browse files

Added package.json and fixed benchmark

  • Loading branch information...
1 parent e6f4c62 commit ece1bc8d5e1f2baada77d9afaef1ee8d677a6d65 @brandonbloom brandonbloom committed Jul 27, 2011
Showing with 21 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +2 −2 README.md
  3. +5 −5 benchmark.coffee
  4. +1 −0 lib/ck.coffee
  5. +12 −0 package.json
View
@@ -0,0 +1 @@
+node_modules
View
@@ -19,13 +19,13 @@ a smaller, faster [coffeekup](https://github.com/mauricemach/coffeekup)
compileFile:
template = ck.compileFile './template.coffee'
- html = ck.render template, context: user: {}
+ html = template context: user: {}
console.log html
correctly handle booleans:
template = -> input autocomplete: off
- console.log ck.render ck.compile template #<input>
+ console.log ck.compile(template)() #<input>
console.log coffeekup.render template #<input autocomplete="false" />
IE conditionals:
View
@@ -1,4 +1,4 @@
-ck = require 'ck'
+ck = require './lib/ck'
coffeekup = require 'coffeekup'
template = ->
@@ -33,7 +33,7 @@ benchmark = (name, fn) ->
console.log "#{name}: #{end - start}ms"
exports =
- benchmark 'ck', -> ck.render ck_template, { context }
- benchmark 'ck (format)', -> ck.render ck_template, { context, format: true }
- benchmark 'coffeekup', -> coffeekup_template { context }
- benchmark 'coffeekup (format)', -> coffeekup_template { context, format: true }
+ benchmark 'ck', -> ck_template context: context
+ benchmark 'ck (format)', -> ck_template context: context, format: true
+ benchmark 'coffeekup', -> coffeekup_template context: context
+ benchmark 'coffeekup (format)', -> coffeekup_template context: context, format: true
View
@@ -89,6 +89,7 @@ for tag in tagsSelfClosing
@compileFile = (path) ->
code = fs.readFileSync path, 'utf8'
@compile code
+
@compile = (code) ->
code =
if typeof code is 'function'
View
@@ -0,0 +1,12 @@
+{
+ "name": "ck",
+ "description": "A smaller, faster Coffeekup.",
+ "version": "0.0.1",
+ "dependencies": {
+ "coffee-script": ">= 1.1.1"
+ },
+ "devDependencies": {
+ "coffeekup": ">= 0.2.3"
+ },
+ "engines": {"node": ">= 0.4.7"}
+}

0 comments on commit ece1bc8

Please sign in to comment.