vindecodex / counting-str

Module for counting strings, characters length

Home Page:https://www.npmjs.com/package/counting-str

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Module for counting strings, characters length

https://www.npmjs.com/package/counting-str

License:MIT License


Languages

Language:TypeScript 56.0%Language:JavaScript 40.8%Language:Makefile 3.2%