Exam.js
You can use this library for examing something for something :)
Compatibility
- IE9+, Edge, Chrome, Opera, Firefox, Safari
- Node.js
Notes
- Entirely case insensitive for all arguments and results
exam()
Can take string or node element (object). Will examine all content within that element if it's node element..find()
Takes the array as argument. Can be reusable..strictFind()
is the same as find()
, but checks everything with regexp- within
.yep()
, .nope()
and .any()
callbacks you will get entire 'result' object with
filters
filters you setfound
found wordsunfound
unfound words
Simple use
exam("Could you find my name here?")
.find(["could"])
.yep( result => {
console.log(result.found)
})
.nope( result => {
console.log(result.unfound)
})
.any( result => {
console.log(result)
})
Reuse methods
NB! Will examine by different filters twice and independently
exam("How about that, huh?")
.find(["abou"])
.any( result => {
console.log(result.filters)
console.log(result.found)
console.log(result.unfound)
})
.strictFind(["about"])
.yep( result => {
console.log(this.found)
})
Enjoy!