Huge News!Announcing our $40M Series B led by Abstract Ventures.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.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

Utilities Methods 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

Import the method into your file and execute it once the DOM is fully loaded.

Vanilla JS

const { methodName } = require('util-methods');
document.addEventListener('DOMContentLoaded', function() {
    utilMethods();
});

React Class Component

 componentDidMount(){
      utilMethods();
    }

React Functional Component

   useEffect(()=>{
        utilMethods();       
    },[])

Vue Component

mounted() {
  this.utilMethods();
}

reverse(str: string): string

Reverses the input string.

Example:

import utilMethods from 'util-methods';

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

camelCase(str: string): string

Converts a string into camelCase format

Example

import utilMethods from 'util-methods';

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 utilMethods from 'util-methods';

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 utilMethods from 'util-methods';

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

generateRandomString(length: number): string

Generates a random string of the specified length.

Example

import utilMethods from 'util-methods';

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