Socket
Book a DemoInstallSign in
Socket

@fizzog/stringbox

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@fizzog/stringbox

String manipulation utilities

0.6.26
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

String

FAQs

Package last updated on 02 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.