
Security News
minimatch Patches 3 High-Severity ReDoS Vulnerabilities
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.
npm-roscoemon
Advanced tools
Uses JavaScript string interpolation to parse template literals (template strings) to HTML, and vice versa.
Download or clone this repo then install with your package manager.
yarn add html-micro-templates
or
npm i html-micro-templates
Import the package into your code
var microHTML = require('html-micro-templates')
or
import microHTML from 'html-micro-templates'
To generate HTML elements from template strings, use the stringToElement function.
const stringToConvert = 'There should be a ${buttonElement} here.'
microHTML.stringToElement({
string: stringToConvert, // The string to parse
value: 'Button Text', // The inner HTML of the element
}, 'button' // The element to generate
)
// returns the following:
// There should be a <button class='variable buttonElement'>Button Text</button> here.
You can parse HTML to extact template strings based on the elements' class by using the elementToString function.
const htmlToConvert = `There should be a <button class='variable buttonElement'>Button Text</button>
here, and a <section class='variable sectionElement'>section</section> here.`
microHTML.elementToString(htmlToConvert)
// returns the following:
//'There should be a ${buttonElement} here, and a ${sectionElement} here.'
The parseHTML function will return an array of template strings.
const htmlToConvert = `<span class='variable spanElement'>There should be a
<button class='variable buttonElement'>Button Text</button> here.</span>`
microHTML.parseHTML(htmlToConvert)
// returns the following:
// ["spanElement", "buttonElement"]
Optionally, you can pass true to the second parameter of the parseHTML function, and it will return the template strings with the standard JavaScript template delimiters.
microHTML.parseHTML(htmlToConvert, true)
// returns the following:
// ["${spanElement}", "${buttonElement}"]
FAQs
This is similar to nodemon
We found that npm-roscoemon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.

Research
/Security News
Socket uncovered 26 malicious npm packages tied to North Korea's Contagious Interview campaign, retrieving a live 9-module infostealer and RAT from the adversary's C2.

Research
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.