JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q41681F
  • License MIT

Module to integrate captcha for API only apps in nodejs

Package Exports

  • ncaptcha-api

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ncaptcha-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme


Coverage Status npm version

NPM

ncaptcha

Module to integrate captcha for API only apps in nodejs

Dependencies

  1. canvas
  2. crypto

Usage

const NCaptcha = require('ncaptcha');

//remove {text:'123456'} to get random key and text image.
var ncaptcha = new NCaptcha({text:'123456'});

// send this key and image data to client, client will send key and user inputted test from the image
var data = ncaptcha.generate()

//should return true.
ncaptcha.check(data.key,'123456')

data will have key and image encoded in base64.

Expiry Logic

By default key expires in 10 minutes. You can set 'expireInMinute' in params

// for 20 minutes
new NCaptcha({text:'123456',expireInMinute:20});