Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
config-expander
Advanced tools
Readme
Expands expressions in config files
import { expand } from "config-expander";
// expanding hole expressions at the value position (result key is a number)
expand({ key: "${value + 1}" }, { constants: { value: 77 } }).then(r =>
console.log(JSON.stringify(r))
);
// calculate port numbers
expand({ constants: { base: 10000 }, http: { port: "${base + 1}" } }).then(r =>
console.log(JSON.stringify(r))
);
// load config from file
expand("${include('tests/fixtures/other.json')}").then(r =>
console.log(JSON.stringify(r))
);
{ "key" : 78 }
{ "constants": { "base": 10000 }, "http": { "port": 10001 }}
{ "key": "value from other" }
const configuration await expand("${include('" + '/path/to/the/config.json' + "')}")
{
"ca": "${document(os.home + '/ca.pem')}"
}
{
"http-port": "${base + 0}",
"https-port": "${base + 1}"
}
{
"copy-cmd": "${os.platform == 'win32' ? 'copy' : 'cp'}"
}
Predefined constants
Type: Object
env
Object environment variables from process.envos
Object os modulebasedir
string filesystem configuration start pointExpands expressions in a configuration object
Returns Promise resolves to the expanded configuration
Type: Object
Type: Function
Type: Object
knwon functions
Include definition form a file.
file
string file name to be includedReturns string content of the file
Replace string.
source
string input valueReturns string replaced content
Convert string into upper case.
source
string input valueReturns string uppercase result
Convert string into lower case.
source
string input valueReturns string lowercase result
Split source string on pattern boundaries.
Returns Array<string> separated source
Encrypt a plaintext value.
Returns string encrypted value
Decrypt a former encrypted string.
Returns string plaintext
Call executable.
Returns string stdout
merge from b into a When a and b are arrays of values only the none duplaces are appendend to a
a
any b
any Returns any merged b into a
With npm do:
npm install config-expander
BSD-2-Clause
FAQs
Expands expressions in config files
The npm package config-expander receives a total of 645 weekly downloads. As such, config-expander popularity was classified as not popular.
We found that config-expander demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.