Skip to content

Commit ddbe7aa

Browse files
authored
Merge pull request #16 from cto-af/docs-link
Add link to docs
2 parents 7605fbd + b051074 commit ddbe7aa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ npm install @cto.af/string-width
1212

1313
## API
1414

15+
Full [documentation](https://cto-af.github.io/string-width/) is available.
16+
1517
```js
1618
import {StringWidth, AMBIGUOUS, POTENTIAL_EMOJI} from '../lib/index.js'
1719

@@ -20,7 +22,7 @@ sw.width('foo') // 3
2022
sw.width('\u{1F4A9}') // 2: Emoji take two cells
2123
sw.width('#\ufe0f\u20e3') // 2: More complicated emoji
2224
sw.break('foobar', 3) // [
23-
// {string: 'foo', cells: 3, last: false},
25+
// {string: 'foo', cells: 3},
2426
// {string: 'bar', cells: 3, last: true}
2527
// ]
2628

@@ -56,6 +58,8 @@ const custom = new StringWidth({
5658
emoji
5759
- Since backspace has a negative width, ensure that the total width is never
5860
less than zero.
61+
- ANSI escape sequences are ignored for width, unless the `includeANSI` option
62+
is enabled.
5963

6064
## Chinese, Japanese, or Korean (CJK) contexts
6165

0 commit comments

Comments
 (0)