https://github.com/en-atul/storage-inspector-js
Clear browser site-data i.e. Cookies, Session Storage, Local Storage, IndexDB, Cache Storage & get info about storage usage & quota.
https://github.com/en-atul/storage-inspector-js
angular javascript reactjs svelte typescript vuejs
Last synced: 6 months ago
JSON representation
Clear browser site-data i.e. Cookies, Session Storage, Local Storage, IndexDB, Cache Storage & get info about storage usage & quota.
- Host: GitHub
- URL: https://github.com/en-atul/storage-inspector-js
- Owner: en-atul
- Created: 2023-04-07T08:36:01.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-07T14:28:22.000Z (about 3 years ago)
- Last Synced: 2025-09-17T03:55:12.971Z (7 months ago)
- Topics: angular, javascript, reactjs, svelte, typescript, vuejs
- Language: TypeScript
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Browser Storage Inspector
storage-inspector-js library helps to clear site data & provides storage usage & quota.

[](https://packagephobia.now.sh/result?p=storage-inspector-js)
[](https://bundlephobia.com/package/axios@latest)
[](https://npm-stat.com/charts.html?package=storage-inspector-js) [](https://badge.fury.io/js/storage-inspector-js)
# Browser Support
      
# Installation
```js
# If you use npm:
npm i storage-inspector-js
# If you use yarn:
yarn add storage-inspector-js
ES6 Usage
import { BROWSER, getStorageUsageAndQuota, clearSiteData } from 'storage-inspector-js';
Commonjs Usage
var { BROWSER, getStorageUsageAndQuota, clearSiteData } = require('storage-inspector-js');
```
# Usage
```js
import React, {useEffect} from 'react';
import { BROWSER, getStorageUsageAndQuota, clearSiteData, STORAGE_INFO } from 'storage-inspector-js';
const App = () => {
const [storageInfo, setStorageInfo] = useState()
useEffect(()=>{
(async()=>{
const res= await getStorageUsageAndQuota();
setStorageInfo(res)
})()
},[])
const clearStorage = async () => {
await clearSiteData({ reload: true})
// to delete specific IndexDB
await clearSiteData({ indexDBName: "DBName", reload: true})
}
return (
BROWSER: {BROWSER}
Storage Info: {storageInfo.baked.usage/storageInfo.baked.quota}
Clear Site Data
);
};
export default App;
```
# Props
| name | type | params | default | description |
| ----------------------- | ---------- | ----------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BROWSER | `string` | | | it will provide the browser name i.e. `Brave`, `Chrome`, `Firefox`, `Safari`, `Internet Explorer` `Edge`, `Samsung Browser`, `UC Browser`, `Opera`, `Unknown`. |
| getStorageUsageAndQuota | `function` | | | get storage usage & quota `{ raw: { usage: 180670, quota: 24090080 }, baked: { usage: "230KiB", quota: "980MiB" } }` |
| clearSiteData | `function` | `indexDBName` required for firefox, `reload` required | | clears site data which includes all browser storage. Set `reload` params to `true`, to reload the site once storage is clear. |