diff --git a/.travis.yml b/.travis.yml index 2ae9d62..f3fa8cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,3 @@ language: node_js node_js: - '10' - '8' - - '6' diff --git a/index.d.ts b/index.d.ts index 2500c20..77e0fa3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,12 @@ /** Get the visual width of the widest line in a string - the number of columns required to display it. + +@example +``` +import widestLine from 'widest-line'; + +widestLine('古\n\u001B[1m@\u001B[22m'); +//=> 2 +``` */ export default function widestLine(input: string): number; diff --git a/package.json b/package.json index ff99ba2..edd1f2d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "sindresorhus.com" }, "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "test": "xo && ava && tsd-check" @@ -22,7 +22,6 @@ "keywords": [ "string", "character", - "char", "unicode", "width", "visual", @@ -45,7 +44,7 @@ "fixed-width" ], "dependencies": { - "string-width": "^3.1.0" + "string-width": "^4.0.0" }, "devDependencies": { "ava": "^1.3.1",