2.0.0 • Published 5 years ago

@pierretrolle/words-counter v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Words Counter

A library to count words' occurrence

Install

yarn add @pierretrolle/words-counter

Usage

var wordsCounter = require('@pierretrolle/words-counter');

wordsCounter('This is a text with some text double occurrences.');

Results:

  {
    "double": 1,
    "is": 1,
    "occurrences": 1,
    "some": 1,
    "text": 2,
    "this": 1,
    "with": 1
  }

Init environment for development

# install Yarn
npm install -g yarn@1.10.1

Build Setup

# install dependencies
yarn

Lint and Test

# start linter
yarn lint

# fix linter errors
yarn lint:fix

# run all tests
yarn test

# run all tests in watch mode
yarn test:watch