
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Combines nconf, recurpolate, and declarative JSON "extends"
syntax to create an extremely useful configuration loader.
All the value packed into appfig
is demonstrated in ./example
, which is summarized for your reading below. appfig
is compatible with Node 8+. Enjoy.
config/default.json
{
"port": 3000,
"logLevel": "debug",
"services": {
"users": "http://${host}/users"
}
}
config/development.json
{
"extends": "default",
"host": "dev.example.com"
}
config/production.json
{
"extends": "default",
"port": 3001,
"logLevel": "info",
"host": "www.example.com"
}
index.js
process.env.APP_ENV = process.env.APP_ENV || 'development';
const { APP_ENV } = process.env;
const config = require('appfig')(__dirname + `/config/${APP_ENV}.json`);
console.log(config.get('port'));
console.log(config.get('logLevel'));
console.log(config.get('services:users'));
Starting your application with development configuration
$ node index.js
3000
trace
http://dev.example.com/users
Starting your application with production configuration
$ APP_ENV=production node index.js
3001
info
http://www.example.com/users
appfig
is released under the MIT License.
FAQs
An extremely useful configuration loader.
The npm package appfig receives a total of 3 weekly downloads. As such, appfig popularity was classified as not popular.
We found that appfig 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 Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.