0.0.10 • Published 5 years ago

stringfu v0.0.10

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

String Fu

String manipulation and conversion functions including for working with bytes/hex strings.

Warning: This sofware is under construction and in pre-alpha state.

Example usage

import { reverseBytes } from 'stringfu';

console.log(reverseBytes('0FAB03')); // 03AB0F

API

Table of Contents

leftPad

Takes a string and makes it length, left-padded with padChar

Parameters

rightPad

Takes a string and makes it length, right-padded with spaces

Parameters

toBytes

Takes a hex string and returns Uint8Array of bytes

Parameters

fromBytes

Takes an array of bytes and returns them as a string

Parameters

reverseBytes

Takes a string of hexadecimal and returns a string with the bytes reversed

Parameters

containsOnly

Returns true if string only contains nominated chars

Parameters

isInteger

Returns true if string represents an integer number

Parameters

splitWidth

Return a string as an array split at lineWidth chars

Parameters

  • str string String to check
  • lineWidth number Make lines this width

Returns Array<string> Array of strings

isWhitespace

Checks if string contains only whitespace characters

Parameters

Returns boolean True/false

isAlphaNumeric

Checks if string contains only alphanumeric characters

Parameters

Returns boolean True if only alphanumeric

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago