1.0.0 • Published 5 months ago

jees-ansi-length v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

ANSI string length ✨

Determine the true length of a string by accurately accounting for astral symbols while disregarding ANSI escape codes. ✨

  • Install

    npm i jees-ansi-length                        #  📥 install
    import length from 'jees-ansi-length';        // 📦 import
  • Syntax

    const result = length(text);                  /* ✨ have fun ✨  */
  • Example

    length('\u001B[31mPlain !\u001B[0m');
    // => 7
    
    length('\u001B[31mPlain !\u001B[0m', true);
    // => 9 (16 - 7)

Documents


This package is part of the jees framework.


Made with ❤ by Maysara Elshewehy

1.0.0

5 months ago