
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Utility functions to speedup development
Number #TODO
Install with npm:
$ npm install --save dev-utilz
This library will support following string utility functions
Check whether the given value is string or not. if valid string return tru else false.
import { isString } from "dev-utilz";
console.log(isString("string")); // true
console.log(isString(1)); // false
Check whether the string is empty or not.
import { isNotEmpty } from "dev-utilz";
console.log(isNotEmpty("string")); // true
console.log(isNotEmpty(1)); // false
console.log(isNotEmpty("")); // false
console.log(isNotEmpty(" ")); // true
console.log(isNotEmpty(" ", true)); // false
If value is string return value else return empty string.
import { returnValidString } from "dev-utilz";
console.log(returnValidString("string")); // "string"
console.log(returnValidString(1)); // ""
Capitalize the string
import { capitalize } from "dev-utilz";
console.log(capitalize("string")); // String
console.log(capitalize("test String")); // Test string
Capitalize each word in string
import { capitalizeAll } from "dev-utilz";
console.log(capitalizeAll("string")); // String
console.log(capitalizeAll("test string")); // Test String
Throw error if value is not a string else return string
import { throwErrorIfNotString } from "dev-utilz";
console.log(throwErrorIfNotString("string")); // string
console.log(throwErrorIfNotString("")); // ""
console.log(throwErrorIfNotString(1)); // throw error
Convert entire string to lowercase
import { toLowerCase } from "dev-utilz";
console.log(toLowerCase("string")); // string
console.log(toLowerCase("TEST String")); // test string
Convert entire string to uppercase
import { toUpperCase } from "dev-utilz";
console.log(toUpperCase("string")); // STRING
console.log(toUpperCase("TEST String")); // TEST STRING
Function to get the first n letters of a string
import { getFirstLetters } from "dev-utilz";
console.log(getFirstLetters("string", 2)); // st
Function to get substring from given string
import { getSubString } from "dev-utilz";
console.log(getSubString("John", 1, 3)); // oh
Function to get the last n letters of a string
import { getLastLetters } from "dev-utilz";
console.log(getLastLetters("string", 2)); // ng
Check whether the string is start with given string
import { startWith } from "dev-utilz";
console.log(startWith("string", "str")); // true
console.log(startWith("TEST String", "John")); // false
Check whether the string is end with given string
import { endWith } from "dev-utilz";
console.log(endWith("string", "ing")); // true
console.log(endWith("TEST String", "John")); // false
Function to repeat string n times and return array
import { times } from "dev-utilz";
console.log(times("string", 2)); // ["string","string"]
Pads string on the left side if it's shorter than length. Padding characters are truncated if they exceed length.
import { padStart } from "dev-utilz";
console.log(padStart("abc", 6)); // ' abc'
console.log(padStart("abc", 6, "_")); // '___abc'
Pads string on the right side if it's shorter than length. Padding characters are truncated if they exceed length.
import { padEnd } from "dev-utilz";
console.log(padEnd("abc", 6)); // 'abc '
console.log(padEnd("abc", 6, "_")); // 'abc___'
Gets the number of symbols in string.
import { stringSize } from "dev-utilz";
console.log(stringSize("qwerty")) // 6
FAQs
Module intended to be used by developers to help with development
We found that dev-utilz demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.