Dictionaries.addKey()

Add a new key to a dictionary.

Usage

Hover over inputs/exits for more info.

var Dictionaries = require('machinepack-dictionaries');


// Add a new key to a dictionary.

Dictionaries.addKey({

dictionary: {},

newKey: 'twitterUsername',

value: '*',

force: true,

}).execSync();

Inputs

dictionary required

The dictionary where the new key will be added.

{}
newKey required

A name for the new key.

'twitterUsername'
value required

The value to associate with the new key.

'*'
force

Whether to overwrite an existing key with the same name if there is a conflict.

true

Exits

error

An unexpected error occurred.

keyAlreadyExists

An existing key is already using the specified name for the new key.

success

OK.

(varies based on provided inputs)