diff --git a/README.md b/README.md index 4b79f050..f606ce46 100644 --- a/README.md +++ b/README.md @@ -32,22 +32,22 @@ There are two ways to instantiate a sharedb-mongo wrapper: 1. The simplest way is to invoke the module and pass in your mongo DB arguments as arguments to the module function. For example: -```javascript -const db = require('sharedb-mongo')('mongodb://localhost:27017/test'); -const backend = new ShareDB({db}); -``` + ```javascript + const db = require('sharedb-mongo')('mongodb://localhost:27017/test'); + const backend = new ShareDB({db}); + ``` 2. If you'd like to reuse a mongo db connection or handle mongo driver instantiation yourself, you can pass in a function that calls back with a mongo instance. -```javascript -const mongodb = require('mongodb'); -const db = require('sharedb-mongo')({mongo: function(callback) { - mongodb.connect('mongodb://localhost:27017/test', callback); -}}); -const backend = new ShareDB({db}); -``` + ```javascript + const mongodb = require('mongodb'); + const db = require('sharedb-mongo')({mongo: function(callback) { + mongodb.connect('mongodb://localhost:27017/test', callback); + }}); + const backend = new ShareDB({db}); + ``` ## Queries