npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

string-method

v0.1.15

Published

The [string-method](https://github.com/oreste-abizera/string-method) library provides access to string properties and methods that are not available for the native string in javascript.

Downloads

19

Readme

string-method V0.1.15

The string-method library provides access to string properties and methods that are not available for the native string in javascript.

Installation

Using npm:

$ npm i -g string-method
$ npm i string-method

Note: add --save if you are using npm < 5.0.0

Using yarn:

$ yarn global add string-method
$ yarn add string-method

Usage:

const { capitalize } = require('string-method');

// call a method from module
console.log(capitalize('my sTring')); //My String

or import one method individually (not working well)

const toCamelCase = require('string-method/toCamelCase');

// call a method from module
console.log(toCamelCase('to-camel-case')); //toCamelCase

Available Methods

| Method | Description | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | capitalize | changes the first letter of all words in string to upper case and the rest in lower case | | reverse | reverses the order of the characters in a string | | reverseWord | reverses the order of the words in a string | | isUpperCase | checks if a word is in upper case | | isLowerCase | checks if a word is in lower case | | toCamelCase | changes a word in any order to camel case notation | | isPalindrome | checks if a string is the same in reverse order | | areEqual | checks if two strings are equal | | areEqualIgnoreCase | checks if two strings are equal but ignoring the case | | compareMany | compares any number of strings passed as parameters. Returns true if they are equal otherwise false is returned | | compareManyIgnoreCase | compares any number of strings passed as parameters but ignoring the case. Returns true if they are equal otherwise false is returned | | contains | checks if a string contains another string | | count | checks the number of times a specified value occurs in a string | | countCharacters | returns occurences of each character in a string | | | | countRepetitions | returns letters of a string with its repetition times | | isEmpty | checks whether a string is empty or not | | slugify | makes a slug from a string | | removeDuplicates | removes duplicate words from a string | | isSpace | checks whether all string characters are spaces | | isDigit | checks whether all string characters are digits | | isAlpha | checks whether all string characters are alphabetical characters | | isAlphaNumeric | checks whether all string characters are alphanumeric characters | | longestCombination | returns longest possible sorted combination of strings containing distinct letters in lowercase | | toAlternatingCase | returns a new string with each lowercase letter changed to uppercase and each uppercase letter changed to lowercase | | hasSpaces | returns true if a string contains one or more spaces otherwise it returns false | | countWords | returns number of words in a string | | countConsonants | returns number of consonants in a provided string | | countVowels | returns number of vowels in a provided string | | startsWith | returns true if the first string starts with the provided second string otherwise returns false | | countSpaces | returns the number of spaces in a string | | toTitleCase | changes the string to title case by capitalizing all words in the string except non-starting prepositions | | removeSpaces | removes all spaces in a string | | containsEmoji | checks if a string contains emoji or not |

We are adding others day by day.

Development

Visit our github repository here. Any suggestion or improvement on this library is welcome.

Contributing

Before contributing to this library read this guide. We'll love getting new idea from you.