JSPM

dh-captcha

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q17921F
    • License ISC

    验证码svg-captcha

    Package Exports

    • dh-captcha
    • dh-captcha/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dh-captcha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    npm i dh-captcha -S

    如何使用
    const captcha = require('dh-captcha')
    let C = captcha.create()
    const http = require('http')
    const captcha = require('dh-captcha')
    
    http.createServer((req,res) => {
        res.setHeader('content-type', 'text/html;charset=utf-8')
        let C = captcha.create()
        // console.log(C); // {text:"". data: svg}
        res.end(C.data)
    }).listen(3000,() => {
        log('启动成功,访问: http://localhost:3000');
    })