Skip to content
Browse files

now using the 'util' module instead of 'sys'

  • Loading branch information...
1 parent 533bd4b commit 5c3f4ec6add94be3691f82f53440a6459684e099 Hendrik Schnepel committed Jan 6, 2012
Showing with 7 additions and 8 deletions.
  1. +4 −4 README.md
  2. +3 −3 test/common.js
  3. +0 −1 test/test-attachment.js
View
8 README.md
@@ -20,22 +20,22 @@ Installation is simple from [NPM](http://npmjs.org/):
To use the library, create a new file called `my-couch-adventure.js`:
var
- sys = require('util'),
+ util = require('util'),
couchdb = require('felix-couchdb'),
client = couchdb.createClient(5984, 'localhost'),
db = client.db('my-db');
db
.saveDoc('my-doc', {awesome: 'couch fun'}, function(er, ok) {
if (er) throw new Error(JSON.stringify(er));
- sys.puts('Saved my first doc to the couch!');
+ util.puts('Saved my first doc to the couch!');
});
db
.getDoc('my-doc', function(er, doc) {
if (er) throw new Error(JSON.stringify(er));
- sys.puts('Fetched my new doc from couch:');
- sys.p(doc);
+ util.puts('Fetched my new doc from couch:');
+ util.p(doc);
});
If you are wondering if there is a race-condition in the above example, the answer is no. Each `couchdb.Client` uses an internal queue for its requests, just like `http.Client`. This guarantees ordering. If you want to perform multiple requests at once, use multiple `couchdb.Client` instances.
View
6 test/common.js
@@ -1,6 +1,6 @@
-var sys = require('sys');
-global.p = sys.p;
-global.puts = sys.puts;
+var util = require('util');
+global.p = util.p;
+global.puts = util.puts;
global.couchdb = require('../lib/couchdb');
global.assert = require('assert');
View
1 test/test-attachment.js
@@ -1,7 +1,6 @@
require('./common');
var
- sys = require("sys"),
DB_NAME = 'node-couchdb-test',
callbacks = {

0 comments on commit 5c3f4ec

Please sign in to comment.
Something went wrong with that request. Please try again.