Package Exports
- superagent-charset
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 (superagent-charset) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
superagent-charset
add charset support for node's superagent
Install
$ npm i superagent-charset
Usage
.charset(encoding)
, will passed to iconv-lite
var assert = require('assert');
var request = require('superagent-charset');
request
.get('http://www.sohu.com/')
.charset('gbk')
.end(function(err,res) {
assert(res.text.indexOf('搜狐') > -1);
});
License
the MIT License, Magicdawn(784876393@qq.com)