$ cnpm install @itexpert-dev/keyvalue-cli
$ npm install --global @itexpert-dev/keyvalue-cli
kvs --help
in terminal for help./kvs.json
is used by default.
You can change the path with --config
option.
For the list of available options see Config section below.See
kvs --help
for the list of available commands. Seekvs <command> --help
for additional information about the command.
Available options:
Bearer
or Basic
){
"host": "http://localhost:6480",
"auth": {
"schema": "Bearer",
"value": "token"
}
}
// Script is executed in Node environment,
// so no `export` syntax, use `module.exports` instead.
module.exports.view = {
// Migrated set name
set: 'view',
// Script version
version: '0.1.0',
// Function to transform one key-value from specified set.
// If same key-value, null or undefined returned, key-value stays in the store stays the same.
// If if `{key, value: null}` is returned, key-value is removed from the store.
map({key, value}) {
return {key, value};
}
};
const stringField = {type: 'string'};
module.exports.view = {
set: 'view',
version: '0.1.0',
map({key, value}) {
value = {'a': 123};
return {key, value};
},
schema: {
type: 'object',
required: ['data'],
properties: {
data: {
type: 'object',
properties: {
id: stringField,
name: stringField,
isShared: {type: 'boolean'},
fields: {
type: 'array',
item: stringField
}
}
}
},
additionalProperties: true
}
};
Copyright 2014 - 2016 © taobao.org |