star-wars

1.3.2 • Public • Published

star-wars

Use the --force, Luke.

This is a tiny module that wants to check whether you're using --force or force when calling your CLI tool.

Usage

var starwars = require('star-wars');
 
starwars(process.argv);

When you run your CLI tool without adding either --force or force, the return value of star-wars will be false.

Use it for checks in your application where you need to be sure that the user intends to do the action they just tried.

var starwars = require('star-wars');
 
if (starwars(process.argv)) {
  // do the intended action
} else {
  console.log('Do or do not, there is no try');
};

tl;dr

Pass this module process.argv and it'll return true if your CLI tool has been called with --force or force

/star-wars/

    Package Sidebar

    Install

    npm i star-wars

    Weekly Downloads

    0

    Version

    1.3.2

    License

    BSD-2-Clause

    Last publish

    Collaborators

    • lewiscowper