#parser #cookies #netscape #cookie-jar

nescookie

a netscape cookie file parser

3 releases (breaking)

0.3.0 Nov 28, 2021
0.2.0 Jul 22, 2021
0.1.0 Jul 21, 2021

#3 in #cookie

44 downloads per month
Used in 2 crates (via finata)

MIT license

9KB
139 lines

nescookie

A netscape cookie file parser.

docs.rs | crates.io

Usage

// open a file directly
let jar = nescookie::open("/path/to/cookie/file").unwrap();

// parse a string
let content = ".pixiv.net	TRUE	/	TRUE	1784339332	p_ab_id	7\n";
let jar = nescookie::parse(content).unwrap();

// parse to an exist `CookieJar`
let builder = nescookie::CookieJarBuilder::with_jar(existed_jar);
// res is a `CookieJar`
let res = builder.open("/path/to/cookie/file").unwrap().finish(); // or builder.parse(content)...

Dependencies

~2.2–3MB
~64K SLoC