{"_id":"@dadi/web-es6-templates","_rev":"15-192e910a899a4f434aadfe369a317e30","name":"@dadi/web-es6-templates","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0-development":{"name":"@dadi/web-es6-templates","version":"0.0.0-development","keywords":["dadi","web"],"author":{"name":"David Longworth","email":"mr@longworth.to"},"_id":"@dadi/web-es6-templates@0.0.0-development","maintainers":[{"name":"jimlambie","email":"jameslambie@gmail.com"}],"homepage":"https://github.com/dadi/web-es6-templates#readme","bugs":{"url":"https://github.com/dadi/web-es6-templates/issues"},"dist":{"shasum":"0a8bc01b88b1ccf97d4a68b96ad1cf88815367d0","tarball":"https://registry.npmjs.org/@dadi/web-es6-templates/-/web-es6-templates-0.0.0-development.tgz","integrity":"sha512-/cSzSt+dXtrVkPJIcbHCP9o9Ppq200utjeZUj5GbQmPDd3k/HK6U3hF0sckKw1h4F5K4CeINQgMgfWnBAbGbCA==","signatures":[{"sig":"MEUCIQDZ9hp/l1O4QUjAJ3PeLPkHFFNO0tMdm5JofXBSaaYUXQIgWvH6uwRw+jKX30vkVomaxxJGGLyniXctlmGZFmJN1ME=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"0a8bc01b88b1ccf97d4a68b96ad1cf88815367d0","gitHead":"765e44e0a61e76d848c8c10448eff34431f8f53b","scripts":{"test":"snazzy 'lib/**/*.js' && env NODE_ENV=test ./node_modules/.bin/istanbul cover --report cobertura --report text --report html --report lcov ./node_modules/mocha/bin/_mocha test","atest":"./node_modules/mocha/bin/_mocha test","posttest":"./scripts/coverage.js","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"_npmUser":{"name":"jimlambie","email":"jameslambie@gmail.com"},"repository":{"url":"git+https://github.com/dadi/web-es6-templates.git","type":"git"},"_npmVersion":"3.10.9","description":"ES6 engine interface for DADI Web","directories":{},"_nodeVersion":"6.9.2","dependencies":{"debug":"^2.6.6","@dadi/logger":"^1.2.0","es6-template-strings":"^2.0.1"},"devDependencies":{"mocha":"~3.2.0","sinon":"~1.17.6","colors":"^1.1.2","should":"~4.0.4","snazzy":"^6.0.0","env-test":"^1.0.0","istanbul":"^1.1.0-alpha.1","standard":"*","object-path":"^0.11.4","html-looks-like":"^1.0.2","semantic-release":"^6.3.6","istanbul-cobertura-badger":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/web-es6-templates-0.0.0-development.tgz_1502191373380_0.5453948306385428","host":"s3://npm-registry-packages"}},"0.0.0":{"name":"@dadi/web-es6-templates","version":"0.0.0","keywords":["dadi","web"],"author":{"name":"David Longworth","email":"mr@longworth.to"},"_id":"@dadi/web-es6-templates@0.0.0","maintainers":[{"name":"jimlambie","email":"jameslambie@gmail.com"},{"name":"josephdenne","email":"support@dadi.co"}],"homepage":"https://github.com/dadi/web-es6-templates#readme","bugs":{"url":"https://github.com/dadi/web-es6-templates/issues"},"dist":{"shasum":"36e9db69ec3dca2b443f270415e1032b73e84513","tarball":"https://registry.npmjs.org/@dadi/web-es6-templates/-/web-es6-templates-0.0.0.tgz","integrity":"sha512-baIyQyreh4R7G/oY75iSNlrIgHp5PeP6YD57OAsFgLZJ1hg+8udGD9nYGeoDStqB9JbsmijQdyiGyWI47pLYhQ==","signatures":[{"sig":"MEQCIG8Q/1LHFaALCenbmdZD3t0TStVqDFXF2LaqmH/l26rRAiAwg/YRYQ+t3oJRjQvz1im+vRxHsepFyF/c6AU6wTUP0Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"36e9db69ec3dca2b443f270415e1032b73e84513","gitHead":"849f4e9b1dc36cbd33fc8e8cdee427e457bf77ed","scripts":{"test":"snazzy 'lib/**/*.js' && env NODE_ENV=test ./node_modules/.bin/istanbul cover --report cobertura --report text --report html --report lcov ./node_modules/mocha/bin/_mocha test","atest":"./node_modules/mocha/bin/_mocha test","posttest":"./scripts/coverage.js","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"_npmUser":{"name":"jimlambie","email":"jameslambie@gmail.com"},"deprecated":"Please install web-es6-templates instead: https://www.npmjs.com/package/web-es6-templates","repository":{"url":"git+https://github.com/dadi/web-es6-templates.git","type":"git"},"_npmVersion":"3.10.10","description":"ES6 engine interface for DADI Web","directories":{},"_nodeVersion":"6.11.2","dependencies":{"debug":"^2.6.6","@dadi/logger":"^1.2.0","es6-template-strings":"^2.0.1"},"devDependencies":{"mocha":"~3.2.0","sinon":"~1.17.6","colors":"^1.1.2","should":"~4.0.4","snazzy":"^6.0.0","env-test":"^1.0.0","istanbul":"^1.1.0-alpha.1","standard":"*","object-path":"^0.11.4","html-looks-like":"^1.0.2","semantic-release":"^6.3.6","istanbul-cobertura-badger":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/web-es6-templates-0.0.0.tgz_1502192403423_0.1794767789542675","host":"s3://npm-registry-packages"}},"0.0.1":{"name":"@dadi/web-es6-templates","version":"0.0.1","keywords":["dadi","web","es6-templates","dadi-web-engine"],"author":{"name":"David Longworth","email":"mr@longworth.to"},"_id":"@dadi/web-es6-templates@0.0.1","maintainers":[{"name":"jimlambie","email":"jameslambie@gmail.com"},{"name":"josephdenne","email":"support@dadi.co"}],"homepage":"https://github.com/dadi/web-es6-templates#readme","bugs":{"url":"https://github.com/dadi/web-es6-templates/issues"},"dist":{"shasum":"64d67af78d7c403e5da2ba38a40a1130ad9baa71","tarball":"https://registry.npmjs.org/@dadi/web-es6-templates/-/web-es6-templates-0.0.1.tgz","integrity":"sha512-ZJ5Q8YqrhibInkCoOtliGQQ0TopdpRe8QvSkxDVEinFQYnFaT9OhfbWcmVQATX+RQAgfCmjhwrJnEJ0RFl81Bg==","signatures":[{"sig":"MEUCIEFNyjprmuv+KmUFGQu7v3R67GHcEpHxJR5LXM3Kg1nxAiEAuRuoDNViDHLGWScAInCOEd6hTy2XlU2qHNTjIoiwyAc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"64d67af78d7c403e5da2ba38a40a1130ad9baa71","gitHead":"4aa7a22608a3ca85b4df1f0629876a89a9bffd78","scripts":{"test":"snazzy 'lib/**/*.js' && env NODE_ENV=test ./node_modules/.bin/istanbul cover --report cobertura --report text --report html --report lcov ./node_modules/mocha/bin/_mocha test","atest":"./node_modules/mocha/bin/_mocha test","posttest":"./scripts/coverage.js","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"_npmUser":{"name":"jimlambie","email":"jameslambie@gmail.com"},"deprecated":"Please install web-es6-templates instead: https://www.npmjs.com/package/web-es6-templates","repository":{"url":"git+https://github.com/dadi/web-es6-templates.git","type":"git"},"_npmVersion":"3.10.10","description":"ES6 template engine interface for DADI Web","directories":{},"_nodeVersion":"6.11.2","dependencies":{"debug":"^2.6.6","@dadi/logger":"^1.2.0","es6-template-strings":"^2.0.1"},"devDependencies":{"mocha":"~3.2.0","sinon":"~1.17.6","colors":"^1.1.2","should":"~4.0.4","snazzy":"^6.0.0","env-test":"^1.0.0","istanbul":"^1.1.0-alpha.1","standard":"*","object-path":"^0.11.4","html-looks-like":"^1.0.2","semantic-release":"^6.3.6","istanbul-cobertura-badger":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/web-es6-templates-0.0.1.tgz_1502286951964_0.43183406442403793","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-08-08T11:22:54.302Z","modified":"2025-10-31T16:43:03.060Z","0.0.0-development":"2017-08-08T11:22:54.302Z","0.0.0":"2017-08-08T11:40:04.927Z","0.0.1":"2017-08-09T13:55:52.919Z"},"bugs":{"url":"https://github.com/dadi/web-es6-templates/issues"},"author":{"name":"David Longworth","email":"mr@longworth.to"},"homepage":"https://github.com/dadi/web-es6-templates#readme","keywords":["dadi","web","es6-templates","dadi-web-engine"],"repository":{"url":"git+https://github.com/dadi/web-es6-templates.git","type":"git"},"description":"ES6 template engine interface for DADI Web","maintainers":[{"email":"support@dadi.co","name":"josephdenne"},{"email":"jameslambie@gmail.com","name":"jimlambie"},{"email":"adamkdean@googlemail.com","name":"adamkdean"}],"readme":"<img src=\"https://dadi.tech/assets/products/dadi-web-full.png\" alt=\"DADI Web\" height=\"65\"/>\n\n## ES6 template engine interface\n\n[![npm (scoped)](https://img.shields.io/npm/v/@dadi/web-es6-templates.svg?maxAge=10800&style=flat-square)](https://www.npmjs.com/package/@dadi/web-es6-templates)\n[![coverage](https://img.shields.io/badge/coverage-74%25-yellow.svg?style=flat?style=flat-square)](https://github.com/dadi/web-es6-templates)\n[![Build Status](https://travis-ci.org/dadi/web-es6-templates.svg?branch=master)](https://travis-ci.org/dadi/web-es6-templates)\n[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)\n\nThis module allows native [ES6 template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals) to be used with [DADI Web](https://github.com/dadi/web).\n\n## Installation\n\n- Add this module as a dependency:\n\n   ```\n   npm install @dadi/web-es6-templates --save\n   ```\n\n- Include it in the `engines` array passed to Web:\n\n   ```js\n   require('@dadi/web')({\n     engines: [\n       require('@dadi/web-es6-templates')\n     ]\n   })\n   ```\n\n## Usage\n\n### Helpers\n\nThe base directory for absolute paths is the `utils/helpers` directory.\n\nHelpers are `required()` functions that can be embeded into templates to keep your code DRY. Take this example which could live in your `helpers` folder as `slugify.js`.\n\n```javascript\nvar s = require('underscore.string/slugify')\n\nmodule.exports = slugify = (chunk) => {\n  return s(chunk)\n}\n```\n\nThis function would be used in a template file like so:\n\n```javascript\n${slugify('The Quick Brown Fox Jumps Over The Lazy Dog')}\n```\n\nOutput:\n\n```\nthe-quick-brown-fox-jumps-over-the-lazy-dog\n```\n\n### Includes\n\nThe base directory for absolute paths is the `pages/` directory. Take the following directory tree.\n\n```\npages/\n|_ partials/\n|_ |_ header.js\n|_ |_ footer.js\n|_ index.js\n|_ index.json\n```\n\nTo include the partials from `index.js`, you can use an underscore to indicate a sub-folder:\n\n```js\n${partials_header}\n\n<h1>ES6 Templates test</h1>\n\n<p>This page lives at ${host}.</p>\n\n<h2>Loop test</h2>\n\n<ul>\n  ${posts.results.map(i => '<li>' + i.attributes.title + '</li>').join('')}\n</ul>\n\n${partials_footer}\n```\n\n","readmeFilename":"README.md"}