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.
Readme
Ambry is WebStorage wrapper that makes your life easier. It's target is to improve developer experience and to cover inconsistency in browser implemetations. Using Ambry you can create storages with namespaces, control scheme version and subscribe to particular storage.
Tests are powered by BrowserStack — cool cross browser testing tool.
npm install --save ambry
import { createStorage } from 'ambry';
const storage = createStorage(config);
config
consists of:
type
— should be 'localStorage'
or 'sessionStorage'
(Default value: 'localStorage'
)namespace
- prefix for your storage in storage key field (Default value: null
)schemeVersion
- your scheme version wich is useful in cases your storage structure could change over time (Default value: null
)clearOnError
- if true
clears field when parsing for getItem()
fails or when setItem()
is impossible because of storage quota has exceede (Default value: true
)doNotThrow
- if true
then creates dummy storage instead of throwing error. Dummy storage has all methods that standard storage has (Default value: true
)storage.setItem(field, value);
If quota is exceeded and you have clearOnError
set to true
then storage will be cleared, then scheme version will be set if needed and then setItem()
will be called another time
storage.getItem(field);
If value for that field can't be parsed and clearOnError
is set to true
then that value will be removed from storage
storage.removeItem(field);
storage.clear();
storage.setSchemeVersion(version);
This will clear storage if previous version is not strictly equal to new version
const unsubscribe = storage.subscribe(handler);
This will subscribe to that particular storage changes only. It returns new function which when called will unsubscribe your handler.
The handler
is callback function which has such parameters:
key
- the field name inside of storageoldValue
- previous value for that keynewValue
- new value for that keyIf you have Web Storage in your app you can just createStorage()
to work with it as with Ambry storage. You can even split your storage data to multiple Ambry storages using namespace
Your contributions are always welcome! Please feel free to create issues.
FAQs
WebStorage wrapper that makes your life easier
The npm package ambry receives a total of 17 weekly downloads. As such, ambry popularity was classified as not popular.
We found that ambry 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.