Package Exports
- tough-cookie-document-store
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tough-cookie-document-store) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tough-cookie-document-store
tough-cookie store use document.cookie adapter
npm install tough-cookie tough-cookie-document-store
usage
import DocumentCookieStore from 'tough-cookie-document-store';
import * as toughCookie from 'tough-cookie';for node.js
u can make a document ny jsdom
import { createJSDOM } from 'jsdom-extra';
let jsdom = createJSDOM();
let document = jsdom.document;demo
let store: DocumentCookieStore;
if (typeof document != 'undefined' && document)
{
// if ur document not a global, this can help
store = new DocumentCookieStore(document);
}
else
{
// will auto use global document
store = new DocumentCookieStore();
}
let jar = new toughCookie.CookieJar(store);
console.log(jar);
// ... anything u wanna doother options
new DocumentCookieStore(document, another new toughCookie.Store for cache)