Get started with jStorage CDN

MIT licensed

JStorage is a lightweight, open-source library used for key-value storage in the browser.

Tags:
  • storage
  • offline
  • webstorage
  • localStorage

Stable version

Copied!

How to start using jStorage CDN


// Include the jStorage library from the CDN
const jStorage = (() => {
  const script = document.createElement('script');
  script.src = 'https://cdn.cdnhub.io/jStorage/0.4.12/jstorage.min.js';
  document.head.appendChild(script);

  return new Promise((resolve) => {
    script.onload = () => {
      document.head.removeChild(script);
      resolve(window.jStorage);
    };
  });
})();

// Usage example:
async function setData() {
  await jStorage.set('name', 'John Doe');
  await jStorage.set('age', 30);

  console.log('Data saved:', await jStorage.getAll());
}

setData().catch((error) => console.error('Error saving data:', error));
Copied!
Copied!

All versions