Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

text-segmentation

niklasvh17.8mMIT1.0.3TypeScript support: included

text-segmentation ==============

readme

text-segmentation

CI NPM Downloads NPM Version

A JavaScript library for Grapheme Breaking and identifying Grapheme Boundaries, implementing the Unicode Line Breaking Algorithm (UAX #29)

Installing

You can install the module via npm:

npm install text-segmentation

Example

import {splitGraphemes} from 'text-segmentation';

const graphemes =  splitGraphemes('Hello 👨‍👩‍👧‍👦!');

Testing

You can run the test suite with:

npm test

The library implements all the GraphemeBreakTest.txt tests.

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.0.3 (2022-01-22)

fix

1.0.2 (2021-08-10)

deps

  • update base64-arraybuffer (3804223)

1.0.1 (2021-08-09)

docs

feat

  • expose fromCodePoint / toCodePoints (a497aeb)

1.0.0 (2021-08-09)

feat