Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beyond-js/config

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyond-js/config

A dynamic configuration processor for managing complex configuration objects and collections.

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@beyond-js/config

A dynamic configuration processor for managing complex configuration objects and collections.

Installation

npm install @beyond-js/config

Features

  • Dynamic processing of configuration objects and arrays
  • File-based configuration support
  • Hierarchical configuration structure
  • Error and warning handling
  • Watching for file changes

Usage

const { Config, ConfigCollection } = require('@beyond-js/config');

// Create a configuration object
const config = new Config('/path/to/config/root', {
	applications: 'array',
	'applications/children': 'object'
});

// Set configuration data
config.data = 'config.json';

// Access configuration properties
config.ready.then(() => {
	console.log(config.value);
	console.log(config.errors);
	console.log(config.warnings);
});

// Create a configuration collection
class MyCollection extends ConfigCollection {
	_createItem(config) {
		return new MyItem(config);
	}
}

const collection = new MyCollection(config);

// Process the collection
collection.ready.then(() => {
	console.log(collection.size);
	for (const [key, item] of collection) {
		console.log(key, item);
	}
});

API

Config

  • constructor(rootPath, branchesSpecs)
  • data: Get/set the configuration data
  • value: Get the processed configuration value
  • errors: Get configuration errors
  • warnings: Get configuration warnings
  • valid: Check if the configuration is valid

ConfigCollection

  • constructor(config)
  • config: Get the underlying configuration object
  • errors: Get collection errors
  • warnings: Get collection warnings
  • valid: Check if the collection is valid

License

MIT © [BeyondJS]

FAQs

Package last updated on 14 Sep 2024

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