
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
painless-config
Advanced tools
Low friction library for application configuration.
There were 14 configuration libraries so we needed to build one to unify them all, there are now 15 configuration libraries.
From: https://xkcd.com/927/
In all seriousness, we were looking for a configuration library that had the following traits:
Add a dependency to the npm package:
npm install painless-config --save
Require the module and then retrieve the configuration settings you want:
var config = require('painless-config');
var widgetPath = config.get('WIDGET_PATH');
You can also retrieve all settings as a complex object:
var allSettings = config.all();
Any - or _ in the environment variable's name will be used to create the object's structure. For example, given these environment variables:
RECT_WIDTH=16
RECT_HEIGHT=9
This object would be returned:
{
"RECT": {
"WIDTH": 16,
"HEIGHT": 9
}
}
Configuration settings will be resolved in this order:
If an environment variable cannot be found then the library will begin walking up the tree from the current working directory until it finds an env.json file.
The env.json must have the following structure:
{
"setting1": "value1",
"setting2": "value2"
}
Pull requests that honor the traits above will gladly be considered!
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
FAQs
Low friction library for application configuration.
The npm package painless-config receives a total of 1,669 weekly downloads. As such, painless-config popularity was classified as popular.
We found that painless-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.