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.
rollup-plugin-eta
Advanced tools
Rollup.js template loader plugin for η (Eta). Supports loading of any files with proper Eta content.
Using NPM:
npm install rollup-plugin-eta --save
Create a rollup.config.js
configuration file and import the plugin:
// rollup.config.js
import eta from 'rollup-plugin-eta';
rollup({
entry: 'main.js',
output: [
{
dir: 'dist',
format: 'esm'
},
],
plugins: [
eta({
include: ['**/*.eta', '**/*.html'], // optional, '**/*.eta' by default
exclude: ['**/index.html'], // optional, undefined by default
data: {
name: 'John Doe'
}, // optional, default template data
etaConfig: {
tags: ['<%', '%>']
} // optional, eta configuration
}),
],
});
In your app you can then import your template and render its content, e.g.:
// main.js
import tpl from './tpl.eta';
console.log(tpl({ age: 42 }));
If your template file (tpl.eta
) looks as follows:
<p>Hello 👋 , my name is <%= it.name %> and I am <%= it.age %> year old ✨</p>
Then, your compiled file would return:
$ node ./dist/main.js
<p>Hello 👋 , my name is John Doe and I am 42 year old ✨</
The following options are unique to rollup-plugin-eta
:
include
Type: String
| Array[...String]
Default: ['**/*.eta']
A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on. By default all **/*.eta
files are targeted.
exclude
Type: String
| Array[...String]
Default: []
A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
data
Type: Object
Default: null
A default set of data inputs for the template.
etaConfig
Type: Object
Default: null
The default Eta configuration object (Eta.config
).
You have an idea on how to improve the package, please send us a pull request! Have a look into our contributing guidelines.
Running into issues or are you missing a specific usecase? Feel free to file an issue.
Copyright 2021 © Stateful – Apache 2.0 License
FAQs
Eta loader plugin for rollup.js
The npm package rollup-plugin-eta receives a total of 7 weekly downloads. As such, rollup-plugin-eta popularity was classified as not popular.
We found that rollup-plugin-eta 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
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.