jar-got

0.1.0 • Public • Published

jar-got

Wrapper for got to persisting cookies

npm npm

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

Readme

Keywords

Package Sidebar

Install

npm i jar-got

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

2.9 kB

Total Files

4

Last publish

Collaborators

  • skt-t1-byungi