Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running in Node.js #19

Closed
kettanaito opened this issue Jul 5, 2022 · 1 comment · Fixed by #24
Closed

Support running in Node.js #19

kettanaito opened this issue Jul 5, 2022 · 1 comment · Fixed by #24
Labels
good first issue Good for newcomers

Comments

@kettanaito
Copy link
Member

This library accesses document directly, implying that it needs either a browser or browser-like environment to run:

const documentCookies = parseCookie(document.cookie)

Since it's used in MSW, which runs in ambiguous environments, I propose to support running Cookies in Node.js. We already do some checks for localStorage (here) but otherwise still remain incompatible with Node.js runtime.

It's okay if it returns nothing whenever we rely on the document.

@kettanaito
Copy link
Member Author

Released: v0.2.2 🎉

This has been released in v0.2.2!

Make sure to always update to the latest version (npm i @mswjs/cookies@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant