index.js 197 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 'use strict'; var stripAnsi = require('strip-ansi'); module.exports = function (str) { var reAstral = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; return stripAnsi(str).replace(reAstral, ' ').length; };