
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
@geooot/soul-patch
Advanced tools
Generating HTML through means that are not efficient, or safe. But it gets the job done. (and just want's to have a good time!)
A HTML templator with angular like syntax. Generating HTML through means that are not efficient, or safe. Only really good for shady static site generation.
If moustache and handlebars are real templating engines, then soul-patch is it's wierd distant cousin.
$ npm install @geooot/soul-patch
const { renderPage } = require('@geooot/soul-patch');
const template = `
<ul sp-for="let i=0; i<3; i++">
<li sp-assign="text: foo + someFunc(i), class: 'whatever'"></li>
</ul>
`
let rendered = await renderPage({
input: template,
props: {
foo: "The number is: ",
someFunc: (num) => num * 100
}
});
console.log(rendered);
// Results in:
// <ul>
// <li class="whatever">The number is: 0</li>
// <li class="whatever">The number is: 100</li>
// <li class="whatever">The number is: 200</li>
// </ul>
Operators allow you to template html by adding special attributes to your HTML. Here are the available operators:
sp-assign
This property allows you to assign variables to HTML attributes and set HTML.
This template:
<p sp-assign="text: someVariable, class: someBool ? 'text-green' : 'text-red'">Whatever</p>
Results in:
<p class="text-red">I was a string assigned to someVariable</p>
This template:
<p sp-assign="innerHTML: markdownToHTML(markdownInAString)"></p>
Results in:
<p><h1>Here is some raw HTML being injected!!!</h1><p>wowzers</p></p>
sp-for
Defines how you can create a loop of elements.
This template:
<ul sp-for="let i=0; i<10; i++">
<li sp-assign="text: i, class: 'whatever'">
Anything can go here but it will probably be replaced on render
</li>
</ul>
Results in:
<ul>
<li class="whatever">0</li>
<li class="whatever">1</li>
<li class="whatever">2</li>
<li class="whatever">3</li>
<li class="whatever">4</li>
<li class="whatever">5</li>
<li class="whatever">6</li>
<li class="whatever">7</li>
<li class="whatever">8</li>
<li class="whatever">9</li>
</ul>
This template
<div sp-for="item of listOfObjects">
<p sp-assign="text: item.name, id: item.id">Whatever</p>
</div>
Results in
<div>
<p id="someIdFoo">Foo</p>
<p id="someIdBar">Bar</p>
<p id="someIdWiz">Wiz</p>
</div>
sp-render-if
Renders an item if a certain condition is true
This template:
<p sp-render-if="10 < 100">Turns out 10 is less than 100 so this will render</p>
<p sp-render-if="myIQ > averageIQForAge(19)">But my IQ is below average so this will not render</p>
Results in:
<p>Turns out 10 is less than 100 so this will render</p>
FAQs
Generating HTML through means that are not efficient, or safe. But it gets the job done. (and just want's to have a good time!)
We found that @geooot/soul-patch 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.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
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.