npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

squirrelly-fork

v7.9.4

Published

A fork of Squirrelly, not intended to be used in real projects.

Downloads

3

Readme

squirrelly

Travis (.com) branch Codacy Badge JavaScript Style Guide Join the chat at https://gitter.im/squirrellyjs/Lobby Tip me at paypal.me/bengubler All Contributors

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 ~2.2KB gzipped.

Notice: Squirrelly v8 was released in beta! Learn more about v8

All future development of Squirrelly 7 will be happening on the v7 branch.

Why Squirrelly?

Simply put, Squirrelly is super lightweight, super fast, simple, and gets the job done.

🌟 Features

  • :wrench: Custom helpers
  • :wrench: Custom filters
  • :package: 0 dependencies
  • :hammer: Conditionals
  • :zap: Exports ES Modules as well as UMD
  • :hammer: Loops
  • :wrench: Custom delimeters
  • :pencil2: Easy template syntax
  • :wrench: Precompilation
  • :hammer: Partials
  • :wrench: Inline JavaScript
  • :hammer: Comments
  • :wrench: Caching
  • :rocket: SUPER fast (look at the performance benchmarks here)

:scroll: Docs

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

:pencil: https://squirrelly.js.org

:notebook: Examples

Simple Template

var myTemplate = "<p>My favorite kind of cake is: {{favoriteCake}}</p>"

Sqrl.Render(myTemplate, {favoriteCake: 'Chocolate!'})
// Returns: '<p>My favorite kind of cake is: Chocolate!</p>

Conditionals

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

Loops

{{each(options.somearray)}}
Display this
The current array element is {{@this}}
The current index is {{@index}}
{{/each}}

:heavy_check_mark: Tests

The default test can be run with npm test, and it just checks that compiling and rendering a simple template results in the correct string.

:handshake: Contributing

We love contributions from the community! Contributions are accepted using GitHub pull requests; for more information, see GitHub documentation - Creating a pull request.

For a good pull request, we ask you provide the following:

  1. Include a clear description of your pull request in the description with the basic "what" and "why" for the request.
  2. The test should pass.
  3. The pull request should include tests for the change. A new feature should have tests for the new feature and bug fixes should include a test that fails without the corresponding code change and passes after they are applied.
  4. If the pull request is a new feature, please include appropriate documentation in the README.md file as well.
  5. Keep a consistent coding style.

Contributors

This project exists thanks to all the people who contribute. We welcome contributions! Learn how to contribute here.

:fire: Version 8

Some of you may have been wondering about the lack of activity on this repository over the last few months. The answer is that, for quite a while, I've been working on a brand-new version of Squirrelly. You can read about it on GitHub, but here's a quick overview:

:sparkles: Low-Level Changes

  • New, more reliable parser -- see a draft here
  • AST generation before compiled-function generation
  • Partials will be referenced instead of inlined
  • Bundling with Rollup for smaller code size

:sparkles: New Features

  • Layouts
  • Async support
  • Helpers will be prefixed with ~, so {{~if(options.stuff}}
  • 'Interpolate syntax': {{=4+3}}
  • Native Code: what was previously {{js(var x = 0)/}} will become: {{!var x = 0}}
  • Filter parameters, ex. {{somearray | join(",") }}
  • Save the cache and load it later
  • Plugins

:bug: Bug Fixes

  • ~~Filter chaining will work once more~~ (this was fixed in 7.5.0)

License

Squirrelly is licensed under the MIT license.