
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
@golevelup/profiguration
Advanced tools
Profiguration is currently built on top of the rock solid Convict configuration library from Mozilla. It helps you acheive 12Factor compliant application configuration by putting a focus on leveraging environment variables in a type safe way while enabling you to load configuration from .env and .json files for convenience during development.
npm install ---save @golevelup/profiguration
or
yarn add @golevelup/profiguration
The interface should represent the object stucture for you you would like to access the configuration for your app. It can be a complex object with nested values and different types
For example:
interface Config {
db: {
password: string;
host: {
url: string;
port: number;
};
};
appPort: number;
globalPrefix: string;
controllerPrefix: string;
showWelcomeMessage: boolean;
}
The createProfiguration factory method takes a schema that indicates how the various properties of your configuration interface should be loaded from the process environment. See the convict documentation for additional options and documentation.
The second argument configures profiguration with options for logging, validation and relative file loading paths as well as a user provided function configureEnv which allows for per environment overriding of the profiguration options as well as files that should be loaded which contain configuration values.
import { createProfiguration } from '@golevelup/profiguration';
export const config = createProfiguration<Config>(
{
appPort: {
default: 3333,
env: 'APP_PORT'
},
db: {
password: {
default: null,
format: String,
env: 'DB_PASSWORD'
},
host: {
url: {
default: '',
env: 'DB_HOST_URL'
},
port: {
default: -1,
format: 'port',
env: 'DB_HOST_PORT'
}
}
},
globalPrefix: {
default: 'api',
env: 'GLOBAL_PREFIX'
},
controllerPrefix: {
default: '',
env: 'CONTROLLER_PREFIX'
},
showWelcomeMessage: {
default: true,
env: 'WELCOME_MESSAGE'
}
},
{
strict: true,
verbose: true,
loadRelativeTo: 'parent-module',
configureEnv: env => ({
files: `${env}.env`
})
}
);
FAQs
## About
The npm package @golevelup/profiguration receives a total of 3,277 weekly downloads. As such, @golevelup/profiguration popularity was classified as popular.
We found that @golevelup/profiguration 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
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.