{"name":"ansi-regex","description":"Regular expression for matching ANSI escape codes","dist-tags":{"latest":"6.0.1"},"versions":{"6.0.1":{"name":"ansi-regex","version":"6.0.1","description":"Regular expression for matching ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/ansi-regex.git"},"funding":"https://github.com/chalk/ansi-regex?sponsor=1","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd","view-supported":"node fixtures/view-codes.js"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"types":"./index.d.ts","gitHead":"d908492e0070f26552fad1b25e339aff9011ae8b","bugs":{"url":"https://github.com/chalk/ansi-regex/issues"},"_id":"ansi-regex@6.0.1","_nodeVersion":"16.0.0","_npmVersion":"7.23.0","dist":{"integrity":"sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==","shasum":"3183e38fae9a65d7cb5e53945cd5897d0260a06a","tarball":"http://localhost:4260/ansi-regex/ansi-regex-6.0.1.tgz","fileCount":5,"unpackedSize":5667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhO78hCRA9TVsSAnZWagAA+F4P/0Xt4D0GoXduv+o147iO\nj3b1oPSNypnmThhmCAUInwB1Xd9SXFEjzuNDNGX/8xeWUQrJssJ+SBEzb5te\nr34P6wPHUeuTa2p1j3ABN9ABP/NPCPkaEDgjx86ImkT++3VI8yNEuSSOsghI\n5Ssvhm6bLJBWzCt/cweIG7x4ZJQPeUbyoWIJmBobCDyNuVgabmk9B2B1RyO0\nf2aounmh5w1fBWsx65MjTi7fu4e/GOP+xscf9Rn1AdRP6rcxJakPjaGTF3HE\naz6UNP9UZCuZ4rb6xOFEfLmiqfNbK31NKNLPrABDXF6NkbJepsUhNmju32cg\nUuo4lSkxfFaVyFXFB1h62RmDdemxZWl9j24fVt+99K4BH6xOiwPmOHHHPJnL\nXNuZ6eCwdcLjPe8Af/0GEsFqdDu591Hwi2Nl8UNAD5hCzcDTITOTL95Dopaw\nGzySTClnDsh17Ud73FWM51FQzVDORa2vOmVzQts3aHlF93ufk9RHtlN9YxAV\nUvM3IxMHx2O8Rc2gSc6t/pJAdFACBLkLDGtcQVhxaFcTpGXrKUr+KN2gFC4D\nXZA/MvK0YXBmrwec20k2wTAdmi7XO5k8HciCPT7MZDJONTBlt9cC/LL41JNc\nvxj0A0loP9R44eVoAJOSbxhpnteeIjw4rwkOySZOqqEsUw5MDFp/peiojlcv\nCOQk\r\n=VRgZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWW/ZEXmQGK500jBFw7uRYczrrcLTzOEnm3uDiNPs6rAIgcKX8SLAOUpBu/tWg+7vPsMA4l7siraEVYPpTETOVqX0="}]},"directories":{},"_hasShrinkwrap":false},"5.0.1":{"name":"ansi-regex","version":"5.0.1","description":"Regular expression for matching ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/ansi-regex.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd","view-supported":"node fixtures/view-codes.js"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.9.0","xo":"^0.25.3"},"types":"./index.d.ts","readme":"#ansi-regex\n\n>Regularexpressionformatching[ANSIescapecodes](https://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install ansi-regex\n```\n\n\n## Usage\n\n```js\nconst ansiRegex = require('ansi-regex');\n\nansiRegex().test('\\u001B[4mcake\\u001B[0m');\n//=> true\n\nansiRegex().test('cake');\n//=> false\n\n'\\u001B[4mcake\\u001B[0m'.match(ansiRegex());\n//=> ['\\u001B[4m', '\\u001B[0m']\n\n'\\u001B[4mcake\\u001B[0m'.match(ansiRegex({onlyFirst: true}));\n//=> ['\\u001B[4m']\n\n'\\u001B]8;;https://github.com\\u0007click\\u001B]8;;\\u0007'.match(ansiRegex());\n//=> ['\\u001B]8;;https://github.com\\u0007', '\\u001B]8;;\\u0007']\n```\n\n\n## API\n\n### ansiRegex(options?)\n\nReturns a regex for matching ANSI escape codes.\n\n#### options\n\nType: `object`\n\n##### onlyFirst\n\nType: `boolean`<br>\nDefault: `false` *(Matches any ANSI escape codes in a string)*\n\nMatch only the first ANSI escape.\n\n\n## FAQ\n\n### Why do you test for codes not in the ECMA 48 standard?\n\nSome of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be