1.0.6 • Published 3 years ago

text-chopper v1.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

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
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago