Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@jaysalvat/super-storage
Advanced tools
Readme
Super Storage provides some helpers over cookie, localStorage and sessionStorage.
Install npm package
npm install @jaysalvat/super-storage
import { SuperCookie, SuperLocalStorage, SuperSessionStorage } from '@jaysalvat/super-storage'
const settings = {
storagePrefix: 'myApp'
}
const superCookie = new SuperCookie(settings)
const superLocalStorage = new SuperLocalStorage(settings)
const superSessionStorage = new SuperSessionStorage(settings)
<script src="https://unpkg.com/@jaysalvat/super-storage@latest/build/super-storage.umd.min.js"></script>
<script>
const settings = {
storagePrefix: 'myApp'
}
const superCookie = new superStorage.SuperCookie(settings)
const superLocalStorage = new superStorage.SuperLocalStorage(settings)
const superSessionStorage = new superStorage.SuperSessionStorage(settings)
</script>
Default settings.
{
storagePrefix: '',
sessionCookieName: '__superStorageSession',
sessionNative: false,
sessionPrefix: 'session',
cookiePrefix: '',
cookieOptions: {
domain: null,
path: null,
maxAge: null,
expires: null,
secure: null
}
}
Set a value
superLocalStorage.setItem('key', 'data')
Get a value
superLocalStorage.getItem('key')
superLocalStorage.getItem('key', 'default value')
Remove a value
superLocalStorage.removeItem('key')
Remove all value
superLocalStorage.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
superSessionStorage.setItem('key', 'data')
Get a value
superSessionStorage.getItem('key')
superSessionStorage.getItem('key', 'default value')
Remove a value
superSessionStorage.removeItem('key')
Remove all value
superSessionStorage.clear()
Set a value.
Options can be passed (merged with global settings cookieOptions
)
const options = {
domain: null,
path: null,
maxAge: null,
expires: null,
secure: null
}
See Cookie specs.
superCookie.setItem('key', 'data', [options]))
Get a value
superCookie.getItem('key')
superCookie.getItem('key', 'default value')
Remove a value. Options path
and domain
can be passed.
const options = {
domain: 'mydomain.com',
path: '/',
}
superCookie.removeItem('key', [options])
Dev mode
npm run dev
Build
npm run build
Lint
npm run lint
Fix lint errors
npm run lint:fix
Bump version and publish to NPM
npm run release
npm run release:patch
npm run release:minor
npm run release:major
FAQs
Cookie, localStorage and sessionStorage javascript helpers
The npm package @jaysalvat/super-storage receives a total of 178 weekly downloads. As such, @jaysalvat/super-storage popularity was classified as not popular.
We found that @jaysalvat/super-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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.