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

chkchars

v1.2.0

Published

You can use this package to verify whether there are caps or symbols or numbers in a string. This will will be very useful if you are making a signup system there you can check the validity of the password, username etc. Or you can use this package in any

Downloads

13

Readme

chkchar

This is a utility package. You can use this to check the availibility of capitals, symbols or numbers in a string and also seperate a string into chuncks.

Methods

  1. caps(phrase)
  2. numbers(phrase)
  3. symbols(phrase)
  4. fullCount(phrase)
  5. isEnglish(phrase)
  6. allNums(phrase)
  7. allSymbols(phrase)
  8. allCaps(phrase)
  9. sliceToChunks(phrase, number)

Installation

npm i chkchars

1.caps(phrase)

Checks if there are capital english letters in a given string. phrase: string

Output format

{

status: true / false    --- true === contains   false === does not contain
count: number           --- number of caps in the given phrase
fount: array            --- all the caps found in the given phrase (no duplicates)

}

2.numbers(phrase)

Checks if there are numbers in a given string. phrase: string

Output format

{

status: true / false    --- true === contains   false === does not contain
count: number           --- number of numbers in the given phrase
fount: array            --- all the numbers found in the given phrase (no duplicates)

}

3.symbols(phrase)

Checks if there are symbols in a given string. phrase: string

Output format

{

status: true / false    --- true === contains   false === does not contain
count: number           --- number of symbols in the given phrase
fount: array            --- all the symbols found in the given phrase (no duplicates)

}

4.fullCount(phrase)

Returns the number of occurences of all caps, numbers and symbols

Output format

{

caps:       --- number of english capital letters found.
numbers:    --- number of numbers found.
symbols:    --- number of symbols found.

}

5.isEnglish(phrase)

Checks if the given string is composed only with english letters.

If all the characters are english letters

true

If at least one of them not a english letter

false

6.allNums(phrase)

Checks if the given string is composed only with numbers.

If all the characters are numbers

true

If at least one of them not a number

false

7.allSymbols(phrase)

Checks if the given string is composed only with symbols.

If all the characters are symbols

true

If at least one of them not a symbol

false

8.allCaps(phrase)

Checks if the given string is composed only with english capital letters.

If all the characters are english capital letters

true

If at least one of them not a english capital letter

false

9.sliceToChunks(phrase, number)

Slices a given string into chuncks of length of given "number" parameter. Remember to provide a string of length that is perfectly divided by the "number" parameter.

This method returns a array of strings.

If phrase === "dictionary" number === 5

output

["dicti", "onary"]