bitpay / node-bitpay-client

A Node.js module and command line client for interacting with BitPay's Cryptographically Secure API
102 stars 95 forks source link

refactor all the things #36

Closed tacticalchihuahua closed 10 years ago

tacticalchihuahua commented 10 years ago

i'm looking at you, @martindale

tacticalchihuahua commented 10 years ago

ping for review by @martindale or @pnagurny

tacticalchihuahua commented 10 years ago

I did this to mimic the more standard approach for node.js libs. You can also do:

var client = new bitpay.Client()

I felt it was better to export an object than just the single constructor, since we will likely add more tools to the exports.

martindale commented 10 years ago

Ah, so an updated pattern (which feels like Bitcore, might be desirable) would be:

var BitPay = require('bitpay').Client;
var bitpay = new BitPay( ... );

This feels reasonable, and might even allow var bitpay = require('bitpay').Server in the future. Neat.