mistletoejiejie-captcha

1.0.1 • Public • Published

svg-验证码 - 下载

npm i mistletoejiejie-captcha -S

svg验证码 - 使用

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

svg验证码 - 结合HTTP模块

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

const app = http.createServer((req, res) => {
    res.setHeader('content-type', 'text/html;charset=utf-8')
    let temp = captcha.create()
    // console.log(temp) // {text:'D3DS', data: '<svg></svg>'}
    res.end(temp.data)
})
app.listen(3000, () => {
    console.log('启动成功, 访问  http://localhost:3000');
})

/mistletoejiejie-captcha/

    Package Sidebar

    Install

    npm i mistletoejiejie-captcha

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    2.18 kB

    Total Files

    3

    Last publish

    Collaborators

    • mistletoejiejie