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

templeo

v1.0.0

Published

Micro template engine with cache and debugging support

Downloads

39

Readme

templeo

npm version Build Status Dependency Status Dev Dependency Status

Template Literals Engine

templeo is a 0️⃣ dependency template engine that uses built-in JavaScript/ECMAScript Template Literals. No Regular Expressions parsing or special syntax in templates here! Just 💯% built-in ES Template Literals!

For more details check out the tutorials and API docs!

Features

  • 💯% PURE No special syntax required! Everything is baked into the ECMAScript Template Literals specification itself! And since templeo/Template Literals are output-agnostic, a single Engine instance can output virtually any format (e.g. HTML, DOM Nodes, JSON, YAML, etc.).
  • 🌱 Grows with the language No need to update templeo when new features are added to the Template Literal spec. Any feature/syntax changes available within Template Literals are available for immediate use!
  • 🌐 Stand-Alone Rendering When a template is compiled into a rendering function it's no longer dependent upon templeo internals to render output - making rendering functions fully portable! Rendering functions can even be serverd from an HTTP server or any other source without any dependencies or references back to templeo!
  • 🛡️ Secure Since templeo does not have any special parsing syntax it does not suffer from syntax-specific injections. Compilation is also locally sandboxed to ensure that scope is isolated to global variable access (and require when available). Since rendering is stand-alone and portable, it is completely isolated from any scope other than the scope in which it is ran!
  • ⛓️ Parameterized/Nested Includes Fragments are reusable and can be included at compile-time and/or render-time using simple Tagged Template Literals. Also, supports passing parameters into included templates where the parameter scope is confined to the partial being included.
  • 🐞 Debugging Compiled templates are accessible directly via the VM sourceURL or through module imports/requires - allowing for seemless debugging capabilities.
  • 🧠 Extensible Template Literals naturally allow for any of your own helper functions to be accessible within the template literal itself as long as they are within scope of the templeo generated rendering function execution (or via registration). And since rendering functions are independent of templeo, included template content can evolve based upon a given context without having to be re-compiled!
  • 🛎️ Auto Fetch By default, template(s) and rendering context can be fetched/requested automatically at compile-time and/or render-time from an HTTP/S server. Also, render-time includes decouples the included template sources from the renderer allowing for newly dicovered template fragments to be included without re-compiling a new renderer!
  • 🏧 Caching By default, templates are cached in-memory for the duration of the Engine/template lifespan. There are a few other extensions that may be more suitable depending upon your needs.
    • IndexedDB (Browser) / LevelDB (Node.js) Recommended when templates need to be persistent between usage. Compiled templates are cached in either an IndexedDB store or a LevelDB store.
    • File System (Node.js) Recommended when running on the server. Compiled templates are cached within the file system and are loaded as modules so they can be debugged just like any other module. If template partials/fragments are used the corresponding files can be registered by providing a base directory to be scanned. The base directory can also be watched for changes that will automaticaly reregister partials with the updated partial content!