text-chopper

1.0.6 • Public • Published

text-chopper

Divide a long text to small chunks. The text is divided at just the end of line. The byte length of each chunks are smaller than a size specified by chunkSize of parameter options.

This is available on both of browser and node.js

USAGE

Import this module by the CommonJS way.

const TextChopper = require("text-chopper");

const text = [
    "ABCDEFG",
    "HIJKLMN",
    "OPQRSTU",
].join("\r\n");

const chunks = TextChopper.chop(
    text, {chunkSize: 10});

// chunks[0] == "ABCDEFG\r\n"
// chunks[1] == "HIJKLMN\r\n"
// chunks[2] == "OPQRSTU\r\n"

INSTALLATION

Use npm to install.

$ npm install --save text-chopper

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.65latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.65
1.0.53
1.0.43
1.0.33
1.0.22
1.0.12
1.0.02

Package Sidebar

Install

npm i text-chopper

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

10.7 kB

Total Files

10

Last publish

Collaborators

  • vzg03566