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.
localstorage-logger
Advanced tools
Readme
Logging library for writing to and exporting from local storage.
This JavaScript library provides a mechanism to log to local storage and export the most recent entries. It will overwrite the oldest entries when writing a new entry if adding the entry makes the log bigger than maxLogSizeInBytes
.
At the time of writing, all the libraries we could find that provide logging or queuing in local storage used a single storage key. This means that they had to serialize the whole log/queue on any modification. This resulted in worse performance as the log got bigger.
Instead of a single key, we use many keys. Therefore, the cost of serialization on each modification is much lower than in the other libraries we found. However, this means we lose atomicity when making modifications to the underlying data structure. JavaScript is single-threaded so this doesn't pose much of a problem but theoretically a browser crash at exactly the right moment could corrupt the underlying data structure built on top of local storage.
This is how you can use the logging functionality:
import createLog from 'localstorage-logger';
const log = createLog({
logName: 'my-app-log-name',
maxLogSizeInBytes: 500 * 1024 // 500KB
});
// Log something
// debug | info | warn | error
log.info('something', {
foo: 'bar'
}, 42);
// Export the log entries
const logEntries = log.exportToArray();
FAQs
A rolling logger that logs to local storage
The npm package localstorage-logger receives a total of 91 weekly downloads. As such, localstorage-logger popularity was classified as not popular.
We found that localstorage-logger 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.