
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
A tiny, modern, fast implementation of EJS (Embedded JavaScript Templates). A nearly drop-in replacement for ejs with a few intentional limitations.
<ul>
<% for (let word of locals.items) { -%>
<li><%= word %></li>
<% } -%>
</ul>
const template = yeahjs.compile(ejs);
const output = template({items: ['flour', 'water', 'salt']});
<ul>
<li>flour</li>
<li>water</li>
<li>salt</li>
</ul>
ejsThere are a few key differences that allow yeahjs to be so small and fast:
with keyword in compiled functions).include('header.ejs'), but not include(dir + file)).read and resolve options (see example).Otherwise yeahjs produces identical output to ejs.
const template = yeahjs.compile(ejs, options);
Returns a function of the form (data) => content. Options:
localsName: the namespace to use for accessing template data (locals by default for <%= locals.foo %>).locals: an array of variables to access directly (e.g. ['foo'] will allow <%= foo %> instead of <%= locals.foo %>).context: an object to use as this in templates (null by default).escape: a custom escaping function for values inside <%= ... %> (escapes XML by default).async: if true, generates an async function to make it possible to use await inside templates (false by default).filename: the file name of the template if present (used for resolving includes).read: a function of the form (filename) => content for reading includes (e.g. from file system in Node).resolve: a function of the form (parentPath, includePath) => path for resolving include paths.cache: an object to cache compiled includes in for faster compilation; reuse between compile runs for best performance ({} by default).<%= value %>: output the value (escaped).<%- value %>: output the value (raw).<% code %>: use arbitrary JavaScript.<%_ code %>: use arbitrary JavaScript and strip whitespace on the same line before the tag.... _%>: strip whitespace and a single line break on the same line after the tag.... -%>: strip a single line break immediately after the tag.<%%, %%>: output literal <% or %>.<%# comment %>: comment (ignored).<%- include('path/to/template.ejs', {foo: bar}) %>: include another template, optionally passing data.An example of using read, resolve and filename options in Node.js to process includes:
const {readFileSync} = require('fs');
const {join, dirname} = require('path');
const template = yeahjs.compile(`<%- include('../bar.html') %>`, {
filename: 'foo/foo.html',
resolve: (parent, filename) => join(dirname(parent), filename),
read: filename => readFileSync(filename, 'utf8')
});
FAQs
A tiny, modern implementation of EJS templates
The npm package yeahjs receives a total of 465 weekly downloads. As such, yeahjs popularity was classified as not popular.
We found that yeahjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.