Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@unifig/env
Advanced tools
npm i @unifig/env
# or
yarn add @unifig/env
# .env
PORT=3000
export class Settings {
@From('PORT')
@IsInt()
port: number;
}
import { Config } from '@unifig/core';
import { EnvConfigAdapter } from '@unifig/env';
async function bootstrap() {
await Config.register({
template: Settings,
adapter: new EnvConfigAdapter(),
});
console.log(Config.get(Settings).port); // output: 3000
}
bootstrap();
Environment variables are mapped to 1D dictionary.
# .env
PORT=3000
DB_HOST=localhost
DB_PORT=4588
// adapter output
{
PORT: 3000,
DB_HOST: 'localhost',
DB_PORT: 4588
}
Property | What it does | Required |
---|---|---|
envFilesPaths | Path to optional environment files to be loaded in given order. Values from them will be overwritten by process envs. | × |
ignoreEnvVars | If "true", environment variables will not be loaded. | × |
expandVariables | See https://www.npmjs.com/package/dotenv-expand. | × |
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Environmental variables adapter for unifig
The npm package @unifig/env receives a total of 0 weekly downloads. As such, @unifig/env popularity was classified as not popular.
We found that @unifig/env 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.