Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

supports-color-cli

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supports-color-cli - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

40

cli.js
#!/usr/bin/env node
'use strict';
var meow = require('meow');
var supportsColor = require('supports-color');
const meow = require('meow');
const supportsColor = require('supports-color');
var cli = meow({
help: [
'Usage',
' $ supports-color [--<256|16m>]',
'',
'Options',
' --256 Check for 256 color support',
' --16m Check for 16 million color support (True Color)',
'',
'Examples',
' $ supports-color',
' $ supports-color --256',
' $ supports-color --16m',
'',
'Exits with code 0 if color is supported and 1 if not'
]
});
const cli = meow(`
Usage
$ supports-color
var flags = cli.flags;
var level = flags['256'] ? 'has256' : flags['16m'] ? 'has16m' : 'hasBasic';
Options
--256 Check for 256 color support
--16m Check for 16 million color support
Examples
$ supports-color
$ supports-color --256
$ supports-color --16m
Exits with code 0 if color is supported and 1 if not
`);
const flags = cli.flags;
const level = flags['256'] ? 'has256' : flags['16m'] ? 'has16m' : 'hasBasic';
process.exit(supportsColor[level] ? 0 : 1);
{
"name": "supports-color-cli",
"version": "1.1.0",
"version": "2.0.0",
"description": "Detect whether a terminal supports color",

@@ -12,7 +12,2 @@ "license": "MIT",

},
"maintainers": [
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
"Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)",
"JD Ballard <i.am.qix@gmail.com> (github.com/qix-)"
],
"bin": {

@@ -22,6 +17,6 @@ "supports-color": "cli.js"

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},
"scripts": {
"test": "node test.js"
"test": "xo && ava"
},

@@ -53,8 +48,10 @@ "files": [

"dependencies": {
"meow": "^3.3.0",
"supports-color": "^3.0.0"
"meow": "^3.7.0",
"supports-color": "^4.1.0"
},
"devDependencies": {
"ava": "0.0.4"
"ava": "*",
"execa": "^0.7.0",
"xo": "*"
}
}

@@ -19,7 +19,7 @@ # supports-color-cli [![Build Status](https://travis-ci.org/chalk/supports-color-cli.svg?branch=master)](https://travis-ci.org/chalk/supports-color-cli)

Usage
$ supports-color [--<256|16m>]
$ supports-color
Options
--256 Check for 256 color support
--16m Check for 16 million color support (True Color)
--256 Check for 256 color support
--16m Check for 16 million color support

@@ -34,5 +34,3 @@ Examples

You can force color by setting the environment variable `FORCE_COLOR` to any value.
## Related

@@ -43,4 +41,10 @@

## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

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