This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@4lch4/lt-commander
TypeScript icon, indicating that this package has built-in type declarations

0.7.4 • Public • Published

Build Status

@4lch4/LT-Commander

LT-Commander is a "helper" library for building CLI applications with Commander.

Config Utilities

LT-Commander exports two configuration utilities, each of which provide a unique set of features/functionality.

ConfigUtil

This class makes use of the configstore dependency. It provides a number of methods for getting, updating, deleting, etc., of configuration settings.

Configstore Details

Easily load and persist config without having to think about where and how.

The config is stored in a JSON file located in $XDG_CONFIG_HOME or ~/.config.

Example: ~/.config/configstore/some-id.json

CosmicUtil

This class makes use of the cosmiconfig dependency which only provides a single method for loading the config file content (if it exists): load

Cosmiconfig Details

Cosmiconfig searches for and loads configuration for your program.

It features smart defaults based on conventional expectations in the JavaScript ecosystem. But it's also flexible enough to search wherever you'd like to search, and load whatever you'd like to load.

By default, Cosmiconfig will start where you tell it to start and search up the directory tree for the following:

  • A package.json property
  • A JSON or YAML, extensionless "rc file"
  • An "rc file" with the extensions .json, .yaml, .yml, .js, or .cjs
  • A .config.js or .config.cjs CommonJS module

For example, if your module's name is "myapp", cosmiconfig will search up the directory tree for configuration in the following places:

  • A myapp property in package.json
  • A .myapprc file in JSON or YAML format
  • A .myapprc.json, .myapprc.yaml, .myapprc.yml, .myapprc.js, or .myapprc.cjs file
  • A myapp.config.js or myapp.config.cjs CommonJS module exporting an object

Cosmiconfig continues to search up the directory tree, checking each of these places in each directory, until it finds some acceptable configuration (or hits the home directory). If a path is provided to the load function, then the search begins there.

/@4lch4/lt-commander/

    Package Sidebar

    Install

    npm i @4lch4/lt-commander

    Weekly Downloads

    2

    Version

    0.7.4

    License

    MIT

    Unpacked Size

    84.7 kB

    Total Files

    69

    Last publish

    Collaborators

    • 4lch4-ci
    • alcha