{"author":{"name":"John Roepke","email":"john@justjohn.us","url":"http://john.sh/"},"name":"twig","description":"JS port of the Twig templating language.","version":"3.0.0","homepage":"https://github.com/twigjs/twig.js","license":"BSD-2-Clause","licenses":[{"type":"BSD-2-Clause","url":"https://raw.github.com/twigjs/twig.js/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/twigjs/twig.js.git"},"main":"src/twig.js","engines":{"node":">=22"},"bin":{"twigjs":"bin/twigjs"},"scripts":{"preversion":"npm test && git diff --exit-code --quiet","postversion":"git push origin master && git push origin master --tags","pretest":"npm run build","test":"mocha -r should","build":"node node/build.js","posttest":"npm run lint","lint":"eslint"},"dependencies":{"@babel/runtime":"^7.8.4","locutus":"^3.0.9","minimatch":"^10","walk":"2.3.x"},"devDependencies":{"@babel/core":"^7.8.4","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.8.4","@eslint/js":"^9.39.3","babel-loader":"^10.0.0","eslint":"^9.39.3","globals":"^17.4.0","mocha":"12.0.0-beta-10","path-browserify":"^1.0.1","should":"^13.2.3","should-sinon":"0.0.6","sinon":"^21.0.0","terser-webpack-plugin":"^5.3.6","tokenizer2":"^2.0.1","webpack":"^5.75.0","webpack-cli":"^6.0.1"},"browser":{"fs":false},"gitHead":"227c88120a4232f42899af839a6be1b849131fe3","_id":"twig@3.0.0","bugs":{"url":"https://github.com/twigjs/twig.js/issues"},"_nodeVersion":"25.6.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-cMfYLWAgdW15B7L5wmanmga113e4phQmo3rk5EFuUrQd99g7I3ncxgynS38P01m4ZXBDSdMYUTV1g3A66/Y56Q==","shasum":"b847ba9837f79154e8b935239fadc06a4260856a","tarball":"http://registry-npm.ywwl.com/twig/download/twig-3.0.0.tgz","fileCount":37,"unpackedSize":1179326,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD/HiiAF7tV8aHPHPLzYk8sH0eSmmpKh6UMJ9lQ1FNgXgIgLnyfg3Ga89PQQ8gA34DMvzNTQfQNl19tqtAffnbYlA0="}],"size":257368,"noattachment":false,"key":"/twig/-/twig-3.0.0.tgz"},"_npmUser":{"name":"robloach","email":"robloach@gmail.com"},"directories":{},"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"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/twig_3.0.0_1774554230674_0.3888649952916101"},"_hasShrinkwrap":false,"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":1774554230935,"_cnpm_publish_time":1774554230935,"dist-tags":{"latest":"3.0.0"}}