English | 简体中文
locally-cookie is a 1KB lightweight library based on localStorage that stores session data and fixed time-length data locally
Getting Started
- Storage is only valid in subdomains
- across domains it is not recommended to store large amounts of data, such as the cache of the entire page
- support IE8 or more
Installation
npm i -S locally-cookie
API
;
set
/** * Parameter * key * value * day | 1,2... Expired after 1, 2 days | -1 Theory is permanent and effective, optional, default 0*/locallyCookie;
get
/** * Parameter * key */locallyCookie;
delete
/** * Parameter * key */locallyCookie;
has
/** * Parameter * key */locallyCookie;