liquid-node
Advanced tools
Comparing version 1.1.0 to 1.2.0
# LiquidNode Change History | ||
## 1.2.0 | ||
- API: Some standard filters might now return `Promise`s. | ||
- ADDED: Ranges `(0..5)`/`(0..foo)` are now supported. | ||
- FIX: `{% if foo is blank/empty %}` didn't work. | ||
- FIX: `context.hasKey` didn't work. | ||
- FIX: Tokenizer now removes all empty tokens. | ||
- CHANGE: `comment` now inherits from `raw` so that inner tags are ignored. | ||
- FIX: `isnt` wasn't the opposite of `is`. | ||
- FIX: `FilterNotFound` was never raised. | ||
- FIX: Unterminated variables `{{ foo` would raise a useless error. | ||
- FIX: `truncate` filter had an off-by-1 error. | ||
- FIX: `raw` tag didn't work. | ||
## 1.1.0 | ||
@@ -4,0 +18,0 @@ |
@@ -35,2 +35,6 @@ // Generated by CoffeeScript 1.7.1 | ||
Liquid.Range = require("./liquid/range"); | ||
Liquid.Iterable = require("./liquid/iterable"); | ||
Liquid.Drop = require("./liquid/drop"); | ||
@@ -37,0 +41,0 @@ |
@@ -8,15 +8,2 @@ // Generated by CoffeeScript 1.7.1 | ||
Liquid.log = function() { | ||
var e; | ||
if (typeof debug === "undefined" || debug === null) { | ||
return; | ||
} | ||
try { | ||
return console.log.apply(console, arguments); | ||
} catch (_error) { | ||
e = _error; | ||
return console.log("Failed to log. %s", e); | ||
} | ||
}; | ||
Liquid.FilterSeparator = /\|/; | ||
@@ -23,0 +10,0 @@ |
@@ -49,15 +49,13 @@ // Generated by CoffeeScript 1.7.1 | ||
}; | ||
})(this))["catch"]((function(_this) { | ||
return function(e) { | ||
e.message = "" + e.message + "\n at " + token.value + " (" + token.filename + ":" + token.line + ":" + token.col + ")"; | ||
if (e.location == null) { | ||
e.location = { | ||
col: token.col, | ||
line: token.line, | ||
filename: token.filename | ||
}; | ||
} | ||
throw e; | ||
}; | ||
})(this)).then((function(_this) { | ||
})(this))["catch"](function(e) { | ||
e.message = "" + e.message + "\n at " + token.value + " (" + token.filename + ":" + token.line + ":" + token.col + ")"; | ||
if (e.location == null) { | ||
e.location = { | ||
col: token.col, | ||
line: token.line, | ||
filename: token.filename | ||
}; | ||
} | ||
throw e; | ||
}).then((function(_this) { | ||
return function() { | ||
@@ -100,11 +98,8 @@ return _this.parse(tokens); | ||
Block.prototype.unknownTag = function(tag, params, tokens) { | ||
switch (tag) { | ||
case 'else': | ||
throw new Liquid.SyntaxError("" + (this.blockName()) + " tag does not expect else tag"); | ||
break; | ||
case 'end': | ||
throw new Liquid.SyntaxError("'end' is not a valid delimiter for " + (this.blockName()) + " tags. use " + (this.blockDelimiter())); | ||
break; | ||
default: | ||
throw new Liquid.SyntaxError("Unknown tag '" + tag + "'"); | ||
if (tag === 'else') { | ||
throw new Liquid.SyntaxError("" + (this.blockName()) + " tag does not expect else tag"); | ||
} else if (tag === 'end') { | ||
throw new Liquid.SyntaxError("'end' is not a valid delimiter for " + (this.blockName()) + " tags. use " + (this.blockDelimiter())); | ||
} else { | ||
throw new Liquid.SyntaxError("Unknown tag '" + tag + "'"); | ||
} | ||
@@ -127,3 +122,3 @@ }; | ||
} | ||
throw new Liquid.SyntaxError("Variable '" + token.value + "' was not properly terminated with regexp: " + Liquid.Block.VariableEnd.inspect); | ||
throw new Liquid.SyntaxError("Variable '" + token.value + "' was not properly terminated with regexp: " + Liquid.VariableEnd.inspect); | ||
}; | ||
@@ -130,0 +125,0 @@ |
@@ -10,2 +10,4 @@ // Generated by CoffeeScript 1.7.1 | ||
module.exports = Condition = (function() { | ||
var LITERALS; | ||
Condition.operators = { | ||
@@ -25,3 +27,3 @@ '==': function(cond, left, right) { | ||
'isnt': function(cond, left, right) { | ||
return cond.equalVariables(left, right); | ||
return !cond.equalVariables(left, right); | ||
}, | ||
@@ -88,18 +90,30 @@ '<': function(cond, left, right) { | ||
Condition.prototype.attach = function(attachment) { | ||
this.attachment = attachment; | ||
return attachment; | ||
return this.attachment = attachment; | ||
}; | ||
Condition.prototype["else"] = function() { | ||
return false; | ||
Condition.prototype.equalVariables = function(left, right) { | ||
if (typeof left === "function") { | ||
return left(right); | ||
} else if (typeof right === "function") { | ||
return right(left); | ||
} else { | ||
return left === right; | ||
} | ||
}; | ||
Condition.prototype.inspect = function() { | ||
var operands; | ||
operands = [this.left, this.operator, this.right].join(' '); | ||
return "<Condition [" + operands + "], attachment: " + this.attachment + ">"; | ||
LITERALS = { | ||
empty: function(v) { | ||
return !((v != null ? v.length : void 0) > 0); | ||
}, | ||
blank: function(v) { | ||
return !v || v.toString().length === 0; | ||
} | ||
}; | ||
Condition.prototype.equalVariables = function(left, right) { | ||
return left === right; | ||
Condition.prototype.resolveVariable = function(v, context) { | ||
if (v in LITERALS) { | ||
return Promise.cast(LITERALS[v]); | ||
} else { | ||
return context.get(v); | ||
} | ||
}; | ||
@@ -110,3 +124,3 @@ | ||
if (op == null) { | ||
return context.get(left); | ||
return this.resolveVariable(left, context); | ||
} | ||
@@ -117,4 +131,4 @@ operation = Condition.operators[op]; | ||
} | ||
left = context.get(left); | ||
right = context.get(right); | ||
left = this.resolveVariable(left, context); | ||
right = this.resolveVariable(right, context); | ||
return Promise.join(left, right).spread((function(_this) { | ||
@@ -121,0 +135,0 @@ return function(left, right) { |
@@ -36,20 +36,14 @@ // Generated by CoffeeScript 1.7.1 | ||
Context.prototype.registerFilters = function() { | ||
var filters; | ||
var filter, filters, k, v, _i, _len; | ||
filters = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
return filters.forEach((function(_this) { | ||
return function(filter) { | ||
var k, v, _results; | ||
_results = []; | ||
for (k in filter) { | ||
if (!__hasProp.call(filter, k)) continue; | ||
v = filter[k]; | ||
if (v instanceof Function) { | ||
_results.push(_this.strainer[k] = v); | ||
} else { | ||
_results.push(void 0); | ||
} | ||
for (_i = 0, _len = filters.length; _i < _len; _i++) { | ||
filter = filters[_i]; | ||
for (k in filter) { | ||
if (!__hasProp.call(filter, k)) continue; | ||
v = filter[k]; | ||
if (v instanceof Function) { | ||
this.strainer[k] = v; | ||
} | ||
return _results; | ||
}; | ||
})(this)); | ||
} | ||
} | ||
}; | ||
@@ -77,3 +71,3 @@ | ||
available = Object.keys(this.strainer); | ||
throw new Error("Unknown method `" + methodName + "`, available: [" + (available.join(', ')) + "]"); | ||
throw new Liquid.FilterNotFound("Unknown filter `" + methodName + "`, available: [" + (available.join(', ')) + "]"); | ||
} | ||
@@ -86,3 +80,2 @@ }; | ||
} | ||
Liquid.log("SCOPE PUSH"); | ||
this.scopes.unshift(newScope); | ||
@@ -109,3 +102,2 @@ if (this.scopes.length > 100) { | ||
Context.prototype.pop = function() { | ||
Liquid.log("SCOPE POP"); | ||
if (this.scopes.length <= 1) { | ||
@@ -155,3 +147,2 @@ throw new Error("ContextError"); | ||
Context.prototype.set = function(key, value) { | ||
Liquid.log("[SET] %s %j", key, value); | ||
return this.scopes[0][key] = value; | ||
@@ -161,10 +152,9 @@ }; | ||
Context.prototype.get = function(key) { | ||
var value; | ||
value = this.resolve(key); | ||
Liquid.log("[GET] %s %j", key, value); | ||
return value; | ||
return this.resolve(key); | ||
}; | ||
Context.prototype.hasKey = function(key) { | ||
return !!this.resolve(key); | ||
return Promise.cast(this.resolve(key)).then(function(v) { | ||
return v != null; | ||
}); | ||
}; | ||
@@ -177,9 +167,3 @@ | ||
'true': true, | ||
'false': false, | ||
'empty': function(v) { | ||
return !((v != null ? v.length : void 0) > 0); | ||
}, | ||
'blank': function(v) { | ||
return !v || v.toString().length === 0; | ||
} | ||
'false': false | ||
}; | ||
@@ -198,5 +182,12 @@ | ||
} else if (match = /^\((\S+)\.\.(\S+)\)$/.exec(key)) { | ||
lo = Number(resolve(match[1])); | ||
hi = Number(resolve(match[2])); | ||
throw new Error("Ranges are not supported."); | ||
lo = this.resolve(match[1]); | ||
hi = this.resolve(match[2]); | ||
return Promise.join(lo, hi).spread(function(lo, hi) { | ||
lo = Number(lo); | ||
hi = Number(hi); | ||
if (isNaN(lo) || isNaN(hi)) { | ||
return []; | ||
} | ||
return new Liquid.Range(lo, hi + 1); | ||
}); | ||
} else if (match = /^(\d[\d\.]+)$/.exec(key)) { | ||
@@ -291,2 +282,4 @@ return Number(match[1]); | ||
default: | ||
/* @covignore */ | ||
throw new Error("Unknown special accessor: " + part); | ||
@@ -293,0 +286,0 @@ } |
@@ -16,6 +16,2 @@ // Generated by CoffeeScript 1.7.1 | ||
ElseCondition.prototype["else"] = function() { | ||
return true; | ||
}; | ||
ElseCondition.prototype.evaluate = function() { | ||
@@ -22,0 +18,0 @@ return true; |
@@ -48,12 +48,2 @@ // Generated by CoffeeScript 1.7.1 | ||
return result; | ||
}, | ||
functionName: function(f) { | ||
var _ref; | ||
if (f.__name__) { | ||
return f.__name__; | ||
} | ||
if (f.name) { | ||
return f.name; | ||
} | ||
return (_ref = f.toString().match(/\W*function\s+([\w\$]+)\(/)) != null ? _ref[1] : void 0; | ||
} | ||
@@ -60,0 +50,0 @@ }; |
// Generated by CoffeeScript 1.7.1 | ||
(function() { | ||
var HTML_ESCAPE, HTML_ESCAPE_ONCE_REGEXP, HTML_ESCAPE_REGEXP, isNumber, isString, strftime, toArray, toDate, toNumber, toObjectString, toString; | ||
var HTML_ESCAPE, HTML_ESCAPE_ONCE_REGEXP, HTML_ESCAPE_REGEXP, Iterable, Promise, isNumber, isString, strftime, toArray, toDate, toIterable, toNumber, toObjectString, toString; | ||
strftime = require("strftime"); | ||
Promise = require("bluebird"); | ||
Iterable = require("./iterable"); | ||
toNumber = function(input) { | ||
@@ -41,2 +45,6 @@ return Number(input); | ||
toIterable = function(input) { | ||
return Iterable.cast(input); | ||
}; | ||
toDate = function(input) { | ||
@@ -114,24 +122,31 @@ if (input == null) { | ||
sort: function(input, property) { | ||
if (property != null) { | ||
return toArray(input).sort(function(a, b) { | ||
var aValue, bValue, _ref, _ref1; | ||
aValue = a[property]; | ||
bValue = b[property]; | ||
return (_ref = aValue > bValue) != null ? _ref : { | ||
1: (_ref1 = aValue === bValue) != null ? _ref1 : { | ||
if (property == null) { | ||
return toIterable(input).sort(); | ||
} | ||
return toIterable(input).map(function(item) { | ||
return Promise.cast(item != null ? item[property] : void 0).then(function(key) { | ||
return { | ||
key: key, | ||
item: item | ||
}; | ||
}); | ||
}).then(function(array) { | ||
return array.sort(function(a, b) { | ||
var _ref, _ref1; | ||
return (_ref = a.key > b.key) != null ? _ref : { | ||
1: (_ref1 = a.key === b.key) != null ? _ref1 : { | ||
0: -1 | ||
} | ||
}; | ||
}).map(function(a) { | ||
return a.item; | ||
}); | ||
} else { | ||
return toArray(input).sort(); | ||
} | ||
}); | ||
}, | ||
map: function(input, property) { | ||
return toArray(input).map(function(e) { | ||
if (property != null) { | ||
return e[property]; | ||
} else { | ||
return e; | ||
} | ||
if (property == null) { | ||
return input; | ||
} | ||
return toIterable(input).map(function(e) { | ||
return e != null ? e[property] : void 0; | ||
}); | ||
@@ -182,8 +197,2 @@ }, | ||
truncateString = toString(truncateString); | ||
if (input == null) { | ||
return; | ||
} | ||
if (!input.slice) { | ||
return; | ||
} | ||
length = toNumber(length); | ||
@@ -195,3 +204,3 @@ l = length - truncateString.length; | ||
if (input.length > length) { | ||
return input.slice(0, +l + 1 || 9e9) + truncateString; | ||
return input.slice(0, l) + truncateString; | ||
} else { | ||
@@ -202,3 +211,3 @@ return input; | ||
truncatewords: function(input, words, truncateString) { | ||
var l, wordlist; | ||
var wordlist; | ||
if (words == null) { | ||
@@ -211,16 +220,6 @@ words = 15; | ||
input = toString(input); | ||
if (input == null) { | ||
return; | ||
} | ||
if (!input.slice) { | ||
return; | ||
} | ||
wordlist = input.split(" "); | ||
words = toNumber(words); | ||
l = words - 1; | ||
if (l < 0) { | ||
l = 0; | ||
} | ||
if (wordlist.length > l) { | ||
return wordlist.slice(0, +l + 1 || 9e9).join(" ") + truncateString; | ||
words = Math.max(1, toNumber(words)); | ||
if (wordlist.length > words) { | ||
return wordlist.slice(0, words).join(" ") + truncateString; | ||
} else { | ||
@@ -238,3 +237,5 @@ return input; | ||
flatten: function(input) { | ||
return Liquid.Helpers.flatten(toArray(input)); | ||
return toIterable(input).toArray().then(function(a) { | ||
return Liquid.Helpers.flatten(a); | ||
}); | ||
}, | ||
@@ -245,17 +246,11 @@ join: function(input, glue) { | ||
} | ||
return this.flatten(input).join(glue); | ||
return this.flatten(input).then(function(a) { | ||
return a.join(glue); | ||
}); | ||
}, | ||
first: function(array) { | ||
if ((array != null ? array.length : void 0) > 0) { | ||
return array[0]; | ||
} else { | ||
return null; | ||
} | ||
first: function(input) { | ||
return toIterable(input).first(); | ||
}, | ||
last: function(array) { | ||
if ((array != null ? array.length : void 0) > 0) { | ||
return array[array.length - 1]; | ||
} else { | ||
return null; | ||
} | ||
last: function(input) { | ||
return toIterable(input).last(); | ||
}, | ||
@@ -262,0 +257,0 @@ plus: function(input, operand) { |
@@ -43,4 +43,3 @@ // Generated by CoffeeScript 1.7.1 | ||
Tag.prototype.name = function() { | ||
var _ref; | ||
return ((_ref = this.constructor.name) != null ? _ref : 'UnknownTag').toLowerCase(); | ||
return this.constructor.name.toLowerCase(); | ||
}; | ||
@@ -47,0 +46,0 @@ |
@@ -33,3 +33,3 @@ // Generated by CoffeeScript 1.7.1 | ||
context.lastScope()[this.to] = context.get(this.from); | ||
return ''; | ||
return Assign.__super__.render.call(this, context); | ||
}; | ||
@@ -36,0 +36,0 @@ |
// Generated by CoffeeScript 1.7.1 | ||
(function() { | ||
var Comment, Liquid, | ||
var Comment, Raw, | ||
__hasProp = {}.hasOwnProperty, | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
Liquid = require("../../liquid"); | ||
Raw = require("./raw"); | ||
@@ -22,3 +22,3 @@ module.exports = Comment = (function(_super) { | ||
})(Liquid.Block); | ||
})(Raw); | ||
@@ -25,0 +25,0 @@ }).call(this); |
// Generated by CoffeeScript 1.7.1 | ||
(function() { | ||
var For, Liquid, Promise, | ||
var For, Iterable, Liquid, Promise, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -11,2 +11,4 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
Iterable = require("../iterable"); | ||
module.exports = For = (function(_super) { | ||
@@ -54,3 +56,3 @@ var Syntax, SyntaxHelp; | ||
return function(collection) { | ||
var from, length, limit, segment, to; | ||
var from, limit, to; | ||
if (!(collection && collection.forEach)) { | ||
@@ -62,34 +64,36 @@ return _this.renderElse(context); | ||
to = limit ? Number(limit) + from : null; | ||
segment = _this.sliceCollection(collection, from, to); | ||
if (segment.length === 0) { | ||
return _this.renderElse(context); | ||
} | ||
if (_this.reversed) { | ||
segment.reverse(); | ||
} | ||
length = segment.length; | ||
context.registers["for"][_this.registerName] = from + segment.length; | ||
return context.stack(function() { | ||
return Promise.reduce(segment, function(output, item, index) { | ||
context.set(_this.variableName, item); | ||
context.set("forloop", { | ||
name: _this.registerName, | ||
length: length, | ||
index: index + 1, | ||
index0: index, | ||
rindex: length - index, | ||
rindex0: length - index - 1, | ||
first: index === 0, | ||
last: index === length - 1 | ||
}); | ||
return Promise["try"](function() { | ||
return _this.renderAll(_this.forBlock, context); | ||
}).then(function(rendered) { | ||
output.push(rendered); | ||
return output; | ||
})["catch"](function(e) { | ||
output.push(context.handleError(e)); | ||
return output; | ||
}); | ||
}, []); | ||
return _this.sliceCollection(collection, from, to).then(function(segment) { | ||
var length; | ||
if (segment.length === 0) { | ||
return _this.renderElse(context); | ||
} | ||
if (_this.reversed) { | ||
segment.reverse(); | ||
} | ||
length = segment.length; | ||
context.registers["for"][_this.registerName] = from + segment.length; | ||
return context.stack(function() { | ||
return Promise.reduce(segment, function(output, item, index) { | ||
context.set(_this.variableName, item); | ||
context.set("forloop", { | ||
name: _this.registerName, | ||
length: length, | ||
index: index + 1, | ||
index0: index, | ||
rindex: length - index, | ||
rindex0: length - index - 1, | ||
first: index === 0, | ||
last: index === length - 1 | ||
}); | ||
return Promise["try"](function() { | ||
return _this.renderAll(_this.forBlock, context); | ||
}).then(function(rendered) { | ||
output.push(rendered); | ||
return output; | ||
})["catch"](function(e) { | ||
output.push(context.handleError(e)); | ||
return output; | ||
}); | ||
}, []); | ||
}); | ||
}); | ||
@@ -101,7 +105,8 @@ }; | ||
For.prototype.sliceCollection = function(collection, from, to) { | ||
if (to) { | ||
return collection.slice(from, to); | ||
} else { | ||
return collection.slice(from); | ||
var args, _ref; | ||
args = [from]; | ||
if (to != null) { | ||
args.push(to); | ||
} | ||
return (_ref = Iterable.cast(collection)).slice.apply(_ref, args); | ||
}; | ||
@@ -108,0 +113,0 @@ |
// Generated by CoffeeScript 1.7.1 | ||
(function() { | ||
var Liquid, Raw, | ||
var Liquid, Promise, Raw, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -9,2 +9,4 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
Promise = require("bluebird"); | ||
module.exports = Raw = (function(_super) { | ||
@@ -25,11 +27,7 @@ __extends(Raw, _super); | ||
token = tokens.shift(); | ||
match = Liquid.Block.FullToken.exec(token); | ||
if (match && _this.blockDelimiter() === match[1]) { | ||
match = Liquid.Block.FullToken.exec(token.value); | ||
if ((match != null ? match[1] : void 0) === _this.blockDelimiter()) { | ||
return _this.endTag(); | ||
} else if (token.length > 0) { | ||
return _this.nodelist.push(token); | ||
} | ||
}; | ||
})(this)).then((function(_this) { | ||
return function() { | ||
_this.nodelist.push(token.value); | ||
return _this.parse(tokens); | ||
@@ -36,0 +34,0 @@ }; |
@@ -77,7 +77,5 @@ // Generated by CoffeeScript 1.7.1 | ||
} | ||
return this.root.render(context).then((function(_this) { | ||
return function(chunks) { | ||
return Liquid.Helpers.toFlatString(chunks); | ||
}; | ||
})(this))["finally"]((function(_this) { | ||
return this.root.render(context).then(function(chunks) { | ||
return Liquid.Helpers.toFlatString(chunks); | ||
})["finally"]((function(_this) { | ||
return function() { | ||
@@ -90,3 +88,3 @@ return _this.errors = context.errors; | ||
Template.prototype._tokenize = function(source) { | ||
var col, line, tokens, _ref; | ||
var col, line, tokens; | ||
source = String(source); | ||
@@ -97,8 +95,7 @@ if (source.length === 0) { | ||
tokens = source.split(Liquid.TemplateParser); | ||
if (((_ref = tokens[0]) != null ? _ref.length : void 0) === 0) { | ||
tokens.shift(); | ||
} | ||
line = 1; | ||
col = 1; | ||
return tokens.map(function(value) { | ||
return tokens.filter(function(token) { | ||
return token.length > 0; | ||
}).map(function(value) { | ||
var lastIndex, linebreaks, result; | ||
@@ -105,0 +102,0 @@ result = { |
@@ -72,3 +72,3 @@ // Generated by CoffeeScript 1.7.1 | ||
} | ||
throw new Liquid.FilterNotFound("Error - filter '" + filter[0] + "' in '" + this.markup + "' could not be found."); | ||
throw new Liquid.FilterNotFound("Error - filter '" + filter[0] + "' in '" + _this.markup + "' could not be found."); | ||
} | ||
@@ -91,2 +91,4 @@ }); | ||
} | ||
}, function(e) { | ||
return context.handleError(e); | ||
}); | ||
@@ -93,0 +95,0 @@ }; |
@@ -15,3 +15,4 @@ { | ||
"description": "Node.js port of Tobias Lütke's Liquid template engine.", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"license": "MIT", | ||
"homepage": "https://github.com/sirlantis/liquid-node", | ||
@@ -35,12 +36,22 @@ "bugs": "https://github.com/sirlantis/liquid-node/issues", | ||
"devDependencies": { | ||
"chai": "~1.9.1", | ||
"chai-as-promised": "~4.1.1", | ||
"coffee-script": "~1.7.1", | ||
"chai": "~1.9.1", | ||
"coffeelint": "^1.5.2", | ||
"coveralls": "^2.10.1", | ||
"jscoverage": "^0.5.4", | ||
"mocha": "~1.20.1", | ||
"chai-as-promised": "~4.1.1" | ||
"mocha-lcov-reporter": "0.0.1", | ||
"sinon": "^1.10.2", | ||
"sinon-chai": "^2.5.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha --compilers coffee:coffee-script/register -r test/*.coffee -R spec", | ||
"compile": "coffee --output lib --map --compile src", | ||
"prepublish": "npm test && npm run-script compile" | ||
"test": "mocha --compilers coffee:coffee-script/register -R spec test", | ||
"compile": "rm -rf lib && coffee --output lib --map --compile src", | ||
"prepublish": "npm run precommit && npm run compile", | ||
"precommit": "npm test && npm run lint", | ||
"coverage": "npm run compile && LIQUID_NODE_COVERAGE=1 mocha --compilers coffee:coffee-script/register -r jscoverage --reporter mocha-lcov-reporter test | coveralls", | ||
"coverage-report": "npm run compile && LIQUID_NODE_COVERAGE=1 mocha --compilers coffee:coffee-script/register -r jscoverage --covout html test", | ||
"lint": "coffeelint src/** test/**" | ||
} | ||
} |
# Liquid with Node.js | ||
[![Travis CI Status](https://secure.travis-ci.org/sirlantis/liquid-node.png?branch=master)](https://travis-ci.org/sirlantis/liquid-node) | ||
[![NPM version](https://badge.fury.io/js/liquid-node.svg)](http://badge.fury.io/js/liquid-node) | ||
[![Build Status](https://travis-ci.org/sirlantis/liquid-node.svg?branch=master)](https://travis-ci.org/sirlantis/liquid-node) | ||
[![Coverage Status](https://img.shields.io/coveralls/sirlantis/liquid-node.svg)](https://coveralls.io/r/sirlantis/liquid-node?branch=master) | ||
[![Dependency Status](https://david-dm.org/sirlantis/liquid-node.svg)](https://david-dm.org/sirlantis/liquid-node) | ||
[![devDependency Status](https://david-dm.org/sirlantis/liquid-node/dev-status.svg)](https://david-dm.org/sirlantis/liquid-node#info=devDependencies) | ||
@@ -7,0 +9,0 @@ > LiquidNode is a port of the original Liquid template engine from *Ruby* to *Node.js*. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
994464
96
164
10
2011