Probably test in a browser that supports ES6 without using any library and document accordingly.
@FagnerMartinsBrack
I tried the contents of https://github.com/js-cookie/js-cookie/issues/426 , but it seems that it will not be solved by import * as Cookies from './js-cookie-master/src/js.cookie.js';.
The Cookies variable is Module object.

If object's name is not Cookies, I can refer towindow.Cookies and it will work.
I think that this project needs another file that is ESModule target. I'll create p-r.
It seems documenting ES6 is more trouble than it's worth.
I reverted the commit.
Let's use this issue to test on browsers without extra dependencies and document accordingly, without assuming that the developer is using another third-party tool.
Revert commit: https://github.com/js-cookie/js-cookie/commit/d8b016be0f3c068ee4be8a121313de90502da2e0
TypeError: p.a.setCookie is not a function(…)

Clearly not the case. js.cookie.js is a self invoking closure which adds the module "Cookie" to the global namespace.
FagnerMartinsBrack commented on Apr 25 •
It seems documenting ES6 is more trouble than it's worth.
Fine but dont mislead your users by claiming this is an AMD module / commonjs module.
@DoubleCouponDay This thread is about ES6 module, in which the commit was reverted from the README, not AMD or CommonJS.
We support Asynchronous Module Loaders (like require.js) and CommonJS specification, see the tests for Node.js here and require.js here.
The sentence says "JavaScript Cookie can also be loaded as an AMD or CommonJS module". What's misleading there exactly?
My mistake. I attempted to load js-cookie as a module in the past but had confusing issues trying to use es6 module loading without a dependency loader. Now that I'm set up with stealjs without issues, I can do stuff like this it seems:

all the best,
dcd
??? testing ...
// ES6
import * as Cookies from "js.cookie.js";
// ES5
var Cookies = require("js.cookie.js");
a more simple cookie getter method!
https://www.w3schools.com/js/js_cookies.asp
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
Closed via #537
Most helpful comment
@FagnerMartinsBrack
I tried the contents of https://github.com/js-cookie/js-cookie/issues/426 , but it seems that it will not be solved by
import * as Cookies from './js-cookie-master/src/js.cookie.js';.The Cookies variable is Module object.
If object's name is not
Cookies, I can refer towindow.Cookiesand it will work.I think that this project needs another file that is ESModule target. I'll create p-r.