Socket
Socket
Sign inDemoInstall

lowdb

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lowdb - npm Package Compare versions

Comparing version 0.10.0 to 0.10.1

2

package.json
{
"name": "lowdb",
"version": "0.10.0",
"version": "0.10.1",
"description": "Flat JSON file database",

@@ -5,0 +5,0 @@ "keywords": [

@@ -89,7 +89,6 @@ # lowdb [![NPM version](https://badge.fury.io/js/lowdb.svg)](http://badge.fury.io/js/lowdb) [![Build Status](https://travis-ci.org/typicode/lowdb.svg?branch=master)](https://travis-ci.org/typicode/lowdb)

Database object. Useful for batch operations or to directly access the content of your JSON file.
Use whenever you want to access or modify the underlying database object.
```javascript
console.log(db.object) // { songs: [ { title: 'low!' } ] }
db('songs').value() === db.object.songs
if (db.object.songs) console.log('songs array exists')
```

@@ -96,0 +95,0 @@

@@ -5,3 +5,4 @@ var fs = require('graceful-fs')

module.exports = {
read: function (file) {
// No async read
readSync: function (file) {
if (fs.existsSync(file)) {

@@ -8,0 +9,0 @@ return fs.readFileSync(file, 'utf-8')

@@ -90,4 +90,6 @@ var lodash = require('lodash')

if (file) {
var data = disk.read(file)
if (data && data.trim() !== '') {
// Parse file if there's some data
// Otherwise init file
var data = (disk.readSync(file) || '').trim()
if (data) {
try {

@@ -94,0 +96,0 @@ db.object = low.parse(data)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc