npm.io
1.0.7 • Published 6 years ago

binarysjs

Licence
MIT
Version
1.0.7
Deps
2
Size
11 kB
Vulns
0
Weekly
0
Stars
1

Binarysjs

A simple npm library to make binary search with javascript

Github Top Language Github language count Size GitHub

How to use

  $ npm install binarysjs
  # $ yarn add binarysjs
  const { getIndex } = require('binarysjs');

  const index = getIndex(target, array, startIndex?, endIndex?)
  // target = The value you want to find
  // array = The array you want to search in
  // startIndex && endIndex = optional parameters you don't want to check the whole array

Return values

  • Any number bigger than or equal to zero: Found value index
  • -1: Value not found

Techs

  • Node.js
  • Typescript
  • Jest

License

This project is under the MIT license. See the LICENSE for more information.

Made with by Giovani Farias Get in touch!