npm.io
0.0.1 • Published 8 years ago

file-keyword-density

Licence
ISC
Version
0.0.1
Deps
1
Size
43 kB
Vulns
0
Weekly
0
Stars
1

file-keyword-density

Analyze keyword density of an entire text/html file

Tests

npm test

Usage

const TEXT_FILE_PATH = '...';      // html or text file with your keywords
const STOP_WORD_FILE_PATH = '...'; // set if you don't want to use default one
const bulkdensity = require('./density');
const bk = new bulkdensity(TEXT_FILE_PATH, {minKeywordLength: 3, stopWordFile: STOP_WORD_FILE_PATH});

bk.getDensity()
    .then((keywords) => {
        console.log(JSON.stringify(keywords));
    })
    .catch((err) => {
        console.error(err);
    });

Keywords