
Product
Introducing Data Exports
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.
js-localstorage-change-detector
Advanced tools
A library to detect any or particular key changes in local storage
A javascript library which watches all keys or particular keys in the local storage . If it detects any change in the keys , It will execute the callback in the local tab specified by us
1.Using CDN. include the following cdn in the script tag in the HTML.
<html>
<head>
<script src="https://raw.githack.com/ashwinKumar0505/js-localstorage-change-detector/master/index.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
2.Using npm to install the package
npm install --save js-localstorage-change-detector
import lsChangeDetector from 'js-localstorage-change-detector';
const App = () => {
lsChangeDetector.addChangeListener('onChange', null, () => {
console.log('hai');
});
return <div></div>;
};
1.To make the lsChangeDetector to watch all the keys and execute a call back if any of the keys changed.
import lsChangeDetector from 'js-localstorage-change-detector';
const App = () => {
lsChangeDetector.addChangeListener('onChange', null, () => {
console.log('hai');
});
return <div></div>;
};
2.To make the lsChangeDetector to watch a single key and execute a call back if that key is alone changed.
import lsChangeDetector from 'js-localstorage-change-detector';
const App = () => {
lsChangeDetector.addChangeListener('onChange', 'userName', () => {
console.log('hai');
});
return <div></div>;
};
3.To make the lsChangeDetector to watch particular number of keys and execute a callback if any of those keys changes.
import lsChangeDetector from 'js-localstorage-change-detector';
const App = () => {
lsChangeDetector.addChangeListener('onChange', ['userName', 'email'], () => {
console.log('hai');
});
return <div></div>;
};
FAQs
A library to detect any or particular key changes in local storage
The npm package js-localstorage-change-detector receives a total of 98 weekly downloads. As such, js-localstorage-change-detector popularity was classified as not popular.
We found that js-localstorage-change-detector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.

Research
/Security News
Docker and Socket have uncovered malicious Checkmarx KICS images and suspicious code extension releases in a broader supply chain compromise.