index.js 305 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
'use strict';
const stripAnsi = require('strip-ansi');
const astralRegex = require('astral-regex');

const stringLength = string => stripAnsi(string).replace(astralRegex(), ' ').length;

module.exports = stringLength;
// TODO: Remove this for the next major release
module.exports.default = stringLength;