1.0.1 • Published 2 years ago

web-shared-preferences-fs-pollyfill v1.0.1

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

SharedPreferences FS Pollyfill

Pollyfill to use SharedPreferences outside of browsers.

I know, it should be an "polyfill", ignore my type mistake

npm npm NPM

Install

bun add web-shared-preferences-fs-pollyfill

Setup

There is currently no support for React as useString or something!

const pref = new SharedPreferences(new SharedPreferencesFsPollyfill("./local.json"));

pref.setString("name", "Kevin");
pref.setString("last", "Olaf");
pref.setJSON("json", {
  name: "Hellow",
});

console.log(`${pref.getString("name", null)} (${pref.getString("last", "")})`);