Socket
Socket
Sign inDemoInstall

string-things

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    string-things

A library which provides some basic string manipulation functions


Version published
Weekly downloads
7
Maintainers
1
Created
Weekly downloads
 

Readme

Source

string-things

Simple string functions in one tiny bundle.

I found a work project using a 30kb library to kebab case a string which was of course too large, so I have tried to provide this function and more in a small package for my web projects.

Usage

npm install string-things

or

yarn add string-things

Functions provided

camelCase

import { camelCase } from "string-things";

camelCase("fred bill and Ted");
// => "fredBillAndTed"

camelCase("some muddled u%p te$xt");
// => "someMuddledUpText"

kebabCase

import { kebabCase } from "string-things";

kebabCase("string things");
// => "string-things"

kebabCase("stringThings");
// => "string-things"

capitaliseFirstLetter

import { capitaliseFirstLetter } from "string-things";

capitaliseFirstLetter("charlie");
// => "Charlie"

unescape

import { unescape } from "string-things";

unescape("<div&rt;");
// => "<div>"

titleCase

import { titleCase } from "string-things";

titleCase("aPropertyNameWhichNeedsToBeDisplayedAsATitle");
// => "A Property Name Which Needs To Be Displayed As A Title"

truncate

truncate(stringValue, options)

import { truncate } from "string-things";

truncate("Once upon a time there was a string that was truncated");
// => "Once upon a time there..."

truncate("Once upon a time there was a string that was truncated", {
  length: 15
});
// => "Once upon a time..."

Actively maintained

Every time I need a string function, I will be adding it to this library.

Keywords

FAQs

Last updated on 16 Feb 2019

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc