{"name":"twig","version":"2.0.0","author":{"url":"http://john.sh/","name":"John Roepke","email":"john@justjohn.us"},"license":"BSD-2-Clause","_id":"twig@2.0.0","maintainers":[{"name":"dave-irvine","email":"dave@daveirvine.me"},{"name":"justjohn","email":"john@justjohn.us"},{"name":"robloach","email":"robloach@gmail.com"},{"name":"justafish","email":"npm@justa.fish"},{"name":"plepe","email":"skunk@xover.mud.at"},{"name":"evgenius","email":"abd.evg@gmail.com"},{"name":"willrowe","email":"wrowe@will-rowe.com"}],"homepage":"https://github.com/twigjs/twig.js","bugs":{"url":"https://github.com/twigjs/twig.js/issues"},"bin":{"twigjs":"bin/twigjs"},"dist":{"shasum":"124751107e9797492eaafa3fdc55069c7e1e1034","tarball":"http://registry-npm.ywwl.com/twig/download/twig-2.0.0.tgz","fileCount":37,"integrity":"sha512-XKeIPEdmyEhM+HV8wB/6KIijnS+KHKSQaXH35lDFi2kTpEKJV3Ms5ksFbt89iNRgumfLIVqmVRh80MNWw/Hisw==","signatures":[{"sig":"MEUCIQDRV6YtN1nwUebY9wNH6PIZuL2V5lhxx9IKRO0Ul8zODAIgTKtopueK/J3aCEr8nBTSkWrGtLD/V/3xzu7Mr04ROKw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2365181,"size":519563,"noattachment":false,"key":"/twig/-/twig-2.0.0.tgz"},"main":"src/twig.js","browser":{"fs":false},"engines":{"node":">=20"},"gitHead":"d19c2129959c46b98df5ebf564958e43f18ce18a","scripts":{"lint":"eslint","test":"mocha -r should","build":"node node/build.js","pretest":"npm run build","posttest":"npm run lint","preversion":"npm test && git diff --exit-code --quiet","postversion":"git push origin master && git push origin master --tags"},"_npmUser":{"name":"robloach","email":"robloach@gmail.com"},"licenses":[{"url":"https://raw.github.com/twigjs/twig.js/master/LICENSE","type":"BSD-2-Clause"}],"repository":{"url":"git://github.com/twigjs/twig.js.git","type":"git"},"_npmVersion":"11.8.0","description":"JS port of the Twig templating language.","directories":{},"_nodeVersion":"25.6.0","dependencies":{"walk":"2.3.x","locutus":"^3.0.9","minimatch":"^10","@babel/runtime":"^7.8.4"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"12.0.0-beta-10","sinon":"^21.0.0","eslint":"^9.39.3","should":"^13.2.3","globals":"^17.4.0","webpack":"^5.75.0","@eslint/js":"^9.39.3","tokenizer2":"^2.0.1","@babel/core":"^7.8.4","webpack-cli":"^6.0.1","babel-loader":"^10.0.0","should-sinon":"0.0.6","path-browserify":"^1.0.1","@babel/preset-env":"^7.8.4","terser-webpack-plugin":"^5.3.6","@babel/plugin-transform-runtime":"^7.8.3"},"_npmOperationalInternal":{"tmp":"tmp/twig_2.0.0_1773070220679_0.82683435355302","host":"s3://npm-registry-packages-npm-production"},"readme":"[![Known Vulnerabilities](https://snyk.io/test/github/twigjs/twig.js/badge.svg)](https://snyk.io/test/github/twigjs/twig.js)\n[![Build Status](https://secure.travis-ci.org/twigjs/twig.js.svg)](http://travis-ci.org/twigjs/twig.js)\n[![NPM version](https://badge.fury.io/js/twig.svg)](http://badge.fury.io/js/twig)\n[![Gitter](https://badges.gitter.im/twigjs/twig.js.svg)](https://gitter.im/twigjs/twig.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n\n# About\n\n<img align=\"right\" width=\"120\" height=\"120\"\n     title=\"Twig.js\"\n     src=\"https://user-images.githubusercontent.com/3282350/29336704-ab1be05c-81dc-11e7-92e5-cf11cca7b344.png\">\n\nTwig.js is a pure JavaScript implementation of the Twig PHP templating language\n(<https://twig.symfony.com/>)\n\nThe goal is to provide a library that is compatible with both browsers and server side JavaScript environments such as node.js.\n\nTwig.js is currently a work in progress and supports a limited subset of the Twig templating language (with more coming).\n\n### Docs\n\nDocumentation is available in the [twig.js wiki](https://github.com/twigjs/twig.js/wiki) on Github.\n\n### Feature Support\n\nFor a list of supported tags/filters/functions/tests see the [Implementation Notes](https://github.com/twigjs/twig.js/wiki/Implementation-Notes) page on the wiki.\n\n# Install\n\nDownload the latest twig.js release from github: https://github.com/twigjs/twig.js/releases or via NPM:\n\n```bash\nnpm install twig --save\n```\n\n# Bower\n\nA bower package is available from [philsbury](https://github.com/philsbury/twigjs-bower). Please direct any Bower support issues to that repo.\n\n## Browser Usage\n\nInclude twig.js or twig.min.js in your page, then:\n\n```js\nvar template = Twig.twig({\n    data: 'The {{ baked_good }} is a lie.'\n});\n\nconsole.log(\n    template.render({baked_good: 'cupcake'})\n);\n// outputs: \"The cupcake is a lie.\"\n```\n\n## Webpack\n\nA loader is available from [zimmo.be](https://github.com/zimmo-be/twig-loader).\n\n## Node Usage (npm)\n\nTested on node >=6.0.\n\nYou can use twig in your app with\n\n```js\nvar Twig = require('twig'), // Twig module\n    twig = Twig.twig;       // Render function\n```\n\n### Usage without Express\n\nIf you don't want to use Express, you can render a template with the following method:\n\n```js\nimport Twig from 'twig';\nTwig.renderFile('./path/to/someFile.twig', {foo:'bar'}, (err, html) => {\n  html; // compiled string\n});\n```\n\n### Usage with Express\n\nTwig is compatible with express 2 and 3. You can create an express app using the twig.js templating language by setting the view engine to twig.\n\n### app.js\n\n**Express 3**\n\n```js\nvar Twig = require(\"twig\"),\n    express = require('express'),\n    app = express();\n\n// This section is optional and used to configure twig.\napp.set(\"twig options\", {\n    allowAsync: true, // Allow asynchronous compiling\n    strict_variables: false\n});\n\napp.get('/', function(req, res){\n  res.render('index.twig', {\n    message : \"Hello World\"\n  });\n});\n\napp.listen(9999);\n```\n\n## views/index.twig\n\n```html\nMessage of the moment: <b>{{ message }}</b>\n```\n\nAn [Express 2 Example](https://github.com/twigjs/twig.js/wiki/Express-2) is available on the wiki.\n\n# Alternatives\n\n- [Twing](https://github.com/ericmorand/twing)\n\n# Contributing\n\nIf you have a change you want to make to twig.js, feel free to fork this repository and submit a pull request on Github. The source files are located in `src/*.js`.\n\ntwig.js is built by running `npm run build`\n\nFor more details on getting setup, see the [contributing page](https://github.com/twigjs/twig.js/wiki/Contributing) on the wiki.\n\n## Environment Requirements\nWhen developing on Windows, the repository must be checked out **without** automatic conversion of LF to CRLF. Failure to do so will cause tests that would otherwise pass on Linux or Mac to fail instead.\n\n## Tests\n\nThe twig.js tests are written in [Mocha][mocha] and can be invoked with `npm test`.\n\n## License\n\nTwig.js is available under a [BSD 2-Clause License][bsd-2], see the LICENSE file for more information.\n\n## Acknowledgments\n\nSee the LICENSES.md file for copies of the referenced licenses.\n\n1. The JavaScript Array fills in src/twig.fills.js are from <https://developer.mozilla.org/> and are available under the [MIT License][mit] or are [public domain][mdn-license].\n\n2. The Date.format function in src/twig.lib.js is from <http://jpaq.org/> and used under a [MIT license][mit-jpaq].\n\n3. The sprintf implementation in src/twig.lib.js used for the format filter is from <http://www.diveintojavascript.com/projects/javascript-sprintf> and used under a [BSD 3-Clause License][bsd-3].\n\n4. The strip_tags implementation in src/twig.lib.js used for the striptags filter is from <http://phpjs.org/functions/strip_tags> and used under and [MIT License][mit-phpjs].\n\n[mit-jpaq]:     http://jpaq.org/license/\n[mit-phpjs]:    http://phpjs.org/pages/license/#MIT\n[mit]:          http://www.opensource.org/licenses/mit-license.php\n[mdn-license]:  https://developer.mozilla.org/Project:Copyrights\n\n[bsd-2]:        http://www.opensource.org/licenses/BSD-2-Clause\n[bsd-3]:        http://www.opensource.org/licenses/BSD-3-Clause\n[cc-by-sa-2.5]: http://creativecommons.org/licenses/by-sa/2.5/ \"Creative Commons Attribution-ShareAlike 2.5 License\"\n\n[mocha]:        http://mochajs.org/\n[qunit]:        http://docs.jquery.com/QUnit\n","publish_time":1773070220962,"_cnpm_publish_time":1773070220962,"dist-tags":{"latest":"3.0.0"}}