1.0.3 • Published 3 years ago

spider-cookies v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

SPIDER-COOKIES

Coverage Status Language grade: JavaScript

Summary

The CookieJar is so complicated! I configured half a day Leng is not configured successfully! All I want is to update the original cookies based on the Set-Cookie field in the response header! I just want to write a crawler. I don't want to worry about domin, path, expiration time. So I wrote this library.

Usage

import { parseCookies, stringifyCookies } from "spider-cookies";
cookies = "test=value; name=spider-cookies";
let cookiesMap = parseCookies(cookies);
cookiesMap.set("test", "new_value");
const cookiesString = stringifyCookies(cookiesMap);

// jest
expect(cookiesString).toBe("test=new_value; name=spider-cookies");
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago