Gathering detailed insights and metrics for @jaysalvat/super-storage
Gathering detailed insights and metrics for @jaysalvat/super-storage
Gathering detailed insights and metrics for @jaysalvat/super-storage
Gathering detailed insights and metrics for @jaysalvat/super-storage
Cookie, localStorage and sessionStorage javascript helpers
npm install @jaysalvat/super-storage
Typescript
Module System
Node Version
NPM Version
73.7
Supply Chain
99.4
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (95.41%)
HTML (4.59%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
32 Commits
1 Forks
2 Watchers
1 Branches
1 Contributors
Updated on Jul 03, 2024
Latest Version
1.1.6
Package Id
@jaysalvat/super-storage@1.1.6
Unpacked Size
35.95 kB
Size
7.00 kB
File Count
19
NPM Version
7.6.3
Node Version
15.12.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Super Storage provides some helpers over cookie, localStorage and sessionStorage.
Install npm package
1npm install @jaysalvat/super-storage
1import { SuperCookie, SuperLocalStorage, SuperSessionStorage } from '@jaysalvat/super-storage' 2 3const settings = { 4 storagePrefix: 'myApp' 5} 6 7const superCookie = new SuperCookie(settings) 8const superLocalStorage = new SuperLocalStorage(settings) 9const superSessionStorage = new SuperSessionStorage(settings)
1<script src="https://unpkg.com/@jaysalvat/super-storage@latest/build/super-storage.umd.min.js"></script> 2<script> 3 const settings = { 4 storagePrefix: 'myApp' 5 } 6 7 const superCookie = new superStorage.SuperCookie(settings) 8 const superLocalStorage = new superStorage.SuperLocalStorage(settings) 9 const superSessionStorage = new superStorage.SuperSessionStorage(settings) 10</script> 11
Default settings.
1{ 2 storagePrefix: '', 3 sessionCookieName: '__superStorageSession', 4 sessionNative: false, 5 sessionPrefix: 'session', 6 cookiePrefix: '', 7 cookieOptions: { 8 domain: null, 9 path: null, 10 maxAge: null, 11 expires: null, 12 secure: null 13 } 14}
Set a value
1superLocalStorage.setItem('key', 'data')
Get a value
1superLocalStorage.getItem('key') 2superLocalStorage.getItem('key', 'default value')
Remove a value
1superLocalStorage.removeItem('key')
Remove all value
1superLocalStorage.clear()
Note: If sessionNative
set to false (default) in the settings, SuperSessionStorage
will use the native localStorage
to store values and a cookie in order to watch the
browser session. This trick allows SuperSessionStorage
to be kept between tabs and
windows (unlike native sessionStorage
)
Set a value
1superSessionStorage.setItem('key', 'data')
Get a value
1superSessionStorage.getItem('key') 2superSessionStorage.getItem('key', 'default value')
Remove a value
1superSessionStorage.removeItem('key')
Remove all value
1superSessionStorage.clear()
Set a value.
Options can be passed (merged with global settings cookieOptions
)
1 const options = { 2 domain: null, 3 path: null, 4 maxAge: null, 5 expires: null, 6 secure: null 7 }
See Cookie specs.
1superCookie.setItem('key', 'data', [options]))
Get a value
1superCookie.getItem('key') 2superCookie.getItem('key', 'default value')
Remove a value. Options path
and domain
can be passed.
1 const options = { 2 domain: 'mydomain.com', 3 path: '/', 4 }
1superCookie.removeItem('key', [options])
Dev mode
1npm run dev
Build
1npm run build
Lint
1npm run lint
Fix lint errors
1npm run lint:fix
Bump version and publish to NPM
1npm run release 2npm run release:patch 3npm run release:minor 4npm run release:major
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
38 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More