A common requirement.
Know-How to discuss: http://www.zhihu.com/question/32156977
Node-canvas installed on Mac There's a problem, maybe I don't have sudo
Used Ccap: Very good.
Simple example: http://snoopyxdy.blog.163.com/blog/static/60117440201301842110923/
Github:https://github.com/automattic/node-canvas
Installation: node Install CCAP
var express = require (' Express '); var router = Express. Router (), var ccap = require (' Ccap '), var util = require (' util ');/* GET home page. */router.get ('/', function (req, res, next) { //Res.render (' index ', {title: ' Express '}); Res.render (' index.html ');}); Router.get ('/test ', function (req, res, next) {var ary = Ccap.get (); var txt = ary[0]; var buf = ary[1]; Res.end (BUF); Console.log (Util.inspect ({buf:buf})); Console.log (TXT); Res.render (' index ', {title: ' Express '}); Res.render (' index.html ');}); Module.exports = router;
Nodes Verification Code