{ "name": "ejs", "description": "Embedded JavaScript templates", "keywords": [ "template", "engine", "ejs" ], "version": "2.5.2", "author": { "name": "Matthew Eernisse", "email": "mde@fleegix.org", "url": "http://fleegix.org" }, "contributors": [ { "name": "Timothy Gu", "email": "timothygu99@gmail.com", "url": "https://timothygu.github.io" } ], "license": "Apache-2.0", "main": "./lib/ejs.js", "repository": { "type": "git", "url": "git://github.com/mde/ejs.git" }, "bugs": { "url": "https://github.com/mde/ejs/issues" }, "homepage": "https://github.com/mde/ejs", "dependencies": {}, "devDependencies": { "browserify": "^13.0.1", "eslint": "^3.0.0", "istanbul": "~0.4.3", "jake": "^8.0.0", "jsdoc": "^3.4.0", "lru-cache": "^4.0.1", "mocha": "^3.0.2", "rimraf": "^2.2.8", "uglify-js": "^2.6.2" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha", "coverage": "istanbul cover node_modules/mocha/bin/_mocha", "doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*", "devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*" }, "readme": "# EJS\n\nEmbedded JavaScript templates\n\n[![Build Status](https://img.shields.io/travis/mde/ejs/master.svg?style=flat)](https://travis-ci.org/mde/ejs)\n[![Developing Dependencies](https://img.shields.io/david/dev/mde/ejs.svg?style=flat)](https://david-dm.org/mde/ejs?type=dev)\n\n## Installation\n\n```bash\n$ npm install ejs\n```\n\n## Features\n\n * Control flow with `<% %>`\n * Escaped output with `<%= %>` (escape function configurable)\n * Unescaped raw output with `<%- %>`\n * Newline-trim mode ('newline slurping') with `-%>` ending tag\n * Whitespace-trim mode (slurp all whitespace) for control flow with `<%_ _%>`\n * Custom delimiters (e.g., use ` ?>` instead of `<% %>`)\n * Includes\n * Client-side support\n * Static caching of intermediate JavaScript\n * Static caching of templates\n * Complies with the [Express](http://expressjs.com) view system\n\n## Example\n\n```html\n<% if (user) { %>\n
\n My page\n
\n<%- include('footer') -%>\n```\n\n## Client-side support\n\nGo to the [Latest Release](https://github.com/mde/ejs/releases/latest), download\n`./ejs.js` or `./ejs.min.js`. Alternately, you can compile it yourself by cloning\nthe repository and running `jake build` (or `$(npm bin)/jake build` if jake is\nnot installed globally).\n\nInclude one of these files on your page, and `ejs` should be available globally.\n\n### Example\n\n```html\n\n\n\n```\n\n### Caveats\n\nMost of EJS will work as expected; however, there are a few things to note:\n\n1. Obviously, since you do not have access to the filesystem, `ejs.renderFile()` won't work.\n2. For the same reason, `include`s do not work unless you use an `IncludeCallback`. Here is an example:\n ```javascript\n var str = \"Hello <%= include('file', {person: 'John'}); %>\",\n fn = ejs.compile(str, {client: true});\n\n fn(data, null, function(path, d){ // IncludeCallback\n // path -> 'file'\n // d -> {person: 'John'}\n // Put your code here\n // Return the contents of file as a string\n }); // returns rendered string\n ```\n\n## Related projects\n\nThere are a number of implementations of EJS:\n\n * TJ's implementation, the v1 of this library: https://github.com/tj/ejs\n * Jupiter Consulting's EJS: http://www.embeddedjs.com/\n * EJS Embedded JavaScript Framework on Google Code: https://code.google.com/p/embeddedjavascript/\n * Sam Stephenson's Ruby implementation: https://rubygems.org/gems/ejs\n * Erubis, an ERB implementation which also runs JavaScript: http://www.kuwata-lab.com/erubis/users-guide.04.html#lang-javascript\n\n## License\n\nLicensed under the Apache License, Version 2.0\n(