Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
embedded-ts
Advanced tools
A port of EJS to support embedded TypeScript.
import * as ets from 'embedded-ts';
console.log(
await ets.render(`
<%
let x: string
x = "hello";
%>
<%= x %>
`)
);
// Outputs: "hello"
For simplicity and consistency, all render functions are now asynchronous, so there is no async
option. This also means that include
functions now return promises, so to include another .ets
file, you must use await include('path/to/ets/file')
.
Because this package depends on esbuild
to transpile TypeScript code, it's suboptimal to provide client-accessible functions since that would require loading esbuild
into a browser. Thus, there is no client
option in ETS.
The with
statement is now always used internally to expose provided data to the template. Thus, the _with
and destructuredLocals
options have been removed.
The strict
option has been removed; all templates are now executed in the context of a strict-mode asynchronous IIFE.
The option to set global delimiters, opening brackets, and closing brackets through ets.delimiter = '?'
has been removed. Instead, pass the delimiter to each render function or create a wrapper function.
FAQs
Embedded TypeScript.
The npm package embedded-ts receives a total of 5 weekly downloads. As such, embedded-ts popularity was classified as not popular.
We found that embedded-ts demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.