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.
Compile a given Embedded RuBy (ERB) template using variables and functions defined in given a JavaScript object
Compile a given Embedded RuBy (ERB) template using variables and functions defined in given a JavaScript object.
npm install --save erb
Executing
const erb = require('erb');
const data = {
"fields": {
"first": "Morty",
"second": "Rick"
},
"values": {
"additions": "with pattie, breaded and fried"
},
"functions": {
"title": [
[
1,
"One Chicken Fried Steak"
],
[
2,
3,
"Two or Three Chicken Fried Steaks"
]
]
}
}
erb({
timeout: 5000,
data: data,
template: '<%= @first %> had <%= title(1) %> <%= additions %>.\n<%= @second %> had <%= title(2, 3) %> <%= additions %>.'
}).then(console.log, console.error);
would result in
Morty had One Chicken Fried Steak with pattie, breaded and fried.
Rick had Two or Three Chicken Fried Steaks with pattie, breaded and fried.
erb(opts)
opts
is a simple JSON object with these properties:
timeout
(optional, integer) - number of milliseconds (defaults to 5000) to wait for the template evaluation to finish before terminating with errordata
(optional, object) - an object that contains these properties:
fields
(optional, object) - the keys of this object are instance variable names to be used in the ERB template and values are the values of the instance variablesvalues
(optional, object) - the keys of this object are variable names to be used in the ERB template and values are the values of the variablesfunctions
(optional, object) - the keys of this object are function names to be used in the ERB template and values are special arrays - the items match the function call arguments with the last item being the value returned by the function when called with these arguments.template
(required, string) - the ERB template to be compiledRequires Bundler.
npm run build
FAQs
Compile a given Embedded RuBy (ERB) template using variables and functions defined in given a JavaScript object
The npm package erb receives a total of 21,431 weekly downloads. As such, erb popularity was classified as popular.
We found that erb 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.