0.6.26 • Published 7 years ago

@fizzog/stringbox v0.6.26

Weekly downloads
-
License
ISC
Repository
github
Last release
7 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

7 years ago

0.6.25

7 years ago

0.6.24

7 years ago

0.6.23

7 years ago

0.6.22

7 years ago

0.5.21

7 years ago

0.4.21

7 years ago

0.4.20

7 years ago

0.4.19

7 years ago

0.4.18

7 years ago

0.3.17

7 years ago

0.2.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago