add charset support for node's superagent
$ npm i superagent-charset --save
const request = require('superagent') require('superagent-charset')(request)
this will add request.Request.prototype.charset
.charset(encoding)
, will passed to iconv-lite
const should = require('should') const request = require('superagent') require('superagent-charset')(request) // install charset describe('Basic Test', function() { it('it works', function(done) { request.get('http://www.sohu.com/') .charset('gbk') .end((err, res) => { res.text.should.match(/搜狐/) done(err) }) }) })
the MIT License, http://magicdawn.mit-license.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4