0.6.26 • Published 6 years ago

@fizzog/stringbox v0.6.26

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

stringbox   npm version

A collection of String manipulation utilities.


Install:

npm i @fizzog/stringbox    or yarn add @fizzog/stringbox


Usage:
import { abbreviate } from '@fizzog/stringbox';

const source = 'The quick brown fox jumps over the lazy dog';
const result = abbreviate(source);
console.log(result);
> The quick ...

note: stringbox makes use of ES6 and will require a JS compiler like Babel. If you're using ReactJS and create-react-app, this is already build in.


Index:
  • abbreviate(source, size?) returns new abbreviated String no wider than 10 characters or size?. Appended with ellipses.
  • isFat(source) returns true for Strings with length beyond whitespace.
  • isString(source) returns true for objects or primitives that are Strings.
  • toNumber(source) returns base 10 version of numeric Strings. Otherwise, 0.
  • orDefault(source, replacement?) returns source when isFat, otherwise replacement.
  • uuid() returns a version 4, universally unique identifier with a format of 8-4-4-4-12. Producing cryptographically strong random values.
0.6.26

6 years ago

0.6.25

6 years ago

0.6.24

6 years ago

0.6.23

6 years ago

0.6.22

6 years ago

0.5.21

6 years ago

0.4.21

6 years ago

0.4.20

6 years ago

0.4.19

6 years ago

0.4.18

6 years ago

0.3.17

6 years ago

0.2.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago