CouchDB 和 Node.js - 你推荐什么模块?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5532209/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 13:59:10  来源:igfitidea点击:

CouchDB and Node.js - What module do you recommend?

node.jscouchdb

提问by cllpse

What modules are you using to connect to your CouchDB server, in your Node.js applications? And why would you recommend whatever module you are using?

在 Node.js 应用程序中,您使用哪些模块连接到 CouchDB 服务器?为什么你会推荐你正在使用的任何模块?

采纳答案by yojimbo87

Try to look at nanowhich offers simple and minimalistic API for CouchDB or high-level client cradle.

尝试查看nano,它为 CouchDB 或高级客户端摇篮提供简单和简约的 API 。

回答by JasonSmith

When getting started, do notuse CouchDB libraries in NodeJS!

开始时,不要在 NodeJS 中使用 CouchDB 库!

There several, however they are largely thin layers wrapping the HTTP API. But Node has very strong HTTP support. It's no more trouble to make simple HTTP queries. It's simpler. It's less prone to errors. When CouchDB adds a feature, you won't need to wait for library support. You will learn and understand CouchDB better. It's well worth avoiding a library at first.

有几个,但是它们主要是包装 HTTP API 的薄层。但是 Node 有非常强大的 HTTP 支持。进行简单的 HTTP 查询不再麻烦。它更简单。它不太容易出错。当 CouchDB 添加功能时,您无需等待库支持。您将更好地学习和理解 CouchDB。一开始最好避开图书馆。

I use the built-in querystringmodule, and also Mikeal Rogers's requestlibrary, which is a super thin HTTP convenience library.

我使用内置querystring模块,还有 Mikeal Rogers 的请求库,这是一个超瘦的 HTTP 便利库。

回答by dscape

I am the author of nano. When starting with CouchDB I did exactly as Jason Smith advised using Mikeals request library. Nano was born out of using that code in production and realizing I had some coded that could be improved and abstracted.

我是nano的作者。在开始使用 CouchDB 时,我完全按照 Jason Smith 的建议使用 Mikeals 请求库。Nano 诞生于在生产中使用该代码并意识到我有一些可以改进和抽象的代码。

The end result is minimalistic and you still have a way to go down to the request level and do a request (which many users do).

最终结果是极简的,您仍然有办法进入请求级别并执行请求(许多用户都这样做)。

Nano was really well accepted by the CouchBase team, mostly cause it's soo\ simple and maps well to the API.

Nano 非常被 CouchBase 团队接受,主要是因为它非常简单并且很好地映射到 API。

If you are interested in checking out more check out this blog post: http://writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html

如果您有兴趣查看更多信息,请查看此博客文章:http: //writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html

回答by Dominic Barnes

I've written a very clean and simple HTTP API wrapper, called node-couchdb-api. It doesn't add any bloat features like an ORM, and it follows typical Node.js conventions for callbacks and async code.

我编写了一个非常干净和简单的 HTTP API 包装器,称为node-couchdb-api. 它没有像 ORM 那样添加任何膨胀功能,并且它遵循典型的 Node.js 回调和异步代码约定。