split-word

1.0.1 • Public • Published

split-word

Build status Test coverage NPM version NPM Downloads Prettier Conventional Commits

Splits words like Microsoft word with state machine

Installation

npm install split-word
# or use yarn 
yarn add split-word

Usage

const { wordChunks, wordCount, wordSlice } = require('split-word')
 
wordCount('你好 hello world') // => 4
wordChunks('你好 hello world') // => ['你', '好 ', 'hello ', 'world']
wordSlice('你好 hello world', 0, 2) // => '你好 '

Contributing

  • Fork it!
  • Create your new branch:
    git checkout -b feature-new or git checkout -b fix-which-bug
  • Start your magic work now
  • Make sure npm test passes
  • Commit your changes:
    git commit -am 'feat: some description (close #123)' or git commit -am 'fix: some description (fix #123)'
  • Push to the branch: git push
  • Submit a pull request :)

Authors

This library is written and maintained by imcuttle, moyuyc95@gmail.com.

License

MIT - imcuttle 🐟

/split-word/

    Package Sidebar

    Install

    npm i split-word

    Weekly Downloads

    116

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    16.7 kB

    Total Files

    16

    Last publish

    Collaborators

    • moyuyc