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

minimist-mini

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimist-mini

Minimist-mini is minimist simplified. Auto-generation of help using README.md (converted to text) - and easy parsing of option given to the CLI program.

  • 3.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
362
decreased by-15.42%
Maintainers
1
Weekly downloads
 
Created
Source

minimist-mini

A wrapper around minimist that has some more logical methods for getting options and arguments.

It can also automatically generate documentation from a module's README.md or readme.md file. It reads the .md file and parses it for display in your console application.

Install:

npm install --save minimist-mini

Usage:

// Options are exactly as in minimist
const opts = [];
opts.boolean = ['help'];
opts.string = ['option1'];
opts.string = ['option2'];
opts.default = { option1: 'default value' };
opts.alias = { h: 'help' };

const minimistMini = require('minimist-mini')(opts); 

// Check if help is defined, and log the value.
var help = minimistMini.getOption('h');
if (help){
    // Default help is generated from README.md or readme.md
    // Or you may specify a file in from your package
    console.log(minimistMini.helpMessage())
    process.exit(0);
}

// Get single option
console.log("value of option 'option1':");
console.log(minimistMini.getOption('option1'));

// Get all options
console.log("all options:");
console.log(minimistMini.getOptions());

// Get single argument
console.log("value of argument 0:");
console.log(minimistMini.getArgument(0));

// Get all arguments
console.log("all arguments:");
console.log(minimistMini.getArguments());

License:

MIT © Dennis Iversen

Keywords

FAQs

Package last updated on 07 Feb 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc