@abarchibody/cookie

Cookie is plugin that help to store data in the browser cookie, or retrieve data

Usage no npm install needed!

<script type="module">
  import abarchibodyCookie from 'https://cdn.skypack.dev/@abarchibody/cookie';
</script>

README

cookie is used to read, write to the localstorage.

to install

$ npm i @abarchibody/cookie

Usage

const data = [1, 2, 3, 4]

import cookie from '@abarchibody/cookie'

Write to localstorage

cookie.set('data', data);

Read to localstorage

const myData = cookie.get('data')
console.log(myData)

// [1, 2, 3, 4]

Delete data to localstorage

cookie.remove('data');