0.1.1 • Published 6 years ago

xinzai-node-gyp v0.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

xinzai-node-gyp

介绍

该模块用于生成简单的图片验证码,依赖node-canvas模块,安装前需要安装一些依赖,如下

安装

Unless previously installed you'll need Cairo and Pango. For system-specific installation view the Wiki.

Currently the minimum version of node required is 4.0.0

You can quickly install the dependencies by using the command for your OS:

OSCommand
OS XUsing Homebrew:brew install pkg-config cairo pango libpng jpeg giflibUsing MacPorts:port install pkgconfig cairo pango libpng jpeg giflib
Ubuntusudo apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
Fedorasudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel
Solarispkgin install cairo pango pkg-config xproto renderproto kbproto xextproto
WindowsInstructions on our wiki

Mac OS X v10.11+: If you have recently updated to Mac OS X v10.11+ and are experiencing trouble when compiling, run the following command: xcode-select --install. Read more about the problem on Stack Overflow.

$ npm install xinzai-node-gyp

安装时node-canvas会编译,如果编译报错,推荐使用cnpm安装

例子

const xinzaiNodeGyp = require('./xinzai-node-gyp')
xinzaiNodeGyp({
    type: 'easy',
    data: 'abcdefg',
    successcb(canvas) {
        res.send('<img src="' + canvas.toDataURL() + '" />')
    }
})
0.1.1

6 years ago

0.1.0

6 years ago

0.0.0

6 years ago