New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

freshbooks-cli-config

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

freshbooks-cli-config

Configuration manager for freshbooks-cli

0.3.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

freshbooks-cli-config

Build Status

Configuration manager for freshbooks-cli

Overview

freshbooks-cli is a command-line interface to the FreshBooks API.

freshbooks-cli-config implements the config subcommand for freshbooks-cli.

Usage

--key, -k [String] - A configuration key to operate on. If --value is not
                     set, the current value will be written to STDOUT. Keys
                     are namespaced and delimited by ':'.

--value, -v [String] - Save a new value to the specified key.

--file, -f [Path] - Explicitely specify the configFile to operate on. If
                    not set, $HOME/.freshbooks will be used.

--edit, -e - Manually edit configuration with $EDITOR

--help, -h - Display this message

Examples

# Set the Freshbooks API base url
$ freshbooks-config -k api:url -v "https://YOURACCOUNT.freshbooks.com/api"

# Set the Freshbooks API version
$ freshbooks-config -k api:version -v 2.1

# Print the current Freshbooks API version to STDOUT
$ freshbooks-config -k api:version

# Edit configuration using a text editor
$ freshbooks-config --edit

API

You can (and should!) use this interface to manage user configuration within your own freshbooks-cli plugins.


config = require 'freshbooks-cli-config'

# Reading the global defaults
config.defaults

# Getting the current freshbooks\_config file path
config.configFile()

# Retrieving the nconf object
nconf = config.getConf()

# Retrieving a value
nconf.get 'namespace:key'

The nconf object returned using configFile() has already loaded the freshbooks\_config file, env overrides, and the global defaults (in that order of precedence).

The default freshbooks\_config file is ~/.freshbooks, which can be changed by setting the environment variable freshbooks\_config=PATH

See nconf for details.

Contributing

The test suite is implemented with nodeunit and nixt.

To rebuild & run the tests

$ git clone https://github.com/logankoester/freshbooks-cli-config.git
$ cd freshbooks-cli-config
$ npm install
$ grunt test

You can use grunt watch to automatically rebuild and run the test suite when files are changed.

Use npm link from the project directory to tell freshbooks-cli to use your modified freshbooks-cli-config during development.

To contribute back, fork the repo and open a pull request with your changes.

License

Copyright (c) 2013 Logan Koester Licensed under the MIT license.

Keywords

freshbooks-cli

FAQs

Package last updated on 05 Nov 2013

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