MCPcopy Index your code
hub / github.com/bgub/squirrelly

github.com/bgub/squirrelly @v9.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v9.1.1 ↗ · + Follow
74 symbols 186 edges 39 files 5 documented · 7% 5 cross-repo links updated 21d agov9.1.1 · 2026-06-16★ 67220 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Squirrel

squirrelly

Documentation - Chat - RunKit Demo - Playground

GitHub package.json version (master) Travis All Contributors Coveralls Code Shelter Donate

🎯 Check out ts-base — A TypeScript library starter template featuring Biome, Vitest, tsdown, and automated releases.

Summary

Squirrelly is a modern, configurable, and blazing fast template engine implemented in JavaScript. It works out of the box with ExpressJS and the full version weighs only ~4KB gzipped.

This is version 8 - a new, more powerful rewrite of Squirrelly. It adds multiple features (like filter parameters, whitespace control, partials, and template inheritance) to bring you a template engine with the power of Nunjucks, the simplicity of EJS, and the small bundle size of its earlier versions.

Squirrelly v7 will continue to be maintained, and can be found at https://github.com/squirrellyjs/squirrelly/tree/v7.

Read about the changes

Looking for a lightweight, faster, and more reliable alternative to EJS? Check out Squirrelly's cousin, Eta.

Why Squirrelly?

Simply put, Squirrelly is super lightweight, super fast, super powerful, and super simple.

🌟 Features

  • 🔧 Helpers, filters
  • 🔧 Great error reporting
  • 📦 0 dependencies
  • 🔨 Conditionals
  • 🔧 Better quotes/comments support
  • ex. {{someval + "name }}" }} compiles correctly, while it fails with DoT or EJS
  • ⚡️ Exports ES Modules as well as UMD
  • 🔨 Loops
  • 🔧 Custom delimeters
  • 📝 Easy template syntax
  • 🔧 Precompilation
  • 🔨 Partials
  • 🔧 Inline JavaScript
  • 🔨 Comments
  • 🔧 Caching
  • 🚀 Super Fast
  • Squirrelly has been benchmarked against Marko, Pug, doT, Swig, Handlebars, Mustache, and Nunjucks. In each test, Squirrelly was fastest.
  • ⚡️ Async support: async filters, helpers, partials
  • 🔧 Template inheritance

📜 Docs

We know nobody reads through the long and boring documentation in the ReadMe anyway, so head over to the documentation website:

📝 https://squirrelly.js.org

📓 Examples

Simple Template

var myTemplate = "

My favorite kind of cake is: {{it.favoriteCake}}

"

Sqrl.render(myTemplate, {favoriteCake: 'Chocolate!'})
// Returns: '

My favorite kind of cake is: Chocolate!


Conditionals

{{@if(it.somevalue === 1)}}
Display this
{{#else}}
Display this
{{/if}}

Loops

{{@each(it.somearray) => val, index}}
Display this
The current array element is {{val}}
The current index is {{index}}
{{/each}}

✔️ Tests

Tests can be run with npm test. Multiple tests check that parsing, rendering, and compiling return expected results, formatting follows guidelines, and code coverage is at the expected level.

Resources

To be added

Projects using squirrelly

[Waiting for permissions]

  • Cypress: Fast, easy and reliable testing for anything that runs in a browser
  • txAdmin: A full featured web panel to manage & monitor your FiveM Server remotely, used by over two thousand servers worldwide
  • Add yours!

Contributors

Made with ❤ by @nebrelbug and all these wonderful contributors (emoji key):

Ben Gubler 💻 💬 📖 ⚠️ Clite Tailor 🤔 💻 Ioan CHIRIAC 💻 🤔 Lucas Wilson 🐛 💻 Jon McLean 💻 ⚠️

Note: because we completely rewrote Version 8 and it has a separate Git history, this chart excludes the dozens of contributors to Version 7. Their contributions are deeply appreciated and many of their ideas and code contributions are being used in Squirrelly v8. Many of their contributions can be found in the v7 branch commit history.

This project follows the all-contributors specification. Contributions of any kind are welcome!

Credits

  • Async support and file handling were added based on code from EJS, which is licensed under the Apache-2.0 license. Code was modified to throw informative errors and work with Squirrelly's API

Extension points exported contracts — how you extend this code

FileOptions (Interface)
(no doc)
src/file-handlers.ts
Dict (Interface)
(no doc)
src/storage.ts
SqrlConfig (Interface)
(no doc)
src/config.ts
HelperContent (Interface)
(no doc)
src/containers.ts
IncludeHelperBlock (Interface)
(no doc)
src/file-helpers.ts
SqrlErrType (Interface)
(no doc)
src/err.ts
TemplateObject (Interface)
(no doc)
src/parse.ts
PartialFileConfig (Interface)
(no doc)
src/file-utils.ts

Core symbols most depended-on inside this repo

render
called by 32
src/render.ts
get
called by 17
src/storage.ts
compileToString
called by 17
src/compile-string.ts
SqrlErr
called by 17
src/err.ts
parse
called by 17
src/parse.ts
compile
called by 16
src/compile.ts
trimWS
called by 15
src/utils.ts
define
called by 14
src/storage.ts

Shape

Function 50
Interface 16
Method 6
Class 2

Languages

TypeScript100%

Modules by API surface

src/storage.ts9 symbols
src/parse.ts8 symbols
src/file-utils.ts6 symbols
src/file-handlers.ts6 symbols
src/container-utils.ts6 symbols
src/compile-string.ts6 symbols
browser-tests/benchmark.js5 symbols
test/async.spec.ts4 symbols
src/utils.ts4 symbols
src/file-helpers.ts4 symbols
src/err.ts4 symbols
src/containers.ts4 symbols

For agents

$ claude mcp add squirrelly \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact