x-captcha
v1.0.4
Published
这是一个验证码
Downloads
5
Readme
安装 npm i x-captcha -S
使用
const captcha = require('x-captcha') let text = captcha.create(0,15,'red') console.log(text) // {text:'D3DS', data: ''}
使用 - 结合 http 模块
const http = require('http') const captcha = require('x-captcha')
http.createServer((req, res) => { res.setHeader('content-type', 'text/html;charset=utf-8') let text = captcha.create(0,15,'red') // console.log(text) // {text:'D3DS', data: ''} res.end(text.data) }).listen(3000, () => { console.log('启动成功, 访问 http://localhost:3000'); })