Socket
Book a DemoInstallSign in
Socket

text-chopper

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-chopper

Chop a large text to array

latest
Source
npmnpm
Version
1.0.7
Version published
Weekly downloads
12
-87.23%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

text

FAQs

Package last updated on 13 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts