Skip to content

Commit a64703d

Browse files
committed
Require Node.js 12 and move to ESM
1 parent 190724a commit a64703d

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ jobs:
1212
node-version:
1313
- 14
1414
- 12
15-
- 10
1615
steps:
1716
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v1
17+
- uses: actions/setup-node@v2
1918
with:
2019
node-version: ${{ matrix.node-version }}
2120
- run: npm install

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
'use strict';
2-
const ansiRegex = require('ansi-regex');
3-
const replaceStream = require('replacestream');
1+
import ansiRegex from 'ansi-regex';
2+
import replaceStream from 'replacestream';
43

5-
module.exports = () => replaceStream(ansiRegex(), '');
4+
export default function stripAnsiStream() {
5+
return replaceStream(ansiRegex(), '');
6+
}

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
"license": "MIT",
66
"repository": "chalk/strip-ansi-stream",
77
"funding": "https://github.com/chalk/strip-ansi-stream?sponsor=1",
8+
"type": "module",
9+
"exports": "./index.js",
810
"engines": {
9-
"node": ">=4"
11+
"node": ">=12"
1012
},
1113
"scripts": {
1214
"test": "xo && ava"
@@ -40,12 +42,12 @@
4042
"stream"
4143
],
4244
"dependencies": {
43-
"ansi-regex": "^3.0.0",
45+
"ansi-regex": "^6.0.0",
4446
"replacestream": "^4.0.3"
4547
},
4648
"devDependencies": {
47-
"ava": "^1",
48-
"get-stream": "^3.0.0",
49-
"xo": "^0.20.0"
49+
"ava": "^3",
50+
"get-stream": "^6.0.1",
51+
"xo": "^0.38.2"
5052
}
5153
}

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava';
22
import getStream from 'get-stream';
3-
import stripAnsiStream from '.';
3+
import stripAnsiStream from './index.js';
44

55
test('strip color from string', async t => {
66
const stream = stripAnsiStream();

0 commit comments

Comments
 (0)