1.0.3 • Published 2 months ago

cwords v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

cwords

A simple npm package to count the number of words in a sentence.

Installation

You can install the cwords package via npm:

npm install cwords
yarn add cwords

Usage

const wordCount = require('cwords');

const sentence = "This is a sample sentence.";

const count = wordCount(sentence);

console.log(count); // Output: 5

API

wordCount(sentence: string): number
sentence: The input sentence for which the word count is to be calculated.
Returns the number of words in the sentence.

Example

const wordCount = require('cwords');

const sentence = "Hello, world! This is a test sentence.";

const count = wordCount(sentence);

console.log(count); // Output: 7
1.0.2

2 months ago

1.0.3

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago