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

1.0.23 • 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);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.23
    80
    • latest

Version History

Package Sidebar

Install

npm i @alwatr/flat-string

Weekly Downloads

364

Version

1.0.23

License

MIT

Unpacked Size

12.4 kB

Total Files

10

Last publish

Collaborators

  • alimd