jar-got
v0.1.0
Published
wrapper for got to persisting cookies
Downloads
8
Readme
jar-got
Wrapper for got to persisting cookies
Install
yarn add jar-got
Usage
Basic
const jarGot = require('jar-got')
const got = jarGot();
(async _ => {
await got('http://google.co.kr') // First, stores the response set-cookie.
await got('http://google.co.kr') // Second, request with the stored cookies.
})()
Save and restore
// serialize
const saved = got.save();
// deserialize
const restoredGot = jarGot.restore(saved)
Using existing cookie jar.
const got1 = jarGot()
const got2 = jarGot(got1.jar) // got1.jar === got2.jar
License
MIT