For anyone using Node, I found a nice and simple solution with ES6 imports and the cookie
module!
First install the cookie module (and save as a dependency):
npm install --save cookie
Then import and use:
import cookie from 'cookie';
let parsed = cookie.parse(document.cookie);
if('cookie1' in parsed)
console.log(parsed.cookie1);