![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
koekiemonster
Advanced tools
A node.js compatible version of cookie-monster
, which is a clone of
cookie-cutter
. We must fork deeper yessss?
The package is released in the public npm registry as koekiemonster
which is
the dutch name for cookie monster
and can be installed by running:
npm install --save koekiemonster
The module returns a single function that requires a reference to document. If you are in a Node.js environment you can pass in a object instead and it should still function as intended.
var cookie = require('koekiemonster')(document, { /* advanced options */ });
var times = parseInt(cookie.getItem('times'), 10) || 0;
cookie.setItem('times', times + 1);
The first argument is a reference to the document
so it can access document.cookie
the second argument is an object for advanced options. This allows you to specify
a custom read
and write
method for cookies.
read
Called when it needs to read all cookies and expects an array to be
returned with key=cookie
strings for each cookie.write
Called when a cookie needs to be stored, with cookie
, and meta
as arguments. Assumes it returns the cookie string once it's stored. The meta
is an object that contains the following properties:
remove
Boolean indicating if this is a removal request.value
Cookie value.key
Key of the cookie.opts
Original supplied options.It's worth noting that if you do not supply document
as first argument we
will attempt to feature detect the existance of document
and document.cookie
automatically and default to that. In the case where it's missing, we will
default to an empty object so the following will work fine in a browser based
environment:
var cookie = require('koekiemonster')();
console.log(cookie.getItem('items')); // should output the same as above.
Return the contents of a cookie for the given key name.
Set a new cookie with the given key as name and value as contents. You can use
the opts
object to configure the cookie string.
expires
Sets the expiree of the cookie.path
Path of the cookie.domain
Domain of the cookie.secure
Should the cookie be secure only.Remove a cookie with the name of the key. You can use the same opts
as the
setItem
method.
Remove all cookies.
MIT/X11
FAQs
Browser and Nodejs compatible cookie interface
The npm package koekiemonster receives a total of 2,512 weekly downloads. As such, koekiemonster popularity was classified as popular.
We found that koekiemonster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.