Hacker News new | past | comments | ask | show | jobs | submit login

  db.Put('myKey', {some: 'data'}, (value, err) => {})
It annoys me that it reverses the standard (err, value) callback convention that everyone else uses.

An advantage of the standard is that you might have 0, or 2 or more value arguments to the callback. So you can return (err) or (err, value) or (err, value, optionalExtraValue) and it's fairly consistent.




Wow, that's totally my bad (Write a lot of Go at my day job).

Can definitely fix that one. Will bump to 2.0.0 when I get home.


Method names that start with uppercase is also something you'll see more in Go or C# but not so much in JavaScript. `db.put()` would be the JS way.


I agree on this one. The convention in javascript is that functions names start with a lowercase case letter.


Also very true. Going into V2 deploy that I've open sourced. Will publish it this evening.

Thanks for all the feedback y'all!


I agree with your point. Just want to mention if you are using callbacks, might be worth looking at switching to async/await.


It supports both! If you don't provide a callback it'll return a promise.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: