Closed renovate[bot] closed 3 years ago
As this PR has been closed unmerged, Renovate will ignore this upgrade and you will not receive PRs for any future 2.x releases. However, if you upgrade to 2.x manually then Renovate will then reenable updates for minor and patch updates automatically.
If this PR was closed by mistake or you changed your mind, you can simply rename this PR and you will soon get a fresh replacement PR opened.
This PR contains the following updates:
^1.0.0
->^2.0.0
Release Notes
typicode/lowdb
### [`v2.0.3`](https://togithub.com/typicode/lowdb/compare/v2.0.2...v2.0.3) [Compare Source](https://togithub.com/typicode/lowdb/compare/v2.0.2...v2.0.3) ### [`v2.0.2`](https://togithub.com/typicode/lowdb/compare/v2.0.1...v2.0.2) [Compare Source](https://togithub.com/typicode/lowdb/compare/v2.0.1...v2.0.2) ### [`v2.0.1`](https://togithub.com/typicode/lowdb/compare/v2.0.0...v2.0.1) [Compare Source](https://togithub.com/typicode/lowdb/compare/v2.0.0...v2.0.1) ### [`v2.0.0`](https://togithub.com/typicode/lowdb/releases/v2.0.0) [Compare Source](https://togithub.com/typicode/lowdb/compare/v1.0.0...v2.0.0) - **Out of the box and improved TypeScript support.** - Uses new [steno](https://togithub.com/typicode/steno) version for fast async file writes. - Uses ECMAScript modules. - Plain JS can now be used to modify and query `db.data` - Reduced install size. - With native JavaScript improvements, **lodash is now optional** (you can still use it though as it provides powerful utilities). To help with OSS funding, lowdb v2 is released under Parity license for a limited time. It'll be released under MIT license once the goal of 100 [sponsors](https://togithub.com/sponsors/typicode) is reached (currently at 55) or in five months. See [README](https://togithub.com/typicode/lowdb#readme) for complete explanation. You can sponsor me on [GitHub Sponsors](https://togithub.com/sponsors/typicode). Thank you! #### Migrate ##### Lowdb v1 ```js const low = require('lowdb') const FileSync = require('lowdb/adapters/FileSync') const adapter = new FileSync('db.json') const db = low(adapter) // Set some defaults db.defaults({ posts: [], user: {} }) .write() // Add a post db.get('posts') .push({ id: 1, title: 'lowdb is awesome'}) .write() // Set a user name using Lodash shorthand syntax db.set('user.name', 'typicode') .write() ``` ##### Lowdb v2 ```js import { Low, FileSync } from 'lowdb' const adapter = new FileSync('db.json') const db = new Low(adapter) // Set some defaults db.data ||= { posts: [], user: {} }) db.write() // Add a post db.data .posts .push({ id: 1, title: 'lowdb is awesome'}) db.write() // Set a user name using plain JS db.data.user.name = 'typicode' db.write() ``` **If you're using TypeScript, data can now be typed:** ```ts type Post = { id: number title: string } type Data = { posts: Post[] } const db = new Low(adapter) ``` **To continue using lodash with lowdb:** ```sh npm install lodash ``` ```js import lodash from 'lodash' // Set a user name using Lodash shorthand syntax db.chain = lodash.chain(db.data) db.chain .set('user.name', 'typicode') .value() db.write() ``` ### Breaking changes The following methods and properties have been removed: - `db.getState` (use `db.data` instead) - `db.setState` (use `db.data = ...` instead) - `db._`Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.