Socket
Book a DemoInstallSign in
Socket

@automattic/create-calypso-config

Package Overview
Dependencies
Maintainers
62
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/create-calypso-config

Creates the calypso configuration api.

latest
Source
npmnpm
Version
1.0.0-alpha.0
Version published
Maintainers
62
Created
Source

Create Calypso Config

This package exports a single function which takes config data and returns the config object used around Calypso.

This was extracted from lib/create-config.

ConfigApi interface

The API returned by createConfig is as follows. It is a function extended with a handful of useful features-oriented functions.

config( key )

Returns the value for the given configuration key.

const value = config( key );

config.isEnabled( key )

Is a feature enabled?

if ( config.isEnabled( 'myFeature' ) ) {
	// do something only when myFeature is enabled
}

config.enabledFeatures()

Gets the list of enabled features.

const enabledFeatures = config.enabledFeatures();

config.enable( key )

Enable a feature.

config.enable( 'myFeature' );

config.disable( key )

Disable a feature.

config.disable( 'myFeature' );

FAQs

Package last updated on 21 Mar 2025

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