Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
slim-lang-loader
Advanced tools
This is a webpack loader to transform slim files into HTML, and then load that HTML into Javascript. This is "true blue" slim, using the ruby program's CLI executable.
The resulting HTML does not have any boiler added - it can be full HTML documents or just partials / fragments.
The code here is a modified version of coffee-loader.
Make sure the slim
gem is installed and there is a slimrb
executable available.
Install this into your project: npm install --save slim-lang-loader
(or yarn add -D slim-lang-loader
)
Add hook to webpack.config.js
(make sure to put this above any loader
that expects javascript or coffeescript input):
{test: /\.slim$/, loader: ['slim-lang-loader']},
Also, add .slim
to the list of extensions:
resolve: {
extensions: ['.js", <etc>, ".slim"]
},
load templates from javascript:
var file = require("html-loader!./test.slim");
alert(file); // this will be a html string that auto-reloads
You can pass Slim options to slimrb using following syntax:
loader: [
{
loader: 'slim-lang-loader',
options: {
slimOptions: {
'disable_escape': true
}
}
}
]
FAQs
webpack loader for slim => html => js
The npm package slim-lang-loader receives a total of 6,060 weekly downloads. As such, slim-lang-loader popularity was classified as popular.
We found that slim-lang-loader 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.