Skip to content

allegiant-js/cmdhelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmdhelper

Simple command line argument parser library.

There be 🐲 here! The API and functionality are being cemented, anything before a 1.0.0 release is subject to change.

Npm Version Build Status Coverage Status

Installation

npm install @allegiant/cmdhelper --save

Usage

const cmdHelper = require('@allegiant/cmdhelper');
const SETTINGS = cmdHelper.process(params => {
  return {
      host: params.get('host') || '0.0.0.0',
      port: params.get('port') || 80
  };
});

SETTINGS will now hold the two properties, 'host' and 'port'. These are available to the command line as --host "hostname" and --port "port number" respectively.

Copyright & License

Copyright © 2017 Allegiant. Distributed under the terms of the MIT License, see LICENSE

Availble via npm or github.

About

Simple command line argument parser library for node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published