in-text-search

Simple search function.


Keywords
text, score, search
License
ISC
Install
npm install in-text-search@0.1.0

Documentation

in-text-search

Simple search function.

Usage

var textSearch = require('in-text-search');

var text = 'Some big sample text';
var target = textSearch(text);
var score = target.search('sample');
// score === 1

score = target.search('small sample');
// score === 0.5

target = textSearch(text, {minTextLength: 3, lowercase: true, stopwords: ['small']});
score = target.search('small sample');
// score === 1