Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

examjs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

examjs

Examin your blog content for bad words

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by233.33%
Maintainers
1
Weekly downloads
 
Created
Source

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 set
    • this.found return found words
    • this.unfound return unfound words

Simple use

exam(document.body)
	.find(['badword1', 'badword2', 'badword3']) 
	.yep( => {
		// Should use 'yep' only if something out there
	})
	.nope( => {
		// Should use 'nope' if nothing out there
	})
	.any( => {
		// Should use 'any' if you want just get 'found', 'unfound' and 'filters'
	})

Reuse .find() method

NB! Will examine by different filters twice and independently

exam(document.body)
	.find(['badword1', 'badword2', 'badword3']) 
	.any( => {
		// we can reuse filters we set
		console.log(this.filters)
		// and be ready that these badwords we will find
		console.log(this.found)
	})
	.find(['copyright'])
	.yep( => {
		// copyright is out there
		console.log(this.found)
	})

Enjoy!

FAQs

Package last updated on 19 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc