
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
tasap.js is a HTML-Template-Engine meant to build modular HTML-Templates as soon fast as possible. Its syntax is compatible with, and falls back to basic HTML. tasap.js allows no conditional templates and only provides minor options for interpolation. tasap.js allows reusable and nested Modules/Components with an extremely low learning curve, resulting in faster prototyping, efficient preparations and seamless integration.
Reusable Modules get defined with the <Module name="ModuleName">
Tag. The tags-attributes get loaded into the Modules local state and can recieve data on module initialisation. -> ./modules/offer.html
<Module name="Offer" title="no title set" description="no description" link="#no-link">
<article class="offer">
<h3>{{ state.title }}</h3>
<p>
{{ state.description }}
</p>
<a href="{{ state.link }}">Buy now!</a>
</article>
</Module>
A Module can have unlimited children of any type (tags, text or modules). These are automatically loaded into the local state and can be rendered by invoking Block()
or state.Block()
. -> ./modules/row.html
<Module name="Row">
<div class="row">
{{ Block() }}
</div>
</Module>
tasap.js offers two ways to interact with data. {{ }}
evaluates the expression and renders its value into the html (see above). {{# }}
on the other end, does not get rendered into the html. -> ./modules/column.html
<Module name="Column" sizes>
{{# state.sizes = utils.prefixArray(utils.toArray(state.sizes), 'size-') }}
<div class="column {{ state.sizes.join(' ') }}">
{{ Block() }}
</div>
</Module>
Modules can be defined anywhere inside the HTML-File. If you move the modules to individual files like I did in this example. You can use {{@ }}
to load files or directories dynamically.
Individual modules get invoked by using their name as the html-tag. -> ./index.html
{{@ ./modules/*.html }}
<Row>
<Column sizes="small-12 medium-3 large-7">
<Offer title="Car 1" description="This car is amazing" link="/link-to-car1.html"></Offer>
</Column>
<Column sizes="small-12 medium-3 large-7">
<Offer title="Car 2" description="This car is amazing too" link="/link-to-car2.html"></Offer>
</Column>
</Row>
The above example renders into the following HTML Content.
<div class="row">
<div class="column size-small-12 size-medium-3 size-large-7">
<article class="offer">
<h3>Car 1</h3>
<p> This car is amazing </p>
<a href="/link-to-car1.html">Buy now!</a>
</article>
</div>
<div class="column size-small-12 size-medium-3 size-large-7">
<article class="offer">
<h3>Car 2</h3>
<p> This car is amazing too </p>
<a href="/link-to-car2.html">Buy now!</a>
</article>
</div>
</div>
tasap.js uses a special attribute identifier prefixed with @
. Currently the only use for these attributes are dynamic changing of html tagnames.
All attributes starting with @
will not get rendered in the finished html.
Using the @tag
attribute replaces its tagname with the attribute value if it is not empty or undefined
.
<Module name="MyModule" tag>
<div @tag="{{ state.tag }}"></div>
</Module>
<MyModule></MyModule>
<MyModule tag="article"></MyModule>
<MyModule tag="section"></MyModule>
<div></div>
<article></article>
<section></section>
tasap.js comes with a small utils API of utility functions helping processing and modifying state.
// Transform a string to an array
utils.toArray(string, 'delimiter')
// Prefix every string in an array
utils.prefixArray(array, 'prefix')
// Suffix every string in an array
utils.suffixArray(array, 'suffix')
This utils API gets exposed outside of the internal tasap-workflow. This allows you to use these methods outside of tasap.js and mainly extend the utility class with custom static variables and methods.
const tasap = require('tasap');
tasap.utils.myFunction = function(){
return 'Hello World';
}
tasap.utils.myVariables = 123;
and in the tasap html-files
<Module name="MyModule">
<p> Function: {{ utils.myFunction() }} </p>
<p> Variable: {{ utils.myVariables }} </p>
</Module>
<MyModule></MyModule>
<p> Function: Hello World </p>
<p> Variable: 123 </p>
const tasap = require('tasap');
// Compiling single fiels or content
tasap.get(['header.html', 'index.html', 'footer.html']); // Compiles all files into one files and returns the result
tasap.get('<div></div>'); // Compiles the given Content
// Compiling multiple files
tasap.getAll(['header.html', 'index.html', 'footer.html']); // Compiles all files into sepearte fiels and returns the array
// Compile and write file
tasap.writeFile(['index.html'], 'dist/index.html'); // Writes the compiled file to the target directory
tasap.writeFile('<div></div>', 'dist/index.html'); // Compiles the given Content and writes it to the target directory
tasap.writeAll('templates/*.html', 'dist/'); // Compiles all matching files to the target directory
FAQs
Barebones Template Engine for static HTML files
The npm package tasap receives a total of 4 weekly downloads. As such, tasap popularity was classified as not popular.
We found that tasap 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 Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.