New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nodescript/config

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nodescript/config

Declarative configuration microframework

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-28.57%
Maintainers
2
Weekly downloads
 
Created
Source

Configuration Microframework

Declarative configuration framework for Mesh IoC.

Highlights

  • 🔥 Zero dependencies
  • 🗜 Tidy and compact
  • 💻 Works in browser
  • 🔬 Strongly typed and introspectable
  • 🌳 Ergonomic

Usage

  1. Define and use configs in your classes:
export class MyDatabase {
    @config() DATABASE_USERNAME!: string;
    @config() DATABASE_PASSWORD!: string;
    @config({ default: 10 }) DATABASE_MAX_CONNECTIONS!: number;

    async connect() {
        await this.db.connect({
            username: this.DATABASE_USERNAME,
            password: this.DATABASE_PASSWORD,
            maxConnections: this.DATABASE_MAX_CONNECTIONS,
        });
    }
}
  1. Define Config provider in Mesh:
mesh.service(MyDatabase);
mesh.service(Config, ProcessEnvConfig);
  1. Now DATABASE_* values will be read from process.env.

  2. Enjoy!

FAQs

Package last updated on 15 Dec 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc