@alwatr/flat-string
TypeScript icon, indicating that this package has built-in type declarations

1.0.18 • Public • Published

Flat String

This function simplifies the complex C structures that are part of a combined JavaScript string.

If you're frequently combining strings and then using that combined string somewhere else, you might discover that running your string through flatString significantly enhances performance.

In simpler terms, flatString is a function that optimizes the way strings are stored in memory in JavaScript. When you concatenate strings, JavaScript internally creates a complex structure to save memory. However, when you need to use this string, for example, to write it to a file or send it over the network, this complex structure needs to be flattened, which can take time. By using flatString, you flatten the string right after concatenation, making the subsequent use of the string faster.

Installation

yarn add @alwatr/flat-string

Usage

import {flatString} from '@alwatr/flat-string';

myStr = flatString(myStr);

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i @alwatr/flat-string

    Weekly Downloads

    63

    Version

    1.0.18

    License

    MIT

    Unpacked Size

    11.6 kB

    Total Files

    11

    Last publish

    Collaborators

    • njfamirm
    • alimd