
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
snyk-config
Advanced tools
Loads the configuration for your module.
Although you can require this module directly, it's recommended you create your
own config.ts
file that can be cached by the require system and called without a path:
// config.ts
import { loadConfig } from 'snyk-config';
export const config = loadConfig('<directory with config files>');
// in app.ts
import { config } from './config';
// in foo.ts
import { config } from './config'; // matches config in app.ts
The config loader will look for the following values in order of priority, specifically, if a property appears in multiple layers of config (below) the first found is used:
SNYK_
config.secret.json
file in the path specified by:
secretConfig
option, orCONFIG_SECRET_FILE
, orconfig.${SERVICE_ENV}.json
file in the specified config directory,
SERVICE_ENV
defaults to local
, if not setconfig.default.json
file in the specified config directory{
"from": "file"
}
import { loadConfig } from 'snyk-config';
// as we're in the same directory as the config.local.json, there's no arg
const config = loadConfig();
console.log(config);
$ SNYK_from=cli node app.js
=> { from: "cli" }
strings
or boolean
s. This is important to differentiate from values parsed in the config files
as these can be numbers
.SNYK_
string, so SNYK_foo = 10
becomes foo = "10"
SNYK_foo__bar = 10
becomes foo = { bar: "10" }
parseEnvValues
option, or by setting
the CONFIG_PARSE_ENV_VALUES
environment variable.FAQs
Config setup for snyk shared across projects
We found that snyk-config 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.