1.0.3 • Published 1 year ago

cwords v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago