Skip to content

Commit cb03cf7

Browse files
committed
Drop to anser dep
1 parent 8083b3d commit cb03cf7

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"author": "Kyle Kelley <[email protected]>",
2626
"license": "MPL-2.0",
2727
"dependencies": {
28+
"anser": "^1.0.1",
2829
"ansi-to-json": "^1.0.0"
2930
},
3031
"peerDependencies": {

src/index.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
const React = require('react');
2+
const Anser = require('anser');
3+
4+
/**
5+
* ansiToJson
6+
* Convert ANSI strings into JSON output.
7+
*
8+
* @name ansiToJSON
9+
* @function
10+
* @param {String} input The input string.
11+
* @return {Array} The parsed input.
12+
*/
13+
function ansiToJSON(input) {
14+
return Anser.ansiToJson(input, {
15+
json: true,
16+
remove_empty: true,
17+
});
18+
}
219

3-
const ansiToJSON = require('ansi-to-json');
420

521
function ansiJSONtoStyleBundle(ansiBundle) {
622
const style = {};

0 commit comments

Comments
 (0)