Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
variable-replacer
Advanced tools
The simplest templating engine: only replace variables in files
The simplest templating engine: replace variables in files
Surround variables names by percents. Supports nested variables Works with any text file.
the value of var1 variable is: %var1%
the value of the key1 attr of var2 is %var2.key1%
Replace with values from either inline data or json file(s).
npm install -g variable-replacer
variable-replacer sourcepath1 [sourcepath2 sourcepath3] destpath --data=datasource.json [--data-myvarname=value]
npm install variable-replacer
require('variable-replacer')({
source: 'source/path',
dest: 'dest/path',
dataSource: 'data.json',
inlineData: {
var1 : 'val1',
var2 : {
key1: 'val2'
}
}
})
Mandatory Type: String or array of String Note: glob pattern supported
Files to process (input files)
Mandatory Type: String
Destination file or directory, where output file will be written.
Optional Type: String or array of String
Path(s) of json file(s) containing source of data for variable replacement.
Optional Type: Object
Inline source of data for variable replacement
Optional Type: String or RegExp
The Regular Expresssion used to match variables.
The first group must return the variable path.
Defaults to /%([\w._-]+)%/g
Optional Default: info Type: "debug", "info", "warn", "error", "none"
Change logging level
Pull requests are welcome
FAQs
The simplest templating engine: only replace variables in files
The npm package variable-replacer receives a total of 90 weekly downloads. As such, variable-replacer popularity was classified as not popular.
We found that variable-replacer 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.