New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

util-methods

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

util-methods

Util methods is a versatile utility library designed to simplify your programming tasks by providing a comprehensive collection of methods for manipulating strings, arrays, objects, and more

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

String Utilities NPM Package

Welcome to the String Utilities package! This library provides a set of useful JavaScript methods for string manipulation, making it easier to work with text data in your projects.

Installation

You can install the package using npm:

npm install util-methods

reverse(str: string): string

Reverses the input string.

Example:

import { reverse } from 'string-utilities';

console.log(reverse('hello')); // 'olleh'

camelCase(str: string): string

Converts a string into camelCase format

Example

import { camelCase } from 'string-utilities';

console.log(camelCase('hello world')); // 'helloWorld'

isPalindrome(str: string): boolean

Checks if the input string is a palindrome (reads the same forwards and backwards).

Example

import { isPalindrome } from 'string-utilities';

console.log(isPalindrome('racecar')); // true
console.log(isPalindrome('hello'));   // false

stripSymbol(str: string, symbol: string): string

Removes all instances of a specified symbol from the input string.

import { stripSymbol } from 'string-utilities';

console.log(stripSymbol('hello@world!', '@')); // 'helloworld!'

generateRandomString(length: number): string

Generates a random string of the specified length.

Example

import { generateRandomString } from 'string-utilities';

console.log(generateRandomString(10)); // 'a1B2c3D4e5' (example output)

Keywords

FAQs

Package last updated on 02 Oct 2024

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc