
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
closure-templates-compiler
Advanced tools
closure-templates-compiler
Simple javascript module that uses java-bridge
under the hood to compile a string written in google closure templates language to javascript.
It also contains a small java project (which is published as a jar), because the compiler for google closure templates is written in java. The java is just a wrapper to invoke the API of the closure templates compiler directly rather than use the CLI version.
npm install --save closure-templates-compiler
import { compileSoyToJs, compileSoyToJsSync } from "closure-templates-compiler";
const soyCode = `
{namespace soy.examples.simple}
{template helloWorld}
{msg desc="Says hello to the world."}
Hello world!
{/msg}
{/template}
`;
const filename = "foobar.soy";
const jsCodeString = await compileSoyToJs(soyCode, filename);
const jsCodeStringAlternate = compileSoyToJsSync(soyCode, filename);
In:
{namespace soy.examples.simple}
{template helloWorld}
{msg desc="Says hello to the world."}
Hello world!
{/msg}
{/template}
Out:
goog.provide('soy.examples.simple');
goog.require('goog.soy');
goog.requireType('goog.soy.data.SanitizedHtml');
goog.require('soy');
soy.examples.simple.helloWorld = function (opt_data, opt_ijData) {
const $ijData =opt_ijData;
if (goog.soy.shouldStub && goog.soy.shouldStubAtRuntime() && soy.examples.simple.helloWorld_soyInternalStubs) {
return soy.examples.simple.helloWorld_soyInternalStubs(opt_data, $ijData);
}
if (goog.DEBUG && soy.$$stubsMap['soy.examples.simple.helloWorld']) {
return soy.$$stubsMap['soy.examples.simple.helloWorld'](opt_data, $ijData);
}
return soy.VERY_UNSAFE.ordainSanitizedHtml('Hello world!');
};
if (false) {
soy.examples.simple.helloWorld_soyInternalStubs;
}
if (goog.DEBUG) {
soy.examples.simple.helloWorld.soyTemplateName = 'soy.examples.simple.helloWorld';
}
FAQs
Unknown package
We found that closure-templates-compiler 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.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.