New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

saviourjs

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saviourjs

A collection of JavaScript utility functions

latest
npmnpm
Version
1.0.2
Version published
Maintainers
0
Created
Source

saviourjs

A collection of utility functions built to save your ass. It includes functions for common operations like string manipulation, array manipulation, object manipulation, and more.

Installation

You can install saviourjs using npm:

npm install saviourjs

Or using yarn:

yarn add saviourjs

Or using pnpm:

pnpm add saviourjs

Usage

FunctionDescriptionParameters
slugifyConverts a string into a URL-friendly slug.text: string
getNthLetterGets the nth letter from a string.text: string, n: number
getFirstLetterGets the first letter of a string.text: string
getLastLetterGets the last letter of a string.text: string
capitalizeCapitalizes the first letter of a string.text: string
reverseStringReverses a string.text: string
isPalindromeChecks if a string is a palindrome.text: string
truncateTruncates a string to a specified length.text: string, length: number
deepCloneCreates a deep clone of an object.obj: T
isEmptyChecks if a value is empty.value: any
isEmailValidates an email address.email: string
camelCaseConverts a string to camelCase.text: string
kebabCaseConverts a string to kebab-case.text: string
snakeCaseConverts a string to snake_case.text: string
randomStringGenerates a random string of specified length.length: number
flattenArrayFlattens a nested array.array: any[]
uniqRemoves duplicate values from an array.array: any[]
chunkSplits an array into chunks of a specified size.array: T[], size: number
shuffleArrayRandomly shuffles an array.array: T[]
isEqualPerforms a deep comparison between two values.value: any, other: any
groupByGroups elements of an array based on a key.`array: T[], key: ((item: T) => string)
formatDateFormats a date into a readable string.date: Date, format: string
parseQueryStringToObjectParses a query string into an object.queryString: string
parseObjectToQueryStringConverts an object into a query string.obj: { [key: string]: any }
selectRandomSelects a random element from an array.array: T[]
capitalizeFirstLetterCapitalizes the first letter of a given string and converts the rest to lowercase.text: string

Keywords

utility

FAQs

Package last updated on 14 Jul 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