Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 13, 2024 via pnpm
Package summary
Share
0
issues
1
license
1
MIT
Package created
6 Aug 2014
Version published
30 Jul 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:
yn@3.1.1
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 yn 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does yn do?

"yn" is a handy Node.js package used for parsing yes/no like values. It's particularly useful for validating answers from a command-line interface (CLI) prompt. The package recognizes case-insensitive values such as 'y', 'yes', 'true', '1', 'n', 'no', 'false', '0', 'on', 'off', and their Boolean and numeric equivalents.

How do you use yn?

You can install the "yn" package using the npm command npm install yn. After you've installed the package, you can use it in your JavaScript code as follows:

Code example

// Import the yn package
import yn from 'yn';

// Using yn function to parse 'y'
yn('y');  // Returns true

// Using yn function to parse 'NO'
yn('NO');  // Returns false

// Using yn function to parse true
yn(true);  // Returns true

// Parsing an unsupported string
yn('abomasum');  // Returns undefined

// Specifying a default return value when parsing fails
yn('abomasum', {default: false});  // Returns false

// Enabling lenient mode to handle typos
yn('mo', {lenient: true});  // Returns false

In the provided examples, unrecognized values return undefined, unless a default value is specified in the options.

Where are the yn docs?

The documentation for the "yn" Node.js package can be found directly in the package's README file at the GitHub repository https://github.com/sindresorhus/yn. The documentation covers installation, usage instructions, and details of the API including the "yn" function and associated options.