Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

vindecodex/counting-str

Repository files navigation

Counting STR (Counting String)

npm GitHub repo size GitHub Build status npm

Working Status

🚧 Under Construction 🚧

Installation

npm i counting-str

Usage

Count Words

const { countWords } = require('counting-str');
countWords("Hello World"); // return 2

Count Characters

const { countCharacters } = require('counting-str');
countCharacters("Hello World"); // return 11

Count Characters without including spaces

countCharacters("Hello World", { withSpaces: false }); // return 10

Count Spaces

const { countSpaces } = require('counting-str');
countSpaces("Hello World"); //return 1

Count Vowels

const { countVowels } = require('counting-str');
countVowels("Hello World"); // return 3

Count an occurence of a Character/String in another String

const { countOccurences } = require('counting-str');
countOccurences("Hello World", "l"); // return 3
Name Arguments Info
countWords String returns # of words in a string
countSpaces String returns # of spaces in a string
countVowels String returns # of vowels in a string
countCharacters Object { withSpaces: boolean } withSpaces: true returns # of characters included space
countOccurences (String, String) returns occurences count in a string

🤝 Feel free to open a pull request to add more features.

  • make clone
  • create a pull request
  • feel free to open an issue
  • OPEN FOR BEGINNERS AND NEW CONTRIBUTORS

How to Contribute ?

GUIDE FOR CONTRIBUTORS