
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
acetate-folder
Advanced tools
Custom Nunjucks tag that iterates over all the files in a folder.
npm install acetate-folder --save
In your acetate config, which usually resides at acetate.conf.js
add the following to initialize the folder tag:
var folder = require('acetate-folder');
function config(acetate) {
acetate.use(folder());
}
module.exports = config;
Now, in your templates, you can use the folder tag, passing it a glob pattern:
{% folder './*.svg' %}
<div class="FILENAME">FILENAME</div>
{% endfolder %}
This will iterate over every file from your current folder (relative to where the acetate config is) with an extension of .svg
. By default the tag doesn't show files that begin with .
.
The code inside the {% folder %}
tag will be repeated for each file in the folder. Every occurrence of FILENAME
will be replaced by the filename of each file.
For example, if you had the following directory located at /fruit-pics
:
.hidden.svg
bananas.svg
apples.svg
fruit.svg
sub-directory/
And you used the following folder tag:
{% folder './fruit-pics/*.svg' %}
<div class="FILENAME">FILENAME</div>
{% endfolder %}
You'd have the following html when you built your site with Acetate:
<div class="apples">apples</div>
<div class="bananas">bananas</div>
<div class="fruit">fruit</div>
These are returned in alphabetical order with filenames that start with a capital letter being before lowercase filenames.
I think there are a number of options you could make configurable inside the tag itself, like:
.
Pull requests are welcome! Just do your best to maintain the spaces, quotes, syntax, etc of the existing code and we should be good.
FAQs
Custom nunjucks tag that iterates over all the files in a folder
The npm package acetate-folder receives a total of 0 weekly downloads. As such, acetate-folder popularity was classified as not popular.
We found that acetate-folder 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.