Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 22, 2024 via pnpm
Package summary
Share
0
issues
1
license
1
MIT
Package created
7 Jul 2015
Version published
6 Apr 2019
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
has-flag@4.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of has-flag 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does has-flag do?

"Has-flag" is a handy npm package primarily used to ascertain if a specific flag is present within your Node.js command line arguments - known as argv. It's a convenience function that operates correctly even when an argument terminator -- is exposed.

How do you use has-flag?

To integrate "has-flag" in your application or script, first, make sure to have it installed via the Node Package Manager (npm) using the following command:

$ npm install has-flag

After successfully installing, you can import it into your JavaScript file and leverage its functionality. Below are representative examples of how you may use "has-flag":

// Importing hasFlag into your file
import hasFlag from 'has-flag';

// Usage
hasFlag('unicorn');     // returns true if the 'unicorn' flag is present in the argv
hasFlag('--unicorn');   // similar to the above example, the '--' prefix is optional
hasFlag('f');           // returns true if the 'f' flag is present in the argv
hasFlag('-f');          // similar to the above example, the '-' prefix is optional

hasFlag('foo=bar');     // returns true if the 'foo=bar' flag is present in the argv
hasFlag('foo');         // returns false if 'foo' does not exist in the arguments
hasFlag('rainbow');     // returns false if 'rainbow' does not exist in the arguments

You can pass in the flags when running your script:

$ node foo.js -f --unicorn --foo=bar -- --rainbow

The "has-flag" package will determine the presence or absence of a flag and return a boolean accordingly.

Where are the has-flag docs?

The official documentation for the "has-flag" package is provided directly within its GitHub repository's README file. Here, you can find usage examples, installation instructions, and an outline of the API for this npm package. If you want more professional and sustainably-maintained support for this package, the Tidelift subscription link within the README can be an excellent resource.