npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

stringstats

0.1.1 • Public • Published

Build Status

string-stats

Calculates frequencies and probabilities of a string

Build

npm install
npm run build

Test

npm test

Usage

Review test/stringstats.spec.js for a complete test suite

let teststr = 'helloworld123';
let stringstats = new StringStats(teststr);

  { '1': { counter: 1, probability: 0.07692307692307693 },
    '2': { counter: 1, probability: 0.07692307692307693 },
    '3': { counter: 1, probability: 0.07692307692307693 },
    h: { counter: 1, probability: 0.07692307692307693 },
    e: { counter: 1, probability: 0.07692307692307693 },
    l: { counter: 3, probability: 0.23076923076923078 },
    o: { counter: 2, probability: 0.15384615384615385 },
    w: { counter: 1, probability: 0.07692307692307693 },
    r: { counter: 1, probability: 0.07692307692307693 },
    d: { counter: 1, probability: 0.07692307692307693 } }

install

npm i stringstats

Downloadsweekly downloads

3

version

0.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability