bencevans/node-influx — pull request #36 by tcoulter (2014-07-27 23:57:19+00:00)
Title: Make defaultOptions within the InfluxDB scope

The defaultOptions value is within the global scope, which causes problems if you want more than one InfluxDB instances per node process.

Take this code example:
```
#!/usr/bin/env coffee
influx = require "influx"

first_client = influx
database: "first_database"

console.log first_client.options.database

second_client = influx
database: "second_database"

console.log "------"
console.log first_client.options.database
console.log second_client.options.database
```

The result will print out four lines. When defaultOptions is in the global scope, the output looks like this:

```
first_database
------
second_database
second_database
```

This is alarming because the first instance of InfluxDB will actually query against the **second** database!

When using this PR, the output is now as you'd expect, which will allow you to connect to multiple InfluxDB databases within the same node process:

```
first_database
------
first_database
second_database
```