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.- within
.yep()
, .nope()
and .any()
callbacks you can access (return arrays only)
this.filters
return filters you setthis.found
return found wordsthis.unfound
return unfound words
Simple use
exam(document.body)
.find(['badword1', 'badword2', 'badword3'])
.yep( => {
})
.nope( => {
})
.any( => {
})
Reuse .find()
method
NB! Will examine by different filters twice and independently
exam(document.body)
.find(['badword1', 'badword2', 'badword3'])
.any( => {
console.log(this.filters)
console.log(this.found)
})
.find(['copyright'])
.yep( => {
console.log(this.found)
})
Enjoy!