Recognize

#1
1636619733969.png

Installation
Using NPM utility to install module directly:
npm install recognize

Arguments:
  1. File buffer
  2. Optional parameters
  3. Callback function
Code:
recognize.solving(data, {numeric:1, min_len:5}, function(err, id, code)
{
    if(err) throw err;
    console.log(id, code);
});
OR
recognize.solving(data, function(err, id, code)
{
    if(err) throw err;
    console.log(id, code);
});
### [Recognize Object].balance() ```js recognize.balance(function(err, price) { if(err) throw err; console.log(price); }); ``` ### [Recognize Object].report() ```js recognize.report(id, function(err, answer) { console.log(answer); //OK_REPORT_RECORDED or ERROR_WRONG_CAPTCHA_ID }); ```

Example
Code:
var recognize = new Recognize('antigate', {
    key:'api-key'
});
 
recognize.balanse(function(price)
{
    console.log('My balance:', price);
});
 
fs.readFile('./captcha.png', function(err, data){
    recognize.solving(data, function(err, id, code)
    {
        if(err) throw err;
        if(isValide(code))
        console.log('Captcha:', code);
        else
        {
        console.log('Captcha not valid');
        recognize.report(id, function(err, answer)
        {
        console.log(answer);
        });
        }
    });
});
Documentation https://www.npmjs.com/package/recognize