initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

192
node_modules/jest-resolve/build/default_resolver.js generated vendored Normal file
View File

@@ -0,0 +1,192 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = defaultResolver;
var _browserResolve;
function _load_browserResolve() {
return _browserResolve = _interopRequireDefault(require('browser-resolve'));
}
var _fs;
function _load_fs() {
return _fs = _interopRequireDefault(require('fs'));
}
var _path;
function _load_path() {
return _path = _interopRequireDefault(require('path'));
}
var _is_builtin_module;
function _load_is_builtin_module() {
return _is_builtin_module = _interopRequireDefault(require('./is_builtin_module'));
}
var _node_modules_paths;
function _load_node_modules_paths() {
return _node_modules_paths = _interopRequireDefault(require('./node_modules_paths'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function defaultResolver(path, options) {
const resolve = options.browser ? (_browserResolve || _load_browserResolve()).default.sync : resolveSync;
return resolve(path, {
basedir: options.basedir,
extensions: options.extensions,
moduleDirectory: options.moduleDirectory,
paths: options.paths,
rootDir: options.rootDir
});
}
/*
* Adapted from: https://github.com/substack/node-resolve
*/
const REGEX_RELATIVE_IMPORT = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[\\\/])/;
function resolveSync(target, options) {
const basedir = options.basedir;
const extensions = options.extensions || ['.js'];
const paths = options.paths || [];
if (REGEX_RELATIVE_IMPORT.test(target)) {
// resolve relative import
const resolveTarget = (_path || _load_path()).default.resolve(basedir, target);
const result = tryResolve(resolveTarget);
if (result) {
return result;
}
} else {
// otherwise search for node_modules
const dirs = (0, (_node_modules_paths || _load_node_modules_paths()).default)(basedir, {
moduleDirectory: options.moduleDirectory,
paths
});
for (let i = 0; i < dirs.length; i++) {
const resolveTarget = (_path || _load_path()).default.join(dirs[i], target);
const result = tryResolve(resolveTarget);
if (result) {
return result;
}
}
}
if ((0, (_is_builtin_module || _load_is_builtin_module()).default)(target)) {
return target;
}
const err = new Error("Cannot find module '" + target + "' from '" + basedir + "'");
err.code = 'MODULE_NOT_FOUND';
throw err;
/*
* contextual helper functions
*/
function tryResolve(name) {
const dir = (_path || _load_path()).default.dirname(name);
let result;
if (isDirectory(dir)) {
result = resolveAsFile(name) || resolveAsDirectory(name);
}
if (result) {
// Dereference symlinks to ensure we don't create a separate
// module instance depending on how it was referenced.
result = (_fs || _load_fs()).default.realpathSync(result);
}
return result;
}
function resolveAsFile(name) {
if (isFile(name)) {
return name;
}
for (let i = 0; i < extensions.length; i++) {
const file = name + extensions[i];
if (isFile(file)) {
return file;
}
}
return undefined;
}
function resolveAsDirectory(name) {
if (!isDirectory(name)) {
return undefined;
}
const pkgfile = (_path || _load_path()).default.join(name, 'package.json');
let pkgmain;
try {
const body = (_fs || _load_fs()).default.readFileSync(pkgfile, 'utf8');
pkgmain = JSON.parse(body).main;
} catch (e) {}
if (pkgmain && pkgmain !== '.') {
const resolveTarget = (_path || _load_path()).default.resolve(name, pkgmain);
const result = tryResolve(resolveTarget);
if (result) {
return result;
}
}
return resolveAsFile((_path || _load_path()).default.join(name, 'index'));
}
}
/*
* helper functions
*/
function isFile(file) {
let result;
try {
const stat = (_fs || _load_fs()).default.statSync(file);
result = stat.isFile() || stat.isFIFO();
} catch (e) {
if (!(e && e.code === 'ENOENT')) {
throw e;
}
result = false;
}
return result;
}
function isDirectory(dir) {
let result;
try {
const stat = (_fs || _load_fs()).default.statSync(dir);
result = stat.isDirectory();
} catch (e) {
if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) {
throw e;
}
result = false;
}
return result;
}

329
node_modules/jest-resolve/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,329 @@
'use strict';
var _fs;
function _load_fs() {
return _fs = _interopRequireDefault(require('fs'));
}
var _path;
function _load_path() {
return _path = _interopRequireDefault(require('path'));
}
var _node_modules_paths;
function _load_node_modules_paths() {
return _node_modules_paths = _interopRequireDefault(require('./node_modules_paths'));
}
var _is_builtin_module;
function _load_is_builtin_module() {
return _is_builtin_module = _interopRequireDefault(require('./is_builtin_module'));
}
var _default_resolver;
function _load_default_resolver() {
return _default_resolver = _interopRequireDefault(require('./default_resolver.js'));
}
var _chalk;
function _load_chalk() {
return _chalk = _interopRequireDefault(require('chalk'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
const NATIVE_PLATFORM = 'native';
// We might be inside a symlink.
const cwd = process.cwd();
const resolvedCwd = (_fs || _load_fs()).default.realpathSync(cwd) || cwd;
const nodePaths = process.env.NODE_PATH ? process.env.NODE_PATH.split((_path || _load_path()).default.delimiter).filter(Boolean)
// The resolver expects absolute paths.
.map(p => (_path || _load_path()).default.resolve(resolvedCwd, p)) : null;
class Resolver {
constructor(moduleMap, options) {
this._options = {
browser: options.browser,
defaultPlatform: options.defaultPlatform,
extensions: options.extensions,
hasCoreModules: options.hasCoreModules === undefined ? true : options.hasCoreModules,
moduleDirectories: options.moduleDirectories || ['node_modules'],
moduleNameMapper: options.moduleNameMapper,
modulePaths: options.modulePaths,
platforms: options.platforms,
resolver: options.resolver,
rootDir: options.rootDir
};
this._moduleMap = moduleMap;
this._moduleIDCache = Object.create(null);
this._moduleNameCache = Object.create(null);
this._modulePathCache = Object.create(null);
}
static findNodeModule(path, options) {
const resolver = options.resolver ? /* $FlowFixMe */
require(options.resolver) : (_default_resolver || _load_default_resolver()).default;
const paths = options.paths;
try {
return resolver(path, {
basedir: options.basedir,
browser: options.browser,
extensions: options.extensions,
moduleDirectory: options.moduleDirectory,
paths: paths ? (nodePaths || []).concat(paths) : nodePaths,
rootDir: options.rootDir
});
} catch (e) {}
return null;
}
resolveModule(from, moduleName, options) {
const dirname = (_path || _load_path()).default.dirname(from);
const paths = this._options.modulePaths;
const moduleDirectory = this._options.moduleDirectories;
const key = dirname + (_path || _load_path()).default.delimiter + moduleName;
const defaultPlatform = this._options.defaultPlatform;
const extensions = this._options.extensions.slice();
if (this._supportsNativePlatform()) {
extensions.unshift.apply(extensions, _toConsumableArray(this._options.extensions.map(ext => '.' + NATIVE_PLATFORM + ext)));
}
if (defaultPlatform) {
extensions.unshift.apply(extensions, _toConsumableArray(this._options.extensions.map(ext => '.' + defaultPlatform + ext)));
}
// 0. If we have already resolved this module for this directory name,
// return a value from the cache.
if (this._moduleNameCache[key]) {
return this._moduleNameCache[key];
}
// 1. Check if the module is a haste module.
let module = this.getModule(moduleName);
if (module) {
return this._moduleNameCache[key] = module;
}
// 2. Check if the module is a node module and resolve it based on
// the node module resolution algorithm.
// If skipNodeResolution is given we ignore all modules that look like
// node modules (ie. are not relative requires). This enables us to speed
// up resolution when we build a dependency graph because we don't have
// to look at modules that may not exist and aren't mocked.
const skipResolution = options && options.skipNodeResolution && !moduleName.includes((_path || _load_path()).default.sep);
const resolveNodeModule = name => {
return Resolver.findNodeModule(name, {
basedir: dirname,
browser: this._options.browser,
extensions,
moduleDirectory,
paths,
resolver: this._options.resolver,
rootDir: this._options.rootDir
});
};
if (!skipResolution) {
module = resolveNodeModule(moduleName);
if (module) {
return this._moduleNameCache[key] = module;
}
}
// 3. Resolve "haste packages" which are `package.json` files outside of
// `node_modules` folders anywhere in the file system.
const parts = moduleName.split('/');
const hastePackage = this.getPackage(parts.shift());
if (hastePackage) {
try {
const module = (_path || _load_path()).default.join.apply((_path || _load_path()).default, [(_path || _load_path()).default.dirname(hastePackage)].concat(parts));
// try resolving with custom resolver first to support extensions,
// then fallback to require.resolve
return this._moduleNameCache[key] = resolveNodeModule(module) || require.resolve(module);
} catch (ignoredError) {}
}
// 4. Throw an error if the module could not be found. `resolve.sync`
// only produces an error based on the dirname but we have the actual
// current module name available.
const relativePath = (_path || _load_path()).default.relative(dirname, from);
const err = new Error(`Cannot find module '${moduleName}' from '${relativePath || '.'}'`);
err.code = 'MODULE_NOT_FOUND';
throw err;
}
isCoreModule(moduleName) {
return this._options.hasCoreModules && (0, (_is_builtin_module || _load_is_builtin_module()).default)(moduleName);
}
getModule(name) {
return this._moduleMap.getModule(name, this._options.defaultPlatform, this._supportsNativePlatform());
}
getModulePath(from, moduleName) {
if (moduleName[0] !== '.' || (_path || _load_path()).default.isAbsolute(moduleName)) {
return moduleName;
}
return (_path || _load_path()).default.normalize((_path || _load_path()).default.dirname(from) + '/' + moduleName);
}
getPackage(name) {
return this._moduleMap.getPackage(name, this._options.defaultPlatform, this._supportsNativePlatform());
}
getMockModule(from, name) {
const mock = this._moduleMap.getMockModule(name);
if (mock) {
return mock;
} else {
const moduleName = this._resolveStubModuleName(from, name);
if (moduleName) {
return this.getModule(moduleName) || moduleName;
}
}
return null;
}
getModulePaths(from) {
if (!this._modulePathCache[from]) {
const moduleDirectory = this._options.moduleDirectories;
const paths = (0, (_node_modules_paths || _load_node_modules_paths()).default)(from, { moduleDirectory });
if (paths[paths.length - 1] === undefined) {
// circumvent node-resolve bug that adds `undefined` as last item.
paths.pop();
}
this._modulePathCache[from] = paths;
}
return this._modulePathCache[from];
}
getModuleID(virtualMocks, from, _moduleName) {
const moduleName = _moduleName || '';
const key = from + (_path || _load_path()).default.delimiter + moduleName;
if (this._moduleIDCache[key]) {
return this._moduleIDCache[key];
}
const moduleType = this._getModuleType(moduleName);
const absolutePath = this._getAbsolutPath(virtualMocks, from, moduleName);
const mockPath = this._getMockPath(from, moduleName);
const sep = (_path || _load_path()).default.delimiter;
const id = moduleType + sep + (absolutePath ? absolutePath + sep : '') + (mockPath ? mockPath + sep : '');
return this._moduleIDCache[key] = id;
}
_getModuleType(moduleName) {
return this.isCoreModule(moduleName) ? 'node' : 'user';
}
_getAbsolutPath(virtualMocks, from, moduleName) {
if (this.isCoreModule(moduleName)) {
return moduleName;
}
return this._isModuleResolved(from, moduleName) ? this.getModule(moduleName) : this._getVirtualMockPath(virtualMocks, from, moduleName);
}
_getMockPath(from, moduleName) {
return !this.isCoreModule(moduleName) ? this.getMockModule(from, moduleName) : null;
}
_getVirtualMockPath(virtualMocks, from, moduleName) {
const virtualMockPath = this.getModulePath(from, moduleName);
return virtualMocks[virtualMockPath] ? virtualMockPath : moduleName ? this.resolveModule(from, moduleName) : from;
}
_isModuleResolved(from, moduleName) {
return !!(this.getModule(moduleName) || this.getMockModule(from, moduleName));
}
_resolveStubModuleName(from, moduleName) {
const dirname = (_path || _load_path()).default.dirname(from);
const paths = this._options.modulePaths;
const extensions = this._options.extensions;
const moduleDirectory = this._options.moduleDirectories;
const moduleNameMapper = this._options.moduleNameMapper;
const resolver = this._options.resolver;
if (moduleNameMapper) {
for (const _ref of moduleNameMapper) {
const mappedModuleName = _ref.moduleName;
const regex = _ref.regex;
if (regex.test(moduleName)) {
// Note: once a moduleNameMapper matches the name, it must result
// in a module, or else an error is thrown.
const matches = moduleName.match(regex);
const updatedName = matches ? mappedModuleName.replace(/\$([0-9]+)/g, (_, index) => matches[parseInt(index, 10)]) : mappedModuleName;
const module = this.getModule(updatedName) || Resolver.findNodeModule(updatedName, {
basedir: dirname,
browser: this._options.browser,
extensions,
moduleDirectory,
paths,
resolver,
rootDir: this._options.rootDir
});
if (!module) {
const error = new Error((_chalk || _load_chalk()).default.red(`${(_chalk || _load_chalk()).default.bold('Configuration error')}:
Could not locate module ${(_chalk || _load_chalk()).default.bold(moduleName)} (mapped as ${(_chalk || _load_chalk()).default.bold(updatedName)})
Please check:
"moduleNameMapper": {
"${regex.toString()}": "${(_chalk || _load_chalk()).default.bold(mappedModuleName)}"
},
"resolver": ${(_chalk || _load_chalk()).default.bold(resolver)}`));
error.stack = '';
throw error;
}
return module;
}
}
}
if (resolver) {
// if moduleNameMapper didn't match anything, fallback to just the
// regular resolver
const module = this.getModule(moduleName) || Resolver.findNodeModule(moduleName, {
basedir: dirname,
browser: this._options.browser,
extensions,
moduleDirectory,
paths,
resolver,
rootDir: this._options.rootDir
});
return module;
}
return null;
}
_supportsNativePlatform() {
return (this._options.platforms || []).indexOf(NATIVE_PLATFORM) !== -1;
}
}
module.exports = Resolver;

27
node_modules/jest-resolve/build/is_builtin_module.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isBuiltinModule;
var _module;
function _load_module() {
return _module = require('module');
}
// https://github.com/facebook/flow/pull/5160
const BUILTIN_MODULES = (_module || _load_module()).builtinModules || Object.keys(process.binding('natives')).filter(module => !/^internal\//.test(module)); /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
// $FlowFixMe: Flow doesn't know about the `module` module
function isBuiltinModule(module) {
return BUILTIN_MODULES.indexOf(module) !== -1;
}

55
node_modules/jest-resolve/build/node_modules_paths.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = nodeModulesPaths;
var _path;
function _load_path() {
return _path = _interopRequireDefault(require('path'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* Adapted from: https://github.com/substack/node-resolve
*
*
*/
function nodeModulesPaths(basedir, options) {
const modules = options && options.moduleDirectory ? [].concat(options.moduleDirectory) : ['node_modules'];
// ensure that `basedir` is an absolute path at this point,
// resolving against the process' current working directory
const basedirAbs = (_path || _load_path()).default.resolve(basedir);
let prefix = '/';
if (/^([A-Za-z]:)/.test(basedirAbs)) {
prefix = '';
} else if (/^\\\\/.test(basedirAbs)) {
prefix = '\\\\';
}
const paths = [basedirAbs];
let parsed = (_path || _load_path()).default.parse(basedirAbs);
while (parsed.dir !== paths[paths.length - 1]) {
paths.push(parsed.dir);
parsed = (_path || _load_path()).default.parse(parsed.dir);
}
const dirs = paths.reduce((dirs, aPath) => {
return dirs.concat(modules.map(moduleDir => {
return (_path || _load_path()).default.isAbsolute(moduleDir) ? aPath === basedirAbs ? moduleDir : '' : (_path || _load_path()).default.join(prefix, aPath, moduleDir);
}));
}, []).filter(dir => dir !== '');
return options.paths ? dirs.concat(options.paths) : dirs;
}

View File

@@ -0,0 +1,165 @@
'use strict';
const colorConvert = require('color-convert');
const wrapAnsi16 = (fn, offset) => function () {
const code = fn.apply(colorConvert, arguments);
return `\u001B[${code + offset}m`;
};
const wrapAnsi256 = (fn, offset) => function () {
const code = fn.apply(colorConvert, arguments);
return `\u001B[${38 + offset};5;${code}m`;
};
const wrapAnsi16m = (fn, offset) => function () {
const rgb = fn.apply(colorConvert, arguments);
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
};
function assembleStyles() {
const codes = new Map();
const styles = {
modifier: {
reset: [0, 0],
// 21 isn't widely supported and 22 does the same thing
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29]
},
color: {
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
gray: [90, 39],
// Bright color
redBright: [91, 39],
greenBright: [92, 39],
yellowBright: [93, 39],
blueBright: [94, 39],
magentaBright: [95, 39],
cyanBright: [96, 39],
whiteBright: [97, 39]
},
bgColor: {
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
// Bright color
bgBlackBright: [100, 49],
bgRedBright: [101, 49],
bgGreenBright: [102, 49],
bgYellowBright: [103, 49],
bgBlueBright: [104, 49],
bgMagentaBright: [105, 49],
bgCyanBright: [106, 49],
bgWhiteBright: [107, 49]
}
};
// Fix humans
styles.color.grey = styles.color.gray;
for (const groupName of Object.keys(styles)) {
const group = styles[groupName];
for (const styleName of Object.keys(group)) {
const style = group[styleName];
styles[styleName] = {
open: `\u001B[${style[0]}m`,
close: `\u001B[${style[1]}m`
};
group[styleName] = styles[styleName];
codes.set(style[0], style[1]);
}
Object.defineProperty(styles, groupName, {
value: group,
enumerable: false
});
Object.defineProperty(styles, 'codes', {
value: codes,
enumerable: false
});
}
const ansi2ansi = n => n;
const rgb2rgb = (r, g, b) => [r, g, b];
styles.color.close = '\u001B[39m';
styles.bgColor.close = '\u001B[49m';
styles.color.ansi = {
ansi: wrapAnsi16(ansi2ansi, 0)
};
styles.color.ansi256 = {
ansi256: wrapAnsi256(ansi2ansi, 0)
};
styles.color.ansi16m = {
rgb: wrapAnsi16m(rgb2rgb, 0)
};
styles.bgColor.ansi = {
ansi: wrapAnsi16(ansi2ansi, 10)
};
styles.bgColor.ansi256 = {
ansi256: wrapAnsi256(ansi2ansi, 10)
};
styles.bgColor.ansi16m = {
rgb: wrapAnsi16m(rgb2rgb, 10)
};
for (let key of Object.keys(colorConvert)) {
if (typeof colorConvert[key] !== 'object') {
continue;
}
const suite = colorConvert[key];
if (key === 'ansi16') {
key = 'ansi';
}
if ('ansi16' in suite) {
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
}
if ('ansi256' in suite) {
styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
}
if ('rgb' in suite) {
styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
}
}
return styles;
}
// Make the export immutable
Object.defineProperty(module, 'exports', {
enumerable: true,
get: assembleStyles
});

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,122 @@
{
"_args": [
[
"ansi-styles@^3.2.1",
"/home/bernhard/freifunk-app/node_modules/jest-resolve/node_modules/chalk"
]
],
"_from": "ansi-styles@>=3.2.1 <4.0.0",
"_id": "ansi-styles@3.2.1",
"_inCache": true,
"_installable": true,
"_location": "/jest-resolve/ansi-styles",
"_nodeVersion": "8.9.4",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/ansi-styles_3.2.1_1519983600652_0.7656433427334486"
},
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "5.6.0",
"_phantomChildren": {},
"_requested": {
"name": "ansi-styles",
"raw": "ansi-styles@^3.2.1",
"rawSpec": "^3.2.1",
"scope": null,
"spec": ">=3.2.1 <4.0.0",
"type": "range"
},
"_requiredBy": [
"/jest-resolve/chalk"
],
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"_shasum": "41fbb20243e50b12be0f04b8dedbf07520ce841d",
"_shrinkwrap": null,
"_spec": "ansi-styles@^3.2.1",
"_where": "/home/bernhard/freifunk-app/node_modules/jest-resolve/node_modules/chalk",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"ava": {
"require": "babel-polyfill"
},
"bugs": {
"url": "https://github.com/chalk/ansi-styles/issues"
},
"dependencies": {
"color-convert": "^1.9.0"
},
"description": "ANSI escape codes for styling strings in the terminal",
"devDependencies": {
"ava": "*",
"babel-polyfill": "^6.23.0",
"svg-term-cli": "^2.1.1",
"xo": "*"
},
"directories": {},
"dist": {
"fileCount": 4,
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"shasum": "41fbb20243e50b12be0f04b8dedbf07520ce841d",
"tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"unpackedSize": 9371
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"gitHead": "de7527a86c1cf49906b0eb32a0de1402d849ccc2",
"homepage": "https://github.com/chalk/ansi-styles#readme",
"keywords": [
"256",
"ansi",
"cli",
"color",
"colors",
"colour",
"command-line",
"console",
"escape",
"formatting",
"log",
"logging",
"rgb",
"shell",
"string",
"styles",
"terminal",
"text",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "qix",
"email": "i.am.qix@gmail.com"
},
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
"name": "ansi-styles",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/ansi-styles.git"
},
"scripts": {
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor",
"test": "xo && ava"
},
"version": "3.2.1"
}

View File

@@ -0,0 +1,147 @@
# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
## Install
```
$ npm install ansi-styles
```
## Usage
```js
const style = require('ansi-styles');
console.log(`${style.green.open}Hello world!${style.green.close}`);
// Color conversion between 16/256/truecolor
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
// may be degraded to fit that color palette. This means terminals
// that do not support 16 million colors will best-match the
// original color.
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close);
```
## API
Each style has an `open` and `close` property.
## Styles
### Modifiers
- `reset`
- `bold`
- `dim`
- `italic` *(Not widely supported)*
- `underline`
- `inverse`
- `hidden`
- `strikethrough` *(Not widely supported)*
### Colors
- `black`
- `red`
- `green`
- `yellow`
- `blue`
- `magenta`
- `cyan`
- `white`
- `gray` ("bright black")
- `redBright`
- `greenBright`
- `yellowBright`
- `blueBright`
- `magentaBright`
- `cyanBright`
- `whiteBright`
### Background colors
- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
- `bgBlackBright`
- `bgRedBright`
- `bgGreenBright`
- `bgYellowBright`
- `bgBlueBright`
- `bgMagentaBright`
- `bgCyanBright`
- `bgWhiteBright`
## Advanced usage
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
- `style.modifier`
- `style.color`
- `style.bgColor`
###### Example
```js
console.log(style.color.green.open);
```
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
###### Example
```js
console.log(style.codes.get(36));
//=> 39
```
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
To use these, call the associated conversion function with the intended output, for example:
```js
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
```
## Related
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT

228
node_modules/jest-resolve/node_modules/chalk/index.js generated vendored Normal file
View File

@@ -0,0 +1,228 @@
'use strict';
const escapeStringRegexp = require('escape-string-regexp');
const ansiStyles = require('ansi-styles');
const stdoutColor = require('supports-color').stdout;
const template = require('./templates.js');
const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
// `supportsColor.level` → `ansiStyles.color[name]` mapping
const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
// `color-convert` models to exclude from the Chalk API due to conflicts and such
const skipModels = new Set(['gray']);
const styles = Object.create(null);
function applyOptions(obj, options) {
options = options || {};
// Detect level if not set manually
const scLevel = stdoutColor ? stdoutColor.level : 0;
obj.level = options.level === undefined ? scLevel : options.level;
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
}
function Chalk(options) {
// We check for this.template here since calling `chalk.constructor()`
// by itself will have a `this` of a previously constructed chalk object
if (!this || !(this instanceof Chalk) || this.template) {
const chalk = {};
applyOptions(chalk, options);
chalk.template = function () {
const args = [].slice.call(arguments);
return chalkTag.apply(null, [chalk.template].concat(args));
};
Object.setPrototypeOf(chalk, Chalk.prototype);
Object.setPrototypeOf(chalk.template, chalk);
chalk.template.constructor = Chalk;
return chalk.template;
}
applyOptions(this, options);
}
// Use bright blue on Windows as the normal blue color is illegible
if (isSimpleWindowsTerm) {
ansiStyles.blue.open = '\u001B[94m';
}
for (const key of Object.keys(ansiStyles)) {
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
styles[key] = {
get() {
const codes = ansiStyles[key];
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
}
};
}
styles.visible = {
get() {
return build.call(this, this._styles || [], true, 'visible');
}
};
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
for (const model of Object.keys(ansiStyles.color.ansi)) {
if (skipModels.has(model)) {
continue;
}
styles[model] = {
get() {
const level = this.level;
return function () {
const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
const codes = {
open,
close: ansiStyles.color.close,
closeRe: ansiStyles.color.closeRe
};
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
};
}
};
}
ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
if (skipModels.has(model)) {
continue;
}
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
styles[bgModel] = {
get() {
const level = this.level;
return function () {
const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
const codes = {
open,
close: ansiStyles.bgColor.close,
closeRe: ansiStyles.bgColor.closeRe
};
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
};
}
};
}
const proto = Object.defineProperties(() => {}, styles);
function build(_styles, _empty, key) {
const builder = function () {
return applyStyle.apply(builder, arguments);
};
builder._styles = _styles;
builder._empty = _empty;
const self = this;
Object.defineProperty(builder, 'level', {
enumerable: true,
get() {
return self.level;
},
set(level) {
self.level = level;
}
});
Object.defineProperty(builder, 'enabled', {
enumerable: true,
get() {
return self.enabled;
},
set(enabled) {
self.enabled = enabled;
}
});
// See below for fix regarding invisible grey/dim combination on Windows
builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
// `__proto__` is used because we must return a function, but there is
// no way to create a function with a different prototype
builder.__proto__ = proto; // eslint-disable-line no-proto
return builder;
}
function applyStyle() {
// Support varags, but simply cast to string in case there's only one arg
const args = arguments;
const argsLen = args.length;
let str = String(arguments[0]);
if (argsLen === 0) {
return '';
}
if (argsLen > 1) {
// Don't slice `arguments`, it prevents V8 optimizations
for (let a = 1; a < argsLen; a++) {
str += ' ' + args[a];
}
}
if (!this.enabled || this.level <= 0 || !str) {
return this._empty ? '' : str;
}
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
// see https://github.com/chalk/chalk/issues/58
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
const originalDim = ansiStyles.dim.open;
if (isSimpleWindowsTerm && this.hasGrey) {
ansiStyles.dim.open = '';
}
for (const code of this._styles.slice().reverse()) {
// Replace any instances already present with a re-opening code
// otherwise only the part of the string until said closing code
// will be colored, and the rest will simply be 'plain'.
str = code.open + str.replace(code.closeRe, code.open) + code.close;
// Close the styling before a linebreak and reopen
// after next line to fix a bleed issue on macOS
// https://github.com/chalk/chalk/pull/92
str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
}
// Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
ansiStyles.dim.open = originalDim;
return str;
}
function chalkTag(chalk, strings) {
if (!Array.isArray(strings)) {
// If chalk() was called by itself or with a string,
// return the string itself as a string.
return [].slice.call(arguments, 1).join(' ');
}
const args = [].slice.call(arguments, 2);
const parts = [strings.raw[0]];
for (let i = 1; i < strings.length; i++) {
parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
parts.push(String(strings.raw[i]));
}
return template(chalk, parts.join(''));
}
Object.defineProperties(Chalk.prototype, styles);
module.exports = Chalk(); // eslint-disable-line new-cap
module.exports.supportsColor = stdoutColor;
module.exports.default = module.exports; // For TypeScript

View File

@@ -0,0 +1,93 @@
// @flow
type TemplateStringsArray = $ReadOnlyArray<string>;
export type Level = $Values<{
None: 0,
Basic: 1,
Ansi256: 2,
TrueColor: 3
}>;
export type ChalkOptions = {|
enabled?: boolean,
level?: Level
|};
export type ColorSupport = {|
level: Level,
hasBasic: boolean,
has256: boolean,
has16m: boolean
|};
export interface Chalk {
(...text: string[]): string,
(text: TemplateStringsArray, ...placeholders: string[]): string,
constructor(options?: ChalkOptions): Chalk,
enabled: boolean,
level: Level,
rgb(r: number, g: number, b: number): Chalk,
hsl(h: number, s: number, l: number): Chalk,
hsv(h: number, s: number, v: number): Chalk,
hwb(h: number, w: number, b: number): Chalk,
bgHex(color: string): Chalk,
bgKeyword(color: string): Chalk,
bgRgb(r: number, g: number, b: number): Chalk,
bgHsl(h: number, s: number, l: number): Chalk,
bgHsv(h: number, s: number, v: number): Chalk,
bgHwb(h: number, w: number, b: number): Chalk,
hex(color: string): Chalk,
keyword(color: string): Chalk,
+reset: Chalk,
+bold: Chalk,
+dim: Chalk,
+italic: Chalk,
+underline: Chalk,
+inverse: Chalk,
+hidden: Chalk,
+strikethrough: Chalk,
+visible: Chalk,
+black: Chalk,
+red: Chalk,
+green: Chalk,
+yellow: Chalk,
+blue: Chalk,
+magenta: Chalk,
+cyan: Chalk,
+white: Chalk,
+gray: Chalk,
+grey: Chalk,
+blackBright: Chalk,
+redBright: Chalk,
+greenBright: Chalk,
+yellowBright: Chalk,
+blueBright: Chalk,
+magentaBright: Chalk,
+cyanBright: Chalk,
+whiteBright: Chalk,
+bgBlack: Chalk,
+bgRed: Chalk,
+bgGreen: Chalk,
+bgYellow: Chalk,
+bgBlue: Chalk,
+bgMagenta: Chalk,
+bgCyan: Chalk,
+bgWhite: Chalk,
+bgBlackBright: Chalk,
+bgRedBright: Chalk,
+bgGreenBright: Chalk,
+bgYellowBright: Chalk,
+bgBlueBright: Chalk,
+bgMagentaBright: Chalk,
+bgCyanBright: Chalk,
+bgWhiteBrigh: Chalk,
supportsColor: ColorSupport
};
declare module.exports: Chalk;

9
node_modules/jest-resolve/node_modules/chalk/license generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,142 @@
{
"_args": [
[
"chalk@^2.0.1",
"/home/bernhard/freifunk-app/node_modules/jest-resolve"
]
],
"_from": "chalk@>=2.0.1 <3.0.0",
"_id": "chalk@2.4.1",
"_inCache": true,
"_installable": true,
"_location": "/jest-resolve/chalk",
"_nodeVersion": "8.11.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/chalk_2.4.1_1524719751701_0.7780175911150953"
},
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "5.6.0",
"_phantomChildren": {},
"_requested": {
"name": "chalk",
"raw": "chalk@^2.0.1",
"rawSpec": "^2.0.1",
"scope": null,
"spec": ">=2.0.1 <3.0.0",
"type": "range"
},
"_requiredBy": [
"/jest-resolve"
],
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"_shasum": "18c49ab16a037b6eb0152cc83e3471338215b66e",
"_shrinkwrap": null,
"_spec": "chalk@^2.0.1",
"_where": "/home/bernhard/freifunk-app/node_modules/jest-resolve",
"bugs": {
"url": "https://github.com/chalk/chalk/issues"
},
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"description": "Terminal string styling done right",
"devDependencies": {
"ava": "*",
"coveralls": "^3.0.0",
"execa": "^0.9.0",
"flow-bin": "^0.68.0",
"import-fresh": "^2.0.0",
"matcha": "^0.7.0",
"nyc": "^11.0.2",
"resolve-from": "^4.0.0",
"typescript": "^2.5.3",
"xo": "*"
},
"directories": {},
"dist": {
"fileCount": 7,
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4WCICRA9TVsSAnZWagAAhgwP/2M/ItinhR06BFhLMh91\nK/ru5t71NzSzoEvI2nh4W57Wk9cU1NOYi1cI17nUvICHCL4Vq9mjvU0hajTw\ncAYtM0Lwl+G4Hk4JtuiZITYj93QY3yLSJ8zkj95JznFbH0Zd9KkZrkoGukcG\nFY9at0cfNyhBmwi5sEDAFktcw7wThQ6Wy3iIttQ0N1M6Lf1XILg9Xyq6Id/W\nlz3TbkCt6AZCS1icmDPIiLdVQuD9SfpusIDsHm5/6FJPShwmQjUlM6Kdy7lx\n6M8uhcIknpxjfPTA6/aSBC4qgXnDhuPPi9xF657/81Mswz4Tb71KOf6UqLPi\n3zk1D5PF71ujWs3wmPll9TAVGnWuNzE+X/7GVIB4qCrib3SgvRzMhL0Wo95v\nzxTpNoD23hKYwofUyV3cTFh47YwkVoPtOStRAgdE87rx+v3VjbWSThQJc3V8\nHOsIeTjpQMwAr/d2DnasHKlps/q+gnGKqhBhcf11tAKn9C7PsAQ2l6+E4Erc\nfPKqDRC6TVG7ABdwOtyNonHhrJ2JLgYj8d4mHdtsMTtFsUTOQR/+Rx0V8HJS\n9gBLmPr3yc/yEedYW68wP5tPK2SfvFTzgMBw5v0+tgIxOjUunGxDUV4a1Bpp\npCBLN7iS77FLMiMonfcD2z/SsoB+Hb+7q5eT/gua3BIUNNZEdmgw9queXw+q\n7DFE\r\n=LSlF\r\n-----END PGP SIGNATURE-----\r\n",
"shasum": "18c49ab16a037b6eb0152cc83e3471338215b66e",
"tarball": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"unpackedSize": 26917
},
"engines": {
"node": ">=4"
},
"files": [
"index.js",
"index.js.flow",
"templates.js",
"types/index.d.ts"
],
"gitHead": "48ba5b0b9beadcabd9fc406ac4d9337d8fa6b36d",
"homepage": "https://github.com/chalk/chalk#readme",
"keywords": [
"256",
"ansi",
"cli",
"color",
"colors",
"colour",
"command-line",
"console",
"formatting",
"log",
"logging",
"rgb",
"shell",
"str",
"string",
"style",
"styles",
"terminal",
"text",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "qix",
"email": "i.am.qix@gmail.com"
},
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "unicorn",
"email": "sindresorhus+unicorn@gmail.com"
}
],
"name": "chalk",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/chalk.git"
},
"scripts": {
"bench": "matcha benchmark.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava"
},
"types": "types/index.d.ts",
"version": "2.4.1",
"xo": {
"envs": [
"mocha",
"node"
],
"ignores": [
"test/_flow.js"
]
}
}

314
node_modules/jest-resolve/node_modules/chalk/readme.md generated vendored Normal file
View File

@@ -0,0 +1,314 @@
<h1 align="center">
<br>
<br>
<img width="320" src="media/logo.svg" alt="Chalk">
<br>
<br>
<br>
</h1>
> Terminal string styling done right
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)
### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900">
## Highlights
- Expressive API
- Highly performant
- Ability to nest styles
- [256/Truecolor color support](#256-and-truecolor-color-support)
- Auto-detects color support
- Doesn't extend `String.prototype`
- Clean and focused
- Actively maintained
- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017
## Install
```console
$ npm install chalk
```
<a href="https://www.patreon.com/sindresorhus">
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
</a>
## Usage
```js
const chalk = require('chalk');
console.log(chalk.blue('Hello world!'));
```
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
```js
const chalk = require('chalk');
const log = console.log;
// Combine styled and normal strings
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
// Compose multiple styles using the chainable API
log(chalk.blue.bgRed.bold('Hello world!'));
// Pass in multiple arguments
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
// Nest styles
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
// Nest styles of the same type even (color, underline, background)
log(chalk.green(
'I am a green line ' +
chalk.blue.underline.bold('with a blue substring') +
' that becomes green again!'
));
// ES2015 template literal
log(`
CPU: ${chalk.red('90%')}
RAM: ${chalk.green('40%')}
DISK: ${chalk.yellow('70%')}
`);
// ES2015 tagged template literal
log(chalk`
CPU: {red ${cpu.totalPercent}%}
RAM: {green ${ram.used / ram.total * 100}%}
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
`);
// Use RGB colors in terminal emulators that support it.
log(chalk.keyword('orange')('Yay for orange colored text!'));
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
log(chalk.hex('#DEADED').bold('Bold gray!'));
```
Easily define your own themes:
```js
const chalk = require('chalk');
const error = chalk.bold.red;
const warning = chalk.keyword('orange');
console.log(error('Error!'));
console.log(warning('Warning!'));
```
Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
```js
const name = 'Sindre';
console.log(chalk.green('Hello %s'), name);
//=> 'Hello Sindre'
```
## API
### chalk.`<style>[.<style>...](string, [string...])`
Example: `chalk.red.bold.underline('Hello', 'world');`
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
Multiple arguments will be separated by space.
### chalk.enabled
Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.
Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
If you need to change this in a reusable module, create a new instance:
```js
const ctx = new chalk.constructor({enabled: false});
```
### chalk.level
Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
If you need to change this in a reusable module, create a new instance:
```js
const ctx = new chalk.constructor({level: 0});
```
Levels are as follows:
0. All colors disabled
1. Basic color support (16 colors)
2. 256 color support
3. Truecolor support (16 million colors)
### chalk.supportsColor
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
## Styles
### Modifiers
- `reset`
- `bold`
- `dim`
- `italic` *(Not widely supported)*
- `underline`
- `inverse`
- `hidden`
- `strikethrough` *(Not widely supported)*
- `visible` (Text is emitted only if enabled)
### Colors
- `black`
- `red`
- `green`
- `yellow`
- `blue` *(On Windows the bright version is used since normal blue is illegible)*
- `magenta`
- `cyan`
- `white`
- `gray` ("bright black")
- `redBright`
- `greenBright`
- `yellowBright`
- `blueBright`
- `magentaBright`
- `cyanBright`
- `whiteBright`
### Background colors
- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
- `bgBlackBright`
- `bgRedBright`
- `bgGreenBright`
- `bgYellowBright`
- `bgBlueBright`
- `bgMagentaBright`
- `bgCyanBright`
- `bgWhiteBright`
## Tagged template literal
Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
```js
const chalk = require('chalk');
const miles = 18;
const calculateFeet = miles => miles * 5280;
console.log(chalk`
There are {bold 5280 feet} in a mile.
In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
`);
```
Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
```js
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
```
Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
## 256 and Truecolor color support
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
Examples:
- `chalk.hex('#DEADED').underline('Hello, world!')`
- `chalk.keyword('orange')('Some orange text')`
- `chalk.rgb(15, 100, 204).inverse('Hello!')`
Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
- `chalk.bgHex('#DEADED').underline('Hello, world!')`
- `chalk.bgKeyword('orange')('Some orange text')`
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
The following color models can be used:
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
- `ansi16`
- `ansi256`
## Windows
If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`.
## Origin story
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
## Related
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT

View File

@@ -0,0 +1,128 @@
'use strict';
const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
const ESCAPES = new Map([
['n', '\n'],
['r', '\r'],
['t', '\t'],
['b', '\b'],
['f', '\f'],
['v', '\v'],
['0', '\0'],
['\\', '\\'],
['e', '\u001B'],
['a', '\u0007']
]);
function unescape(c) {
if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
return String.fromCharCode(parseInt(c.slice(1), 16));
}
return ESCAPES.get(c) || c;
}
function parseArguments(name, args) {
const results = [];
const chunks = args.trim().split(/\s*,\s*/g);
let matches;
for (const chunk of chunks) {
if (!isNaN(chunk)) {
results.push(Number(chunk));
} else if ((matches = chunk.match(STRING_REGEX))) {
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
} else {
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
}
}
return results;
}
function parseStyle(style) {
STYLE_REGEX.lastIndex = 0;
const results = [];
let matches;
while ((matches = STYLE_REGEX.exec(style)) !== null) {
const name = matches[1];
if (matches[2]) {
const args = parseArguments(name, matches[2]);
results.push([name].concat(args));
} else {
results.push([name]);
}
}
return results;
}
function buildStyle(chalk, styles) {
const enabled = {};
for (const layer of styles) {
for (const style of layer.styles) {
enabled[style[0]] = layer.inverse ? null : style.slice(1);
}
}
let current = chalk;
for (const styleName of Object.keys(enabled)) {
if (Array.isArray(enabled[styleName])) {
if (!(styleName in current)) {
throw new Error(`Unknown Chalk style: ${styleName}`);
}
if (enabled[styleName].length > 0) {
current = current[styleName].apply(current, enabled[styleName]);
} else {
current = current[styleName];
}
}
}
return current;
}
module.exports = (chalk, tmp) => {
const styles = [];
const chunks = [];
let chunk = [];
// eslint-disable-next-line max-params
tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
if (escapeChar) {
chunk.push(unescape(escapeChar));
} else if (style) {
const str = chunk.join('');
chunk = [];
chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
styles.push({inverse, styles: parseStyle(style)});
} else if (close) {
if (styles.length === 0) {
throw new Error('Found extraneous } in Chalk template literal');
}
chunks.push(buildStyle(chalk, styles)(chunk.join('')));
chunk = [];
styles.pop();
} else {
chunk.push(chr);
}
});
chunks.push(chunk.join(''));
if (styles.length > 0) {
const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
throw new Error(errMsg);
}
return chunks.join('');
};

View File

@@ -0,0 +1,97 @@
// Type definitions for Chalk
// Definitions by: Thomas Sauer <https://github.com/t-sauer>
export const enum Level {
None = 0,
Basic = 1,
Ansi256 = 2,
TrueColor = 3
}
export interface ChalkOptions {
enabled?: boolean;
level?: Level;
}
export interface ChalkConstructor {
new (options?: ChalkOptions): Chalk;
(options?: ChalkOptions): Chalk;
}
export interface ColorSupport {
level: Level;
hasBasic: boolean;
has256: boolean;
has16m: boolean;
}
export interface Chalk {
(...text: string[]): string;
(text: TemplateStringsArray, ...placeholders: string[]): string;
constructor: ChalkConstructor;
enabled: boolean;
level: Level;
rgb(r: number, g: number, b: number): this;
hsl(h: number, s: number, l: number): this;
hsv(h: number, s: number, v: number): this;
hwb(h: number, w: number, b: number): this;
bgHex(color: string): this;
bgKeyword(color: string): this;
bgRgb(r: number, g: number, b: number): this;
bgHsl(h: number, s: number, l: number): this;
bgHsv(h: number, s: number, v: number): this;
bgHwb(h: number, w: number, b: number): this;
hex(color: string): this;
keyword(color: string): this;
readonly reset: this;
readonly bold: this;
readonly dim: this;
readonly italic: this;
readonly underline: this;
readonly inverse: this;
readonly hidden: this;
readonly strikethrough: this;
readonly visible: this;
readonly black: this;
readonly red: this;
readonly green: this;
readonly yellow: this;
readonly blue: this;
readonly magenta: this;
readonly cyan: this;
readonly white: this;
readonly gray: this;
readonly grey: this;
readonly blackBright: this;
readonly redBright: this;
readonly greenBright: this;
readonly yellowBright: this;
readonly blueBright: this;
readonly magentaBright: this;
readonly cyanBright: this;
readonly whiteBright: this;
readonly bgBlack: this;
readonly bgRed: this;
readonly bgGreen: this;
readonly bgYellow: this;
readonly bgBlue: this;
readonly bgMagenta: this;
readonly bgCyan: this;
readonly bgWhite: this;
readonly bgBlackBright: this;
readonly bgRedBright: this;
readonly bgGreenBright: this;
readonly bgYellowBright: this;
readonly bgBlueBright: this;
readonly bgMagentaBright: this;
readonly bgCyanBright: this;
readonly bgWhiteBright: this;
}
declare const chalk: Chalk & { supportsColor: ColorSupport };
export default chalk

View File

@@ -0,0 +1,5 @@
'use strict';
module.exports = {
stdout: false,
stderr: false
};

View File

@@ -0,0 +1,131 @@
'use strict';
const os = require('os');
const hasFlag = require('has-flag');
const env = process.env;
let forceColor;
if (hasFlag('no-color') ||
hasFlag('no-colors') ||
hasFlag('color=false')) {
forceColor = false;
} else if (hasFlag('color') ||
hasFlag('colors') ||
hasFlag('color=true') ||
hasFlag('color=always')) {
forceColor = true;
}
if ('FORCE_COLOR' in env) {
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
}
function translateLevel(level) {
if (level === 0) {
return false;
}
return {
level,
hasBasic: true,
has256: level >= 2,
has16m: level >= 3
};
}
function supportsColor(stream) {
if (forceColor === false) {
return 0;
}
if (hasFlag('color=16m') ||
hasFlag('color=full') ||
hasFlag('color=truecolor')) {
return 3;
}
if (hasFlag('color=256')) {
return 2;
}
if (stream && !stream.isTTY && forceColor !== true) {
return 0;
}
const min = forceColor ? 1 : 0;
if (process.platform === 'win32') {
// Node.js 7.5.0 is the first version of Node.js to include a patch to
// libuv that enables 256 color output on Windows. Anything earlier and it
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
// release that supports 256 colors. Windows 10 build 14931 is the first release
// that supports 16m/TrueColor.
const osRelease = os.release().split('.');
if (
Number(process.versions.node.split('.')[0]) >= 8 &&
Number(osRelease[0]) >= 10 &&
Number(osRelease[2]) >= 10586
) {
return Number(osRelease[2]) >= 14931 ? 3 : 2;
}
return 1;
}
if ('CI' in env) {
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
return 1;
}
return min;
}
if ('TEAMCITY_VERSION' in env) {
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
}
if (env.COLORTERM === 'truecolor') {
return 3;
}
if ('TERM_PROGRAM' in env) {
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
return version >= 3 ? 3 : 2;
case 'Apple_Terminal':
return 2;
// No default
}
}
if (/-256(color)?$/i.test(env.TERM)) {
return 2;
}
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}
if ('COLORTERM' in env) {
return 1;
}
if (env.TERM === 'dumb') {
return min;
}
return min;
}
function getSupportLevel(stream) {
const level = supportsColor(stream);
return translateLevel(level);
}
module.exports = {
supportsColor: getSupportLevel,
stdout: getSupportLevel(process.stdout),
stderr: getSupportLevel(process.stderr)
};

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,120 @@
{
"_args": [
[
"supports-color@^5.3.0",
"/home/bernhard/freifunk-app/node_modules/jest-resolve/node_modules/chalk"
]
],
"_from": "supports-color@>=5.3.0 <6.0.0",
"_id": "supports-color@5.4.0",
"_inCache": true,
"_installable": true,
"_location": "/jest-resolve/supports-color",
"_nodeVersion": "8.10.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/supports-color_5.4.0_1523937461670_0.5515855155919032"
},
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "5.6.0",
"_phantomChildren": {},
"_requested": {
"name": "supports-color",
"raw": "supports-color@^5.3.0",
"rawSpec": "^5.3.0",
"scope": null,
"spec": ">=5.3.0 <6.0.0",
"type": "range"
},
"_requiredBy": [
"/jest-resolve/chalk"
],
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"_shasum": "1c6b337402c2137605efe19f10fec390f6faab54",
"_shrinkwrap": null,
"_spec": "supports-color@^5.3.0",
"_where": "/home/bernhard/freifunk-app/node_modules/jest-resolve/node_modules/chalk",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"browser": "browser.js",
"bugs": {
"url": "https://github.com/chalk/supports-color/issues"
},
"dependencies": {
"has-flag": "^3.0.0"
},
"description": "Detect whether a terminal supports color",
"devDependencies": {
"ava": "*",
"import-fresh": "^2.0.0",
"xo": "*"
},
"directories": {},
"dist": {
"fileCount": 5,
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1XC3CRA9TVsSAnZWagAAKqEP/1b5ncwgky8BfhFodI/k\nxxuQA/s18s+3RUyXu1KSyFbn+6wbyprD0mlsATEhrc8ILe23ieTpKV9xsy7U\nUjkhV7TW0ibf1ndM8Xr2Y9VqG/FV+ZDcn/sJC1OS+v6cmVRXsMuwUNHzHPmC\nj4dGMR9auksDBY6BMIz/vLIf/nKzKUC84v+Wc2AvWSjx7eii/j2txPlW7eIt\nPxfUinegPSzxVx15ijd7rP7mckXqjAfXHoEiaoJkrfeDZZdwLnJKSgDlGn1B\nQyKxo32z3XBDyf3zIBhrNfEa4yagX1zDLq9q2Kjnt1mWAxAXbScBuMx7NXfW\nZ8IriNLHNnfP+X3lK0uhd8K6nHMX6Vtcl63Ib1jTLXCo+nvotGdydYymsL6I\nqD2HEatdn7bCCBO9rImSOXWIfvVImPP2KIt7n4rnckerpWgMwnS1zeTqfzrm\nUWTAOUgkmrKZEoKdP4GHakdJflUjCFf5bd3pJFgIA2KiSUSYMOP1YPziWLpE\nhq192CiFHEDFmuAjXFqDxH8ewbis8qBhp9P1hg9x5oV/pPABVnsuAFcEEGhR\nlLiUMxTL5sO4ya1ARHtPecOj+Br86kyn5O9TG4iQYzxMQufn/Iyi0La7xs0q\nRHtaokepsuCcZOO8zG5GRVV/WKClK9ePLcjOiYOgyc8OI065zzLT43amvCAZ\n+M/X\r\n=nrD9\r\n-----END PGP SIGNATURE-----\r\n",
"shasum": "1c6b337402c2137605efe19f10fec390f6faab54",
"tarball": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"unpackedSize": 6693
},
"engines": {
"node": ">=4"
},
"files": [
"browser.js",
"index.js"
],
"gitHead": "bcd82c998094535f3462a3e37856852938ccbb37",
"homepage": "https://github.com/chalk/supports-color#readme",
"keywords": [
"16m",
"256",
"ansi",
"capability",
"cli",
"color",
"colors",
"colour",
"command-line",
"console",
"detect",
"rgb",
"shell",
"styles",
"support",
"supports",
"terminal",
"truecolor",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "qix",
"email": "i.am.qix@gmail.com"
},
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
"name": "supports-color",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/supports-color.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "5.4.0"
}

View File

@@ -0,0 +1,66 @@
# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
> Detect whether a terminal supports color
## Install
```
$ npm install supports-color
```
## Usage
```js
const supportsColor = require('supports-color');
if (supportsColor.stdout) {
console.log('Terminal stdout supports color');
}
if (supportsColor.stdout.has256) {
console.log('Terminal stdout supports 256 colors');
}
if (supportsColor.stderr.has16m) {
console.log('Terminal stderr supports 16 million colors (truecolor)');
}
```
## API
Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
- `.level = 2` and `.has256 = true`: 256 color support
- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
## Info
It obeys the `--color` and `--no-color` CLI flags.
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
## Related
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT

96
node_modules/jest-resolve/package.json generated vendored Normal file
View File

@@ -0,0 +1,96 @@
{
"_args": [
[
"jest-resolve@^22.4.2",
"/home/bernhard/freifunk-app/node_modules/jest-config"
]
],
"_from": "jest-resolve@>=22.4.2 <23.0.0",
"_id": "jest-resolve@22.4.3",
"_inCache": true,
"_installable": true,
"_location": "/jest-resolve",
"_nodeVersion": "8.9.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/jest-resolve_22.4.3_1521648486581_0.0009268472930012983"
},
"_npmUser": {
"email": "mjesun@hotmail.com",
"name": "mjesun"
},
"_npmVersion": "5.5.1",
"_phantomChildren": {
"color-convert": "1.9.2",
"escape-string-regexp": "1.0.5",
"has-flag": "3.0.0"
},
"_requested": {
"name": "jest-resolve",
"raw": "jest-resolve@^22.4.2",
"rawSpec": "^22.4.2",
"scope": null,
"spec": ">=22.4.2 <23.0.0",
"type": "range"
},
"_requiredBy": [
"/jest-config",
"/jest-runtime"
],
"_resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-22.4.3.tgz",
"_shasum": "0ce9d438c8438229aa9b916968ec6b05c1abb4ea",
"_shrinkwrap": null,
"_spec": "jest-resolve@^22.4.2",
"_where": "/home/bernhard/freifunk-app/node_modules/jest-config",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"dependencies": {
"browser-resolve": "^1.11.2",
"chalk": "^2.0.1"
},
"devDependencies": {
"jest-haste-map": "^22.4.3"
},
"directories": {},
"dist": {
"fileCount": 5,
"integrity": "sha512-u3BkD/MQBmwrOJDzDIaxpyqTxYH+XqAXzVJP51gt29H8jpj3QgKof5GGO2uPGKGeA1yTMlpbMs1gIQ6U4vcRhw==",
"shasum": "0ce9d438c8438229aa9b916968ec6b05c1abb4ea",
"tarball": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-22.4.3.tgz",
"unpackedSize": 21603
},
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
"maintainers": [
{
"name": "aaronabramov",
"email": "aaron@abramov.io"
},
{
"name": "cpojer",
"email": "christoph.pojer@gmail.com"
},
{
"name": "fb",
"email": "opensource+npm@fb.com"
},
{
"name": "jeanlauliac",
"email": "jean@lauliac.com"
},
{
"name": "mjesun",
"email": "mjesun@hotmail.com"
}
],
"name": "jest-resolve",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/jest.git"
},
"version": "22.4.3"
}