
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
es6-string-html-template
Advanced tools
It is a brief HTML template using ES6 string template.
npm install --save es6-string-html-template
import {html, escape, raw} from 'es6-string-html-template'
function renderArticle({title, content, author, date}){
return html`
<article>
<h1>${title}</h1>
${raw(content)}
<footer>${author} created at ${date}</footer>
</article>`
}
let articleHtml = renderArticle({
title: `Jim's daily`,
content: `<ol>
<li>Open computer</li>
<li>Write <code>console.log("Hello world!")</code>
</li>
</ol>`,
author: 'Tom',
date: '2017-04-01',
})
console.log('' + articleHtml)
// output:
// <article>
// <h1>Jim's daily</h1>
// <ol>
// <li>Open computer</li>
// <li>Write <code>console.log("Hello world!")</code>
// </li>
// </ol>
// <footer>Tom created at 2017-04-01</footer>
// </article>
const {html, escape, raw} = require('es6-string-html-template')
function renderArticle(data){
return html`
<article>
<h1>${data.title}</h1>
${raw(data.content)}
<footer>${data.author} created at ${data.date}</footer>
</article>`
}
let articleHtml = renderArticle({
title: `Jim's daily`,
content: `<ol>
<li>Open computer</li>
<li>Write <code>console.log("Hello world!")</code>
</li>
</ol>`,
author: 'Tom',
date: '2017-04-01',
})
console.log('' + articleHtml)
// output:
//
// <article>
// <h1>Jim's daily</h1>
// <ol>
// <li>Open computer</li>
// <li>Write <code>console.log("Hello world!")</code>
// </li>
// </ol>
// <footer>Tom created at 2017-04-01</footer>
// </article>
FAQs
A brief HTML template using ES6 string template
We found that es6-string-html-template 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.