initial commit

This commit is contained in:
tmshv committed 2014-02-12 12:36:59 +04:00
commit d3fcd7f10c
3159 files changed
+349702

No files matched your search

+67
View File
@@ -0,0 +1,67 @@
{
"name": "consolidate",
"version": "0.10.0",
"description": "Template engine consolidation library",
"keywords": [
"template",
"engine",
"view"
],
"author": {
"name": "TJ Holowaychuk",
"email": "tj@vision-media.ca"
},
"devDependencies": {
"mocha": "*",
"should": "*",
"jade": "0.26.0",
"ejs": "0.7.1",
"eco": "1.1.0-rc-3",
"swig": "0.12.0",
"jazz": "0.0.18",
"jqtpl": "1.1.0",
"liquor": "0.0.4",
"lodash": "1.2.0",
"hamljs": "0.6.1",
"whiskers": "0.2.2",
"haml-coffee": "1.4.0",
"hogan.js": "2.0.0",
"dust": "0.3.0",
"dustjs-linkedin": "1.2",
"dustjs-helpers": "1.1.1",
"handlebars": "1.0.7",
"underscore": "1.3.3",
"qejs": "0.0.1",
"walrus": "0.9.0",
"mustache": "0.4.0",
"just": "0.1.8",
"ect": "0.3.5",
"mote": "0.2.0",
"toffee": "0.0.52",
"atpl": ">=0.5.5",
"templayed": ">=0.2.3",
"dot": "1.0.1",
"ractive": "0.3.7",
"nunjucks": "~1.0.0"
},
"main": "index",
"repository": {
"type": "git",
"url": "https://github.com/visionmedia/consolidate.js.git"
},
"scripts": {
"test": "mocha"
},
"readme": "# Consolidate.js\n\n Template engine consolidation library.\n\n## Installation\n\n $ npm install consolidate\n\n## Supported template engines\n\n - [atpl](https://github.com/soywiz/atpl.js)\n - [dust](https://github.com/akdubya/dustjs) [(website)](http://akdubya.github.com/dustjs/)\n - [eco](https://github.com/sstephenson/eco)\n - [ect](https://github.com/baryshev/ect) [(website)](http://ectjs.com/)\n - [ejs](https://github.com/visionmedia/ejs)\n - [haml](https://github.com/visionmedia/haml.js) [(website)](http://haml-lang.com/)\n - [haml-coffee](https://github.com/9elements/haml-coffee) [(website)](http://haml-lang.com/)\n - [handlebars](https://github.com/wycats/handlebars.js/) [(website)](http://handlebarsjs.com/)\n - [hogan](https://github.com/twitter/hogan.js) [(website)](http://twitter.github.com/hogan.js/)\n - [jade](https://github.com/visionmedia/jade) [(website)](http://jade-lang.com/)\n - [jazz](https://github.com/shinetech/jazz)\n - [jqtpl](https://github.com/kof/node-jqtpl) [(website)](http://api.jquery.com/category/plugins/templates/)\n - [JUST](https://github.com/baryshev/just)\n - [liquor](https://github.com/chjj/liquor)\n - [lodash](https://github.com/bestiejs/lodash) [(website)](http://lodash.com/)\n - [mustache](https://github.com/janl/mustache.js)\n - [QEJS](https://github.com/jepso/QEJS)\n - [ractive](https://github.com/Rich-Harris/Ractive)\n - [swig](https://github.com/paularmstrong/swig) [(website)](http://paularmstrong.github.com/swig/)\n - [templayed](http://archan937.github.com/templayed.js/)\n - [toffee](https://github.com/malgorithms/toffee)\n - [underscore](https://github.com/documentcloud/underscore) [(website)](http://documentcloud.github.com/underscore/)\n - [walrus](https://github.com/jeremyruppel/walrus) [(website)](http://documentup.com/jeremyruppel/walrus/)\n - [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\n__NOTE__: you must still install the engines you wish to use, add them to your package.json dependencies.\n\n## API\n\n All templates supported by this library may be rendered using the signature `(path[, locals], callback)` as shown below, which happens to be the signature that Express 3.x supports so any of these engines may be used within Express.\n\n__NOTE__: All this example code uses cons.swig for the swig template engine. Replace swig with whatever templating you are using. For example, use cons.hogan for hogan.js, cons.jade for jade, etc. `console.log(cons)` for the full list of identifiers.\n\n```js\nvar cons = require('consolidate');\ncons.swig('views/page.html', { user: 'tobi' }, function(err, html){\n if (err) throw err;\n console.log(html);\n});\n```\n\n Or without options / local variables:\n\n```js\nvar cons = require('consolidate');\ncons.swig('views/page.html', function(err, html){\n if (err) throw err;\n console.log(html);\n});\n```\n\n To dynamically pass the engine, simply use the subscript operator and a variable:\n\n```js\nvar cons = require('consolidate')\n , name = 'swig';\n\ncons[name]('views/page.html', { user: 'tobi' }, function(err, html){\n if (err) throw err;\n console.log(html);\n});\n```\n\n## Caching\n\n To enable caching simply pass `{ cache: true }`. Engines _may_ use this option to cache things reading the file contents, compiled `Function`s etc. Engines which do _not_ support this may simply ignore it. All engines that consolidate.js implements I/O for will cache the file contents, ideal for production environments.\n\n```js\nvar cons = require('consolidate');\ncons.swig('views/page.html', { user: 'tobi' }, function(err, html){\n if (err) throw err;\n console.log(html);\n});\n```\n\n## Express 3.x example\n\n```js\nvar express = require('express')\n , cons = require('consolidate')\n , app = express();\n\n// assign the swig engine to .html files\napp.engine('html', cons.swig);\n\n// set .html as the default extension \napp.set('view engine', 'html');\napp.set('views', __dirname + '/views');\n\nvar users = [];\nusers.push({ name: 'tobi' });\nusers.push({ name: 'loki' });\nusers.push({ name: 'jane' });\n\napp.get('/', function(req, res){\n res.render('index', {\n title: 'Consolidate.js'\n });\n});\n\napp.get('/users', function(req, res){\n res.render('users', {\n title: 'Users',\n users: users\n });\n});\n\napp.listen(3000);\nconsole.log('Express server listening on port 3000');\n```\n\n## Running tests\n\n Install dev deps:\n \n $ npm install -d\n\n Run the tests:\n\n $ make test\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the SoftwarLine truncated
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/visionmedia/consolidate.js/issues"
},
"homepage": "https://github.com/visionmedia/consolidate.js",
"_id": "consolidate@0.10.0",
"dist": {
"shasum": "81f1a6ceba1247df9cef7a261ce527c2ce538f7a"
},
"_from": "consolidate@",
"_resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.10.0.tgz"
}