[Snyk] Upgrade lowdb from 0.14.0 to 7.0.1 #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was automatically created by Snyk using the credentials of a real user.
![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)
Snyk has created this PR to upgrade lowdb from 0.14.0 to 7.0.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 33 versions ahead of your current version.
The recommended version was released on 6 months ago.
Release notes
Package name: lowdb
7.0.1
🚀 Simplified syntax with
db.update
, new adapter for more file format, consistent presets, automatic write error retry, and a TS error fix!What's New
db.update
for easier updates and writes.DataFile
adapters for supporting various formats likeYAML
,JSON5
, ... and adding features like encryption with minimal code.Breaking Changes
JSONPreset
toJSONFilePreset
JSONSyncPreset
toJSONFileSyncPreset
.Code Examples
If you were using the
JSONPreset
, please rename itEnjoy the simplified syntax with
db.update
Easily support other formats:
Sponsors
Special thanks to lowdb's current sponsor: Mockend.
Your support is essential, you can sponsor this project on GitHub Sponsors ❤️
JSONPreset
andJSONSyncPreset
New presets
Before
import { JSONFile } from 'lowdb/node'
const adapter = new JSONFile(file)
const defaultData = { posts: [] }
const db = new Low(adapter, defaultData)
await db.read()
Now
const defaultData = { posts: [] }
const db = await JSONPreset('db.json', defaultData)
This will also use the
Memory
adapter automatically whenNODE_ENV=test
making tests faster.TypeScript
Lowdb now supports the broader
fs.PathLike
type which lets you useURL
type in addition tostring
. This is useful for ESM.What's Changed
New Contributors
Full Changelog: v6.0.0...v6.0.1
What's Changed
defaultData
parameter forLow
andLowSync
constructors to improve TypeScript experienceHow to upgrade:
const defaultData = { posts: [] }
const db = new Low(adapter)
db.data ||= defaultData
function add() {
db.data.posts.push('title') // TS error
}
const defaultData = { posts: [] }
const db = new Low(adapter, defaultData)
function add() {
db.data.posts.push('title') // No TS error
}
If you like lowdb, please sponsor my work. If you cannot, a star or tweet is always appreciated.
Thank you!
What's Changed
New Contributors
Full Changelog: v5.0.4...v5.1.0
5.0.4
5.0.3
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:![](https://camo.githubusercontent.com/168defa4ac73099f0666e194c624534735744441e5f270a10ca551a95a3d8c14/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f6949794d6d5578595441304f4330344d4755784c5451775a4749744f4459335979316d4e7a45304f546332597a52684d5441694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496a49795a5446684d4451344c5467775a5445744e44426b596930344e6a646a4c5759334d5451354e7a5a6a4e4745784d434a3966513d3d)