pax_global_header00006660000000000000000000000064141231262470014514gustar00rootroot0000000000000052 comment=4eba141b36de8153856fbd9a005398ac2747b154 strip-ansi-6.0.1/000077500000000000000000000000001412312624700136115ustar00rootroot00000000000000strip-ansi-6.0.1/.editorconfig000066400000000000000000000002571412312624700162720ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 strip-ansi-6.0.1/.gitattributes000066400000000000000000000000231412312624700164770ustar00rootroot00000000000000* text=auto eol=lf strip-ansi-6.0.1/.github/000077500000000000000000000000001412312624700151515ustar00rootroot00000000000000strip-ansi-6.0.1/.github/funding.yml000066400000000000000000000000561412312624700173270ustar00rootroot00000000000000github: sindresorhus tidelift: npm/strip-ansi strip-ansi-6.0.1/.github/security.md000066400000000000000000000002631412312624700173430ustar00rootroot00000000000000# Security Policy To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. strip-ansi-6.0.1/.gitignore000066400000000000000000000000271412312624700156000ustar00rootroot00000000000000node_modules yarn.lock strip-ansi-6.0.1/.npmrc000066400000000000000000000000231412312624700147240ustar00rootroot00000000000000package-lock=false strip-ansi-6.0.1/.travis.yml000066400000000000000000000000651412312624700157230ustar00rootroot00000000000000language: node_js node_js: - '12' - '10' - '8' strip-ansi-6.0.1/index.d.ts000066400000000000000000000005611412312624700155140ustar00rootroot00000000000000/** Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. @example ``` import stripAnsi = require('strip-ansi'); stripAnsi('\u001B[4mUnicorn\u001B[0m'); //=> 'Unicorn' stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); //=> 'Click' ``` */ declare function stripAnsi(string: string): string; export = stripAnsi; strip-ansi-6.0.1/index.js000066400000000000000000000002321412312624700152530ustar00rootroot00000000000000'use strict'; const ansiRegex = require('ansi-regex'); module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; strip-ansi-6.0.1/index.test-d.ts000066400000000000000000000001731412312624700164700ustar00rootroot00000000000000import {expectType} from 'tsd'; import stripAnsi = require('.'); expectType(stripAnsi('\u001B[4mcake\u001B[0m')); strip-ansi-6.0.1/license000066400000000000000000000021251412312624700151560ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (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. strip-ansi-6.0.1/package.json000066400000000000000000000014361412312624700161030ustar00rootroot00000000000000{ "name": "strip-ansi", "version": "6.0.1", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "strip", "trim", "remove", "ansi", "styles", "color", "colour", "colors", "terminal", "console", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "log", "logging", "command-line", "text" ], "dependencies": { "ansi-regex": "^5.0.1" }, "devDependencies": { "ava": "^2.4.0", "tsd": "^0.10.0", "xo": "^0.25.3" } } strip-ansi-6.0.1/readme.md000066400000000000000000000030771412312624700153770ustar00rootroot00000000000000# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) > Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string ## Install ``` $ npm install strip-ansi ``` ## Usage ```js const stripAnsi = require('strip-ansi'); stripAnsi('\u001B[4mUnicorn\u001B[0m'); //=> 'Unicorn' stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); //=> 'Click' ``` ## strip-ansi for enterprise Available as part of the Tidelift Subscription. The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) ## Related - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module - [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module - [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 - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) - [Josh Junon](https://github.com/qix-) strip-ansi-6.0.1/test.js000066400000000000000000000011701412312624700151250ustar00rootroot00000000000000import test from 'ava'; import stripAnsi from '.'; test('strip color from string', t => { t.is(stripAnsi('\u001B[0m\u001B[4m\u001B[42m\u001B[31mfoo\u001B[39m\u001B[49m\u001B[24mfoo\u001B[0m'), 'foofoo'); }); test('strip color from ls command', t => { t.is(stripAnsi('\u001B[00;38;5;244m\u001B[m\u001B[00;38;5;33mfoo\u001B[0m'), 'foo'); }); test('strip reset;setfg;setbg;italics;strike;underline sequence from string', t => { t.is(stripAnsi('\u001B[0;33;49;3;9;4mbar\u001B[0m'), 'bar'); }); test('strip link from terminal link', t => { t.is(stripAnsi('\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'), 'click'); });