Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

superagent-charset

magicdawn5.1kMIT1.2.0

add charset support for node's superagent

superagent, encoding, charset, gbk, gb2312, iconv

readme

superagent-charset

add charset support for node's superagent

Build Status Coverage Status npm version npm downloads npm license Greenkeeper badge

Install

$ npm i superagent-charset --save

API

install

const request = require('superagent')
require('superagent-charset')(request)

this will add request.Request.prototype.charset

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)
      })
  })
})

License

the MIT License, http://magicdawn.mit-license.org

changelog

Changelog

v1.2.0 2017-04-23

  • update deps / devDeps
  • update eslint config, use no semi
  • test coverage get 100%
  • using codecov insteadof coveralls
  • using async/await for test code, rm co-mocha

v1.1.1 2016-06-25

  • use ignore case regex when detect using <meta>

v1.1.0 2016-06-20

  • add encoding detect, see #1
  • update dev env, eslint blabla...

v1.0.0 2016-03-06

  • expose install(superagent) method, rm perrDependencies, for it's hard to manage it

v0.1.2 Unknown Date

  • use perrDependencies to load superagent