1.0.1 • Published 3 years ago

codersole-captcha v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

😀 验证码小物件 - 下载

npm i codersole-captcha -S

😋 验证码小物件 - 使用

const captcha = require('codersole-captcha')
let temp = captcha.create()
console.log(temp) // {text:'D3DS', data: '<svg></svg>'}

😋 验证码小物件 - 结合HTTP模块

// 导入
const http = require('http')
const mycaptcha = require('./captcha')

// 使用
http.createServer((req, res) => {
    let captcha = mycaptcha.create('red')

    res.setHeader('content-type', 'text/html;charset=utf-8')
    res.end(captcha.data)

}).listen(3000, () => {
    console.log('启动成功,访问测试http://localhost:3000');
})
1.0.1

3 years ago

1.0.0

3 years ago