
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
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 15 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 News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.