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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tiago_silva_pereira/vemto-template-engine

v4.0.3

Published

Vemto Template Engine

Readme

SilverB

Introduction

SilverB is a template engine, but made for code and text generation and to be used with PWC Code Generator. In the past, I tested some template engines with PWC, like Handlebars, Dot and others. But these template engines are made for another purpose (HTML templates) and, because of it, I decided to make my own template engine.

SilverB can be used for any dynamic text generation and accepts all Javascript syntaxes inside your special tags.

Installation

To use SilverB in your own project, install it using npm:

npm install silverb --save

And import it on your script:

const SilverB = require('silverb');

Finally, build something amazing! :D

Example

Let's consider we have this data:

var data = {
    name: 'Tiago Silva Pereira Rodrigues',
    projects: [
        'PWC', 'SilverB', 'Rapid Mockup', 'Stop It'
    ]
}

And we have this text template:

var template = `
Hi, I'm <$ this.name $>.

I created these projects:

<# It is a comment #>
<% for (let project of this.projects) { %>
    - <$ project $>
<% } %>
`;

As you can see, we can attach the data object to the template scope and can access it using this. Any javascript command is accepted inside <% %> tags.

Then we can compile the template:

const SilverB = require('silverb');

// The data object can be passed to the template on the compile method
var result = new SilverB(template).compile(data); 

The result will be:

Hi, I'm Tiago Silva Pereira Rodrigues.

I created these projects:

    - PWC
    - SilverB
    - Rapid Mockup
    - Stop It

See this example running here.

Tags

At this moment, SilverB has four different tags that can be used. All the text outside these tags will be generated without modifications, keeping the indentation and break lines.

The tags are:

  • <# #> - Used for line comments
  • <$ $> - Used to show variables or expression values. Commands inside these tags will be executed and transformed into text
  • <up up> - It is like <$ $>, but will put the result on the previous line (only if the tags are at the start of a new line)
  • <% %> - Used for javascript logic blocks like if, for, etc. Commands inside these tags will not be transformed to text. Accepts all javascript syntax.

Examples:

<# It is a comment and will not be transformed to text #>

<# Showing a value - will convert to something like "Tiago Rodrigues" #>
<$ this.name $>

---------------

<# Showing an expression return - will convert to something like "User", or "Role", etc #>
<$ this.model.getName() $>

---------------

<# The second sentence will be generated on the previous line - will result in something like "Tiago Rodrigues - Tiago Rodrigues" #>
<$ this.name $> -
<up this.name up>

---------------

var data = true;

...

<# If this.data is equal true #>
<% if(this.data == true) { %>
    Hi, I'm here!!
<% } %>

Helpers

Helpers are methods on the template scope that you can call conditionally to make specific text operations. The currently available helpers are:

removeLastBreakLine - It will remove the last break line on the text. Eg:


var data = true;

...

<# Template #>

Something here...

<% if(this.data == true) { %>
    <% this.removeLastBreakLine(); %> <# Will remove the break line after "Something here..." #>
<% } %>

Syntax Highlighter

We have a simple SilverB Syntax Highlighter for VSCode here. If you want, you can create a syntax highlighter for your preferred editor and add on this Readme.

The syntax highlighter will work on files with .silverb extension.

License

MIT