chalk/strip-ansi


The issue has been closed
suggestion: offer a "default" export option to increase compatibility with es6 #31
starpit posted onGitHub
when coding in typescript, using an es6
or exnext
module backend, the suggested
import stripAnsi = require('strip-ansi')
is not allowed
error TS1202: Import assignment cannot be used when targeting ECMAScript modules
an option, in these cases, is to use instead
import * as stripAnsi from 'strip-ansi'
but this requires that one's entire project be compiled with allowSyntheticDefaultImports
, which has fairly wide-ranging implications on the code base, especially with regards to dynamic imports.
might i suggest that strip-ansi offer e.g. an es6.js whose content is something like:
https://github.com/starpit/strip-ansi/blob/es6/es6.js https://github.com/starpit/strip-ansi/blob/es6/es6.d.ts
which would allow
import stripAnsi from 'strip-ansi/es6'