There is no native expiration option but it can be implemented using timestamps.
Pass a function through localStorage using the Function constructor object.
By pushing data into loca, it is possible to calculate total and available space.
To check for an item, get the value of the item by querying localStorage by its key.
You can use the FileReader API to create a data URL and pass this through localStorage.