Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 5c3f4ec6add94be3691f82f53440a6459684e099 1 parent 533bd4b
Hendrik Schnepel authored

Showing 3 changed files with 7 additions and 8 deletions. Show diff stats Hide diff stats

  1. +4 4 README.md
  2. +3 3 test/common.js
  3. +0 1  test/test-attachment.js
8 README.md
Source Rendered
@@ -20,7 +20,7 @@ Installation is simple from [NPM](http://npmjs.org/):
20 20 To use the library, create a new file called `my-couch-adventure.js`:
21 21
22 22 var
23   - sys = require('util'),
  23 + util = require('util'),
24 24 couchdb = require('felix-couchdb'),
25 25 client = couchdb.createClient(5984, 'localhost'),
26 26 db = client.db('my-db');
@@ -28,14 +28,14 @@ To use the library, create a new file called `my-couch-adventure.js`:
28 28 db
29 29 .saveDoc('my-doc', {awesome: 'couch fun'}, function(er, ok) {
30 30 if (er) throw new Error(JSON.stringify(er));
31   - sys.puts('Saved my first doc to the couch!');
  31 + util.puts('Saved my first doc to the couch!');
32 32 });
33 33
34 34 db
35 35 .getDoc('my-doc', function(er, doc) {
36 36 if (er) throw new Error(JSON.stringify(er));
37   - sys.puts('Fetched my new doc from couch:');
38   - sys.p(doc);
  37 + util.puts('Fetched my new doc from couch:');
  38 + util.p(doc);
39 39 });
40 40
41 41 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.
6 test/common.js
... ... @@ -1,6 +1,6 @@
1   -var sys = require('sys');
2   -global.p = sys.p;
3   -global.puts = sys.puts;
  1 +var util = require('util');
  2 +global.p = util.p;
  3 +global.puts = util.puts;
4 4
5 5 global.couchdb = require('../lib/couchdb');
6 6 global.assert = require('assert');
1  test/test-attachment.js
... ... @@ -1,7 +1,6 @@
1 1 require('./common');
2 2
3 3 var
4   - sys = require("sys"),
5 4 DB_NAME = 'node-couchdb-test',
6 5
7 6 callbacks = {

0 comments on commit 5c3f4ec

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