# word-counter

> WordCounter ===============

Latest version **1.0.8** (published 2016-01-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install word-counter
pnpm add word-counter
yarn add word-counter
bun add word-counter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2016-01-14 |
| First published | 2015-12-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | salvador, zerodragon |

## Links

- npm: https://www.npmjs.com/package/word-counter
- npm.io page: https://npm.io/package/word-counter

## Dependencies (1)

- [coffee-script](https://npm.io/package/coffee-script.md) 1.10.0

## Recent versions

- 1.0.8 (latest) — 2016-01-14
- 1.0.7 — 2015-12-22
- 1.0.6 — 2015-12-17
- 1.0.5 — 2015-12-11
- 1.0.4 — 2015-12-10
- 1.0.3 — 2015-12-10
- 1.0.2 — 2015-12-10
- 1.0.1 — 2015-12-10
- 1.0.0 — 2015-12-10

## README

WordCounter  
===============

This little repo can receive a stream of texts and count all the words grouped by incidences.  

##Install

	npm install --save word-counter

##Usage

~~~~Javascript
	var WordCounter = require('word-counter');
	var wc = new WordCounter();

	wc.count("string of several words in this string");

	var report = wc.report();

	console.log(report);

	/*
		[ [ 'string', 2 ],
		[ 'several', 1 ],
		[ 'words', 1 ],
		[ 'this', 1 ] ]
	*/
	
	console.log(wc.raw());

	/*
		{ string: 2, several: 1, words: 1, this: 1 }
	*/
~~~~

##Definitions
### new WordCounter([SkipWords])

- SkipWords: (Optional | Array) An array of words to skip counting

### wc.count(input [,minLen])
Counts the words inside a given string.

- input: (Required | String) Any type of text string to count the words
- minLen: (Optional | Integer) The minimum length of word to be counted, default=2

### wc.report()
Returns an ordered array of [Word,quantity]. No params needed

### wc.raw()
Returns the raw object of words (use it wisely). No params needed

##Demo
Refer to ```test/test.coffee``` or just run ```npm test```

---
_Source: https://npm.io/package/word-counter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
