grab-js
v1.0.7
Published
http/https, get/post request with iconv-lite
Downloads
9
Readme
Installation
npm install --save grab-js
npm install --save-dev grab-js
Utilisation
request - method GET
const {request} = require('grab-js')
,fs = require('fs')
// Get html
request(url,(err,sres) => {
console.log(sres)
})
request(url,charset,(err,sres) => {
console.log(sres)
})
// Download file
let wts = fs.createWriteStream('test.jpg')
request('http://xxx.jpg',[wts],() => {
console.log('success')
})
// Download html to file
let wts = fs.createWriteStream('test.html')
request(url,['gbk',wts],() => {
console.log('success')
})