diff --git a/cli.js b/cli.js index aaacb52..d592d97 100755 --- a/cli.js +++ b/cli.js @@ -1,7 +1,8 @@ #!/usr/bin/env node -const min = require('.') -const stream = min() +import createTapMinReporter from './index.js' + +const stream = createTapMinReporter() process.stdin .pipe(stream) diff --git a/index.js b/index.js index 63efe24..a49a831 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,10 @@ -'use strict' - -const {PassThrough} = require('stream') -const duplexer = require('duplexer3') -const hirestime = require('hirestime') -const Parser = require('tap-parser') -const ms = require('pretty-ms') -const chalk = require('chalk') -const util = require('util') +import {PassThrough} from 'node:stream' +import duplexer from 'duplexer3' +import hirestime from 'hirestime' +import {Parser} from 'tap-parser' +import ms from 'pretty-ms' +import chalk from 'chalk' +import util from 'node:util' const reporter = () => { const onResults = (data) => { @@ -56,4 +54,4 @@ const reporter = () => { return result } -module.exports = reporter +export default reporter diff --git a/package.json b/package.json index 6d8285a..9cfb7ca 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "tap-min", "version": "2.0.1", "description": "Minimal TAP output formatter.", + "type": "module", "bin": { "tap-min": "cli.js" },