Giter Club home page Giter Club logo

Comments (7)

typicode avatar typicode commented on May 17, 2024

Picking out the ones irrelevant, why not, it'll improve performances. However, when Node 0.12 will be out (no date though), it should be possible to listen to object changes with Object.observe so I don't know if it's very useful to implement right now.

Regarding the autosave, you can already but it's not very beautiful:

var db = low() // no filename, so there's no autosave
fs.writeFileSync(filename, JSON.stringify(db.object))

I think about making something like what you suggested:

var db = low(filename, { autosave: false })
db.save()
// or
var db = low()
db.save(filename)

from lowdb.

fritx avatar fritx commented on May 17, 2024

Oh you're right.. :)
If you're not free, I'm glad to PR

from lowdb.

typicode avatar typicode commented on May 17, 2024

It's okay, thanks for the offer and the feedback :)
I think I'll release today.

from lowdb.

typicode avatar typicode commented on May 17, 2024

Just published v0.6.0 :)
It includes autosave option and I've added db.saveSync() for more flexibility.

var db = low(filename, { autosave: false })
db.saveSync()
var db = low()
db.saveSync(filename)

Both examples will do the same.

from lowdb.

fritx avatar fritx commented on May 17, 2024

👍 I see the change, async defaults to true too, thanks

from lowdb.

typicode avatar typicode commented on May 17, 2024

Hi,

Just as an update, I've released 0.7.0 and now it only writes to disk when db has changed (not composing every functions anymore :)).

Also, it has been updated to lodash 3.0.0.

from lowdb.

fritx avatar fritx commented on May 17, 2024

Awesome!

from lowdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.