![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
argon-storage
Advanced tools
Argon storage extends default storage API to resolve cross browser compatibility issues
Argon storage is a cross-browser wrapper for local storage.
npm i argon-storage
With Argon Storage
import ArgonStorage from 'argon-storage';
const store = new ArgonStorage();
store.set('dataKey', 'dataValue');
const value = store.get('dataKey'); // --> 'dataValue'
Without Argon Storage
let value = '';
try {
localStorage && localStorage.setItem('dataKey', 'dataValue');
if (localStorage) {
value = localStorage.getItem('dataKey'); // --> 'dataValue'
}
} catch(e) {
// Assuming you have 'setCookie' and 'getCookie' implementation available
setCookie('dataKey', 'dataValue');
value = getCookie('dataKey');
}
Without Argon Storage
localStorage.setItem('item', { m: 'helloworld', n: 100 });
localStorage.getItem('item'); // --> [object Object] // Local storage stores everything as strings
With Argon Storage
...
store.set('item', { m: 'helloworld', n: 100 });
store.get('item'); // --> { m: 'helloworld', n: 100 }
Saves an extra step of transforming data before saving it.
...
store.set('item', 'value', true); // Third parameter enables session storage mode
Without Argon Storage
localStorage.set('item', true); // Stored value is boolean
localStorage.get('item'); // --> 'true' // Retrieved value is a string
With Argon Storage
...
store.set('item', true);
store.get('item'); // --> true // Returns the value as boolean
We use Pieroxy's LZW algorithm (custom implementation) to compress input data. Useful to save some bytes when dealing with large dataset.
const store = new ArgonStorage({ compress: true });
...
import { setCookie, getCookie } from 'argon-storage';
setCookie('item', 'value');
getCookie('item'); // --> 'value'
By default setCookie
creates a session cookie (cookie without an expiry). You can set expiryDays
by passing a third parameter.
setCookie('item', 'value', 3); // Cookie expires after 3 days
You can also set cookie path
and domain
by passing fourth and fifth parameters.
setCookie('item', 'value', null /* Setting up a session cookie */ , '/', 'example.com');
However, if you don't pass them, the path value defaults to /
and domain value defaults to current site domain. If for any reason you do not want to set domain (which isn't recommended), you can pass an empty string value.
You can also mark cookies as secure by passing a sixth boolean parameter.
setCookie('item', 'value', null /* Setting up a session cookie */ , '/', 'example.com', true); // Creates a secure cookie
For secure websites, you don't need to do this step. Argon storage by default creates secure cookies by checking if the site uses an https://
URL.
Argon Storage is a great utility for local storage. It is tested on majority of desktop and mobile browsers which makes it perfect for production use. It's built-in type resolution reduces a ton of code (and pain to write them). You can see it for yourself in one of the examples above.
Argon Storage supports IE9 browser and above.
import { getAllCookies } from 'argon-storage';
getAllCookies(); // --> Returns all stored cookies as list[]
getAllCookies(/test_cookie/); // --> Returns all stored cookies that matches the regex.
import { removeCookie } from 'argon-storage';
removeCookie('test'); // Deletes a cookie
import ArgonStorage from 'argon-storage';
(new ArgonStorage())
.remove('item'); // Removes an item from local/session storage.
...
(new ArgonStorage())
.remove('item', true); // Removes item from session storage only.
FAQs
Argon storage extends default storage API to resolve cross browser compatibility issues
The npm package argon-storage receives a total of 13 weekly downloads. As such, argon-storage popularity was classified as not popular.
We found that argon-storage 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.