jessica-captcha

1.0.1 • Public • Published

下载

npm i jessica-captcha-S

导入

const captcha = require('jessica-captcha')
let temp = captcha.create()
console.log(temp)     

结合http模块使用

const http = require('http')
const captcha = require('jessica-captcha')

http.createServer((req, res) => {
    res.setHeader('content-type', 'text/html;charset=utf-8')
    let temp = captcha.create({ 
        fontSize: 48, // 字体大小 
        width: 100, // 宽度 
        height: 40, // 高度 
        background: "#f4f3f2",   //背景颜色
        color: true // 验证码的字符是否有颜色,默认没有,如果设定了背景,则默认有     
        }); 
    res.end(temp.data)
}).listen(3000, () => {
    console.log('启动成功, 访问  http://localhost:3000');
})

Readme

Keywords

Package Sidebar

Install

npm i jessica-captcha

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

1.98 kB

Total Files

3

Last publish

Collaborators

  • jessicayao