Skip to content

Commit

Permalink
Require Node.js 12 and move to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 16, 2021
1 parent 190724a commit a64703d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ jobs:
node-version:
- 14
- 12
- 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
const ansiRegex = require('ansi-regex');
const replaceStream = require('replacestream');
import ansiRegex from 'ansi-regex';
import replaceStream from 'replacestream';

module.exports = () => replaceStream(ansiRegex(), '');
export default function stripAnsiStream() {
return replaceStream(ansiRegex(), '');
}
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"license": "MIT",
"repository": "chalk/strip-ansi-stream",
"funding": "https://github.com/chalk/strip-ansi-stream?sponsor=1",
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=4"
"node": ">=12"
},
"scripts": {
"test": "xo && ava"
Expand Down Expand Up @@ -40,12 +42,12 @@
"stream"
],
"dependencies": {
"ansi-regex": "^3.0.0",
"ansi-regex": "^6.0.0",
"replacestream": "^4.0.3"
},
"devDependencies": {
"ava": "^1",
"get-stream": "^3.0.0",
"xo": "^0.20.0"
"ava": "^3",
"get-stream": "^6.0.1",
"xo": "^0.38.2"
}
}
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from 'ava';
import getStream from 'get-stream';
import stripAnsiStream from '.';
import stripAnsiStream from './index.js';

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

0 comments on commit a64703d

Please sign in to comment.