4.1.1 • Published 8 years ago

examjs v4.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Exam.js

You can use this library for examing something for something :)

Installation & Usage

npm install --save examjs
let exam = require("examjs")

Compatibility

  • IE9+, Edge, Chrome, Opera, Firefox, Safari
  • Node.js

API

MethodDescriptionParamsCode
examinital methodStringexam("You want to check this string?")
exactfind for exact, letter to letter matchesArray , callbackexam("Some string in there").exact(["some", "in", "no"])
atLeastfind for at least some matchesArray , callbackexam("Some string in there").atLeast(["some", "in", "no"])

Notes

  • exact and atLeast functions returns Promise if you didn't specify the callback as a second argument
  • all results are case insensitive

Simple usage

exam("In our village, folks say God crumbles up the old moon into stars. Перевод недоступен.")
	.atLeast(["our", "moon", "vill", "перев"], result => {
		console.log(result)
		/* -->
			{
				found: [ 'our', 'moon', 'vill', 'перев' ],
				notfound: null,
				filters: [ 'our', 'moon', 'vill', 'перев' ],
				examing: 'in our village, folks say god crumbles up the old moon into stars. перевод недоступен.',
				mode: 'soft',
				only: { yep: true }
			}
		*/
	})
exam("In our village, folks say God crumbles up the old moon into stars. Перевод недоступен.")
	.exact(["our", "перевод", "vill", "перев"])
	.then( result => {
		console.log(result)
		/* -->
			{
				found: [ 'our', 'перевод' ],
				notfound: [ 'vill', 'перев' ],
				filters: [ 'our', 'перевод', 'vill', 'перев' ],
				examing: 'in our village, folks say god crumbles up the old moon into stars. перевод недоступен.',
				mode: 'strict'
			}
		*/
	})
4.1.1

8 years ago

4.1.0

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.1

8 years ago

1.0.0

8 years ago