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

You can use this library for examing something for something

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
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.
  • .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 set
    • found found words
    • unfound unfound words

Simple use

exam("Could you find my name here?")
	.find(["could"])
	.yep( result => {
		// Should use 'yep' only if
		// you expect something to be here
		console.log(result.found)
	})
	.nope( result => {
		// Should use 'nope' only if
		// you expect something not to be here
		console.log(result.unfound)
	})
	.any( result => {
		// Should use 'any' if
		// you don't know what to expect
		console.log(result)
	})

Reuse methods

NB! Will examine by different filters twice and independently

exam("How about that, huh?")
	.find(["abou"]) 
	.any( result => {
		// we can reuse filters we set
		console.log(result.filters)
		// and be ready that these badwords we will find
		console.log(result.found)
		// also we have all results within any of the callback
		console.log(result.unfound)
	})
	.strictFind(["about"])
	.yep( result => {
		// word 'about' is fully out there
		console.log(this.found)
	})

Enjoy!

FAQs

Package last updated on 21 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