Socket
Book a DemoInstallSign in
Socket

string-lib-1

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-lib-1

A simple JavaScript library to manipulate strings

1.0.6
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

TS-JS String Manipulation Library

npm npm bundle size

A simple JavaScript library to manipulate strings.

Installation

Use the package manager npm to install.

npm i string-lib-1

Link to npm library

Usage

const stringLib = require("string-lib-1");

stringLib.capitalize('hello world');
// returns "Hello world"

stringLib.allCaps('foo bar');
// returns "FOO BAR"

stringLib.capitalizeWords('hello world');
// returns "Hello World"

stringLib.removeExtraSpaces("   Hello    world!  buttons  ");
// returns "hello world! buttons"

stringLib.kebobCase("   Hello    world!  buttons  ");
// returns "hello-world-buttons"

stringLib.snakeCase("   Hello    world!  buttons  ");
// returns "hello_world_buttons"

stringLib.camelCase("   Hello    world!  buttons  ");
// returns "helloWorldButtons"

stringLib.shift("Hello world!");
// returns "ello world!H"

stringLib.makeHashTag("Amazing bongo drums for sale", 3);
// returns an array of the n longest words of a given string, with a hashtag '#' prepended to them
// returns ['#amazing', '#bongo', '#drums']

stringLib.isEmpty(`   `);
// returns true

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Testing

To run tests:

npm test

To check code test coverage:

npx jest --coverage

License

MIT

FAQs

Package last updated on 15 Jun 2022

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.