Skip to content

Latest commit

 

History

History
111 lines (82 loc) · 3.27 KB

API.md

File metadata and controls

111 lines (82 loc) · 3.27 KB

Globalization Pipeline CLI API

API reference

Cli

Command line interface to the Globalization Pipeline. Example usage:

const Cli = require('g11n-pipeline/lib/gpcli');
new Cli(Cli.parseArgs(process.argv)).run().then();

Kind: global class

new Cli(argv)

To use from a script: new Cli(Cli.parseArgs(process.argv))

Param Type Description
argv Object a minimist-compatible argv array (i.e. { "config": "config.json", "_": [ "list" ] })
argv._ Array.<String> array of non-option arguments (i.e. 'list', 'ping', etc.)

cli.filter()

Filter the result according to the --outputFormat option. Use: cli.run().then((result) => cli.filter(result))

Kind: instance method of Cli

cli.run() ⇒ Promise.<Object>

Run the verb, returning a Promise with the result. If you call this multiple times, it will run multiple times.

Kind: instance method of Cli
Returns: Promise.<Object> - the result (verb dependent)

cli.getCredentials(argv) ⇒ Object

Kind: instance method of Cli
Returns: Object - credentials

Param Type Description
argv Object args

Cli.parseOpts

Options to be used with minimist. See https://www.npmjs.com/package/minimist#var-argv--parseargsargs-opts

Kind: static property of Cli

Cli.parseArgs(argv)

Parse the args with miminist

Kind: static method of Cli

Param Type Description
argv Object argv from process.argv

docs autogenerated via jsdoc2md

Community

Contributing

See CONTRIBUTING.md.

License

Apache 2.0. See LICENSE.txt

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.