1.0.1 • Published 3 years ago
svg-captcha-cp v1.0.1
🌈 svg-captcha-cp
Installation
npm i svg-captcha-cp -S
npm i svg-captcha-cp -g
✨ Usage
const captcha = require('svg-captcha-cp')
let temp = captcha.create()
console.log(temp) // {text:'SIF5', data: '<svg></svg>'}
✨ Combining HTTP module
const http = require('http')
const captcha = require('svg-captcha-cp')
http.createServer((req, res) => {
res.setHeader('content-type', 'text/html;charset=utf-8')
let temp = captcha.create()
res.end(temp.data)
}).listen(3000, () => {
console.log('启动成功,请访问:http://localhost:3000');
})