fquery-handlebars
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -7,29 +7,30 @@ /*jshint node: true */ | ||
fQuery.fn.handlebars = function (data) { | ||
fQuery.fn.handlebars = function (data) { | ||
var handlebars = require('handlebars'); | ||
var handlebars = require('handlebars'); | ||
return this.edit(function (blob) { | ||
return this.edit(function (blob) { | ||
try { | ||
blob.content = handlebars.compile(blob.content)(data); | ||
} catch (err) { | ||
fQuery.Event.error({ | ||
method: 'handlebars', | ||
message: err.toString(), | ||
fquery: this, | ||
blob: blob, | ||
data: err | ||
}); | ||
} | ||
}); | ||
}; | ||
try { | ||
blob.content = handlebars.compile(blob.content)(data); | ||
} catch (e) { | ||
fQuery.report({ | ||
type: 'err', | ||
method: 'handlebars', | ||
message: e.message, | ||
fquery: this, | ||
blob: blob, | ||
err: e | ||
}); | ||
} | ||
}); | ||
}; | ||
fQuery.fn.thenHandlebars = function (data) { | ||
fQuery.fn.thenHandlebars = function (data) { | ||
return this.then(function () { | ||
return this.then(function () { | ||
return this.handlebars(data); | ||
}); | ||
}; | ||
return this.handlebars(data); | ||
}); | ||
}; | ||
}; |
{ | ||
"name": "fquery-handlebars", | ||
"displayName": "fQuery.handlebars", | ||
"version": "0.1.0", | ||
"description": "fQuery plugin to apply handlebars to file content", | ||
"version": "0.2.0", | ||
"description": "fQuery plugin to apply handlebars to a file's content", | ||
"homepage": "https://github.com/lrsjng/fquery-handlebars", | ||
@@ -16,10 +16,10 @@ "bugs": "https://github.com/lrsjng/fquery-handlebars/issues", | ||
"scripts": { | ||
"test": "node_modules/.bin/mocha test.js" | ||
"test": "mocha --recursive test" | ||
}, | ||
"dependencies": { | ||
"handlebars": "~2.0.0-alpha.4" | ||
"handlebars": "~2.0.0-beta.1" | ||
}, | ||
"devDependencies": { | ||
"fquery": "~0.12.2", | ||
"mocha": "~1.21.0" | ||
"fquery": "~0.13.3", | ||
"mocha": "~1.21.4" | ||
}, | ||
@@ -26,0 +26,0 @@ "engines": { |
# fQuery.handlebars | ||
[![Version](http://img.shields.io/npm/v/fquery-handlebars.svg?style=flat)](https://www.npmjs.org/package/fquery-handlebars) | ||
[![Downloads](http://img.shields.io/npm/dm/fquery-handlebars.svg?style=flat)](https://www.npmjs.org/package/fquery-handlebars) | ||
[![License](http://img.shields.io/npm/l/fquery-handlebars.svg?style=flat)](https://www.npmjs.org/package/fquery-handlebars) | ||
[![Dependencies Status](http://img.shields.io/david/lrsjng/fquery-handlebars.svg?style=flat)](https://david-dm.org/lrsjng/fquery-handlebars) | ||
[![Build Status](http://img.shields.io/travis/lrsjng/fquery-handlebars.svg?style=flat)](https://travis-ci.org/lrsjng/fquery-handlebars) | ||
[![license][license-img]][github] [![github][github-img]][github] [![npm][npm-img]][npm] | ||
[![version][npm-v-img]][npm] [![downloads][npm-dm-img]][npm] [![dependencies status][gemnasium-img]][gemnasium] [![build status][travis-img]][travis] | ||
[fQuery](https://github.com/lrsjng/fquery) plugin to apply handlebars to file content. | ||
To report a bug or make a feature request please create [a new issue](https://github.com/lrsjng/fquery-handlebars/issues/new). | ||
[fQuery][fquery] plugin to apply [handlebars][handlebars] to a file's content. | ||
References: [GitHub](https://github.com/lrsjng/fquery-handlebars), [npm](https://www.npmjs.org/package/fquery-handlebars) | ||
## Install | ||
@@ -48,1 +42,19 @@ | ||
THE SOFTWARE. | ||
[github]: https://github.com/lrsjng/fquery-handlebars | ||
[npm]: https://www.npmjs.org/package/fquery-handlebars | ||
[gemnasium]: https://gemnasium.com/lrsjng/fquery-handlebars | ||
[travis]: https://travis-ci.org/lrsjng/fquery-handlebars | ||
[license-img]: http://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square | ||
[github-img]: http://img.shields.io/badge/github-lrsjng/fquery--handlebars-a0a060.svg?style=flat-square | ||
[npm-img]: http://img.shields.io/badge/npm-fquery--handlebars-a0a060.svg?style=flat-square | ||
[npm-v-img]: http://img.shields.io/npm/v/fquery-handlebars.svg?style=flat-square | ||
[npm-dm-img]: http://img.shields.io/npm/dm/fquery-handlebars.svg?style=flat-square | ||
[gemnasium-img]: http://img.shields.io/gemnasium/lrsjng/fquery-handlebars.svg?style=flat-square | ||
[travis-img]: http://img.shields.io/travis/lrsjng/fquery-handlebars.svg?style=flat-square | ||
[fquery]: https://github.com/lrsjng/fquery | ||
[handlebars]: https://github.com/wycats/handlebars.js |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5288
7
52
60
Updatedhandlebars@~2.0.0-beta.1