Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
:warning: Maturity Level: Alpha
Minimal CLI utility to generate files using edge.js templates
pnpm i -g edgejs-cli
# ^ Will add an edget utility to PATH
# Render a single template
edget -i templates/home.edge -o site
# ^ Generates site/home.html by rendering home.edge
# Pass data to templates through a JSON/YAML file
edget -i templates/home.edge -o site -d data.json
# ^ Same as above but home.edge can use any values defined in data.json
# Render all templates within a directory (Files prefixed with . or _ are ignored)
edget -i templates -o site -d data.json
# Skip escaping if generating non-html content
edget -i sql-templates -o sql --skipEscaping
It is not necessary that each input file generate exactly one input file, or that the output file name match input file name.
With multi-mode, we can render an output in the following format (inspired by Vue SFC):
<!-- post.multi.edge -->
<file path="post/summary.html">
Here is some summary content
</file>
<file path="post/details.html">
Here are some details
</file>
Note that the file extension needs to be .multi.edge
.
This will generate two files <out-dir>/post/summary.html
with content Here is some summary content
and <out-dir>/post.details.html
with content Here are some details
.
XML parsing happens after the edge template has been rendered,
so not only can the content inside <file>
tags be dynamic, we can also dynamically add <file>
tags too.
So the following is legal:
@each (post in posts)
<file path="post/{{post.slug}}/summary.html">
{{post.title}} - by {{post.author}}
</file>
<file path="post/{{post.slug}}/details.html">
{{post.body}}
</file>
@end
(final output must be valid XML)
It is possible to dedent and trim the content through attributes in the file tag:
<file path="post/summary.html" trim="true" dedent="true">
</file>
This is intended to be a minimal utility that simplifies tasks like below for JS/TS developers comfortable with CLI:
If you don't care about cross-language support, edgejs is easier than Handlebars/mustache/liquid etc. because the embedded expressions are plain JS - so there is less need to learn custom syntax specific to the templating language, and we also have first class support for async.
Also, unlike JSX based solutions, it is more versatile because it is not limited to HTML
:warning: This project has nothing to do with Microsoft edge browser.
FAQs
CLI utility to generate files based on edge templates
The npm package edgejs-cli receives a total of 0 weekly downloads. As such, edgejs-cli popularity was classified as not popular.
We found that edgejs-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.