├── .gitignore ├── .npmignore ├── README.md ├── bin └── node-redshift ├── examples ├── connection_pooling.js ├── parameterized_query.js └── raw_connection.js ├── index.js ├── lib ├── connection.js ├── migration.js ├── model.js ├── orm.js ├── query.js └── validation.js ├── node_modules ├── .bin │ ├── migrate │ └── semver ├── ap │ ├── README.markdown │ ├── examples │ │ └── z.js │ ├── index.js │ ├── package.json │ └── test │ │ └── curry.js ├── bluebird │ ├── LICENSE │ ├── README.md │ ├── changelog.md │ ├── js │ │ ├── browser │ │ │ ├── bluebird.core.js │ │ │ ├── bluebird.core.min.js │ │ │ ├── bluebird.js │ │ │ └── bluebird.min.js │ │ └── release │ │ │ ├── any.js │ │ │ ├── assert.js │ │ │ ├── async.js │ │ │ ├── bind.js │ │ │ ├── bluebird.js │ │ │ ├── call_get.js │ │ │ ├── cancel.js │ │ │ ├── catch_filter.js │ │ │ ├── context.js │ │ │ ├── debuggability.js │ │ │ ├── direct_resolve.js │ │ │ ├── each.js │ │ │ ├── errors.js │ │ │ ├── es5.js │ │ │ ├── filter.js │ │ │ ├── finally.js │ │ │ ├── generators.js │ │ │ ├── join.js │ │ │ ├── map.js │ │ │ ├── method.js │ │ │ ├── nodeback.js │ │ │ ├── nodeify.js │ │ │ ├── promise.js │ │ │ ├── promise_array.js │ │ │ ├── promisify.js │ │ │ ├── props.js │ │ │ ├── queue.js │ │ │ ├── race.js │ │ │ ├── reduce.js │ │ │ ├── schedule.js │ │ │ ├── settle.js │ │ │ ├── some.js │ │ │ ├── synchronous_inspection.js │ │ │ ├── thenables.js │ │ │ ├── timers.js │ │ │ ├── using.js │ │ │ └── util.js │ └── package.json ├── buffer-writer │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── benchmark │ │ ├── index.js │ │ ├── int-16-benchmark.js │ │ ├── int-32-benchmark.js │ │ ├── join-benchmark.js │ │ ├── resize-benchmark.js │ │ └── small-benchmark.js │ ├── index.js │ ├── package.json │ └── test │ │ ├── mocha.opts │ │ └── writer-tests.js ├── commander │ ├── History.md │ ├── LICENSE │ ├── Readme.md │ ├── index.js │ ├── node_modules │ │ └── graceful-readlink │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ └── package.json ├── generic-pool │ ├── .eslintrc.js │ ├── .npmignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── Makefile │ ├── README.md │ ├── bugs │ │ └── 128.js │ ├── fabfile.py │ ├── lib │ │ └── generic-pool.js │ ├── package.json │ └── test │ │ └── generic-pool.test.js ├── migrate │ ├── .gitmodules │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── bin │ │ └── migrate │ ├── index.js │ ├── lib │ │ ├── migrate.js │ │ ├── migration.js │ │ └── set.js │ └── package.json ├── object-assign │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── packet-reader │ ├── .npmignore │ ├── index.js │ ├── package.json │ └── test │ │ └── index.js ├── pg-connection-string │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── package.json │ └── test │ │ └── parse.js ├── pg-pool │ ├── .npmignore │ ├── .travis.yml │ ├── Makefile │ ├── README.md │ ├── index.js │ ├── package.json │ └── test │ │ ├── events.js │ │ ├── index.js │ │ ├── logging.js │ │ └── mocha.opts ├── pg-types │ ├── .npmignore │ ├── .travis.yml │ ├── Makefile │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── arrayParser.js │ │ ├── binaryParsers.js │ │ └── textParsers.js │ ├── package.json │ └── test │ │ ├── index.js │ │ └── types.js ├── pg │ ├── .jshintrc │ ├── .npmignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── Makefile │ ├── README.md │ ├── lib │ │ ├── client.js │ │ ├── connection-parameters.js │ │ ├── connection.js │ │ ├── defaults.js │ │ ├── index.js │ │ ├── native │ │ │ ├── index.js │ │ │ ├── query.js │ │ │ └── result.js │ │ ├── pool-factory.js │ │ ├── query.js │ │ ├── result.js │ │ ├── type-overrides.js │ │ └── utils.js │ └── package.json ├── pgpass │ ├── .jshintrc │ ├── .npmignore │ ├── .travis.yml │ ├── README.md │ ├── coverage.json │ ├── lib │ │ ├── helper.js │ │ └── index.js │ ├── package.json │ └── test │ │ ├── #1 de-escaping.js │ │ ├── #1 escaping.js │ │ ├── #6 too many open files.js │ │ ├── _pgpass │ │ ├── helper.js │ │ ├── index.js │ │ └── integration │ │ └── #1 escaping.js ├── postgres-array │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── postgres-bytea │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── postgres-date │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── postgres-interval │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── semver │ ├── .npmignore │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── bin │ │ └── semver │ ├── foot.js.txt │ ├── head.js.txt │ ├── package.json │ ├── semver.browser.js │ ├── semver.browser.js.gz │ ├── semver.js │ ├── semver.min.js │ ├── semver.min.js.gz │ └── test │ │ ├── amd.js │ │ ├── big-numbers.js │ │ ├── clean.js │ │ ├── gtr.js │ │ ├── index.js │ │ ├── ltr.js │ │ ├── major-minor-patch.js │ │ └── no-module.js ├── split │ ├── .npmignore │ ├── .travis.yml │ ├── LICENCE │ ├── examples │ │ └── pretty.js │ ├── index.js │ ├── package.json │ ├── readme.markdown │ └── test │ │ ├── options.asynct.js │ │ ├── partitioned_unicode.js │ │ ├── split.asynct.js │ │ └── try_catch.asynct.js ├── sql-bricks │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE.md │ ├── browser-tests.html │ ├── index.html │ ├── node_modules │ │ └── underscore │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── CNAME │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ ├── underscore-min.js │ │ │ └── underscore.js │ ├── package.json │ ├── readme.md │ ├── sql-bricks.js │ └── tests │ │ ├── doctests.js │ │ ├── doctests.tmpl │ │ ├── gen-tests.js │ │ ├── mocha.css │ │ ├── mocha.js │ │ ├── tests.js │ │ └── underscore.js ├── through │ ├── .travis.yml │ ├── LICENSE.APACHE2 │ ├── LICENSE.MIT │ ├── index.js │ ├── package.json │ ├── readme.markdown │ └── test │ │ ├── async.js │ │ ├── auto-destroy.js │ │ ├── buffering.js │ │ ├── end.js │ │ └── index.js └── xtend │ ├── .jshintrc │ ├── .npmignore │ ├── LICENCE │ ├── Makefile │ ├── README.md │ ├── immutable.js │ ├── mutable.js │ └── package.json ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | connect.js 2 | test.js 3 | models/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | connect.js 2 | test.js 3 | -------------------------------------------------------------------------------- /bin/node-redshift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var commander = require('commander'); 3 | var migrate = require('../lib/migration.js'); 4 | var model = require('../lib/model.js'); 5 | 6 | commander 7 | .version('0.0.1') 8 | .option('migration:create [name]', 'Create a new Redshift migration') 9 | .option('db:migrate [name or number_of_migrations]', 'Run all or a number of migrations against your Redshift database') 10 | .option('db:migrate:undo [name or number_of_migrations]', 'Undo all or a number of migrations against your Redshift database') 11 | .option('model:create [name]', 'Create a new Redshift model') 12 | .parse(process.argv); 13 | 14 | if(commander['migration:create']){ 15 | var fileName = undefined; 16 | if(commander["migration:create"] && commander["migration:create"] !== true) fileName = commander["migration:create"]; 17 | migrate.create(fileName); 18 | } 19 | 20 | else if(commander['db:migrate']){ 21 | var fileNameOrNumber = undefined; 22 | if(commander["db:migrate"] && commander["db:migrate"] !== true) fileNameOrNumber = commander["db:migrate"]; 23 | migrate.up(fileNameOrNumber); 24 | } 25 | 26 | else if(commander['db:migrate:undo']){ 27 | var fileNameOrNumber = undefined; 28 | if(commander["db:migrate:undo"] && commander["db:migrate:undo"] !== true) fileNameOrNumber = commander["db:migrate:undo"]; 29 | migrate.down(fileNameOrNumber); 30 | } 31 | 32 | else if(commander['model:create']){ 33 | var fileName = undefined; 34 | if(commander['model:create'] && commander['model:create'] !== true) model.create(commander['model:create']); 35 | else console.log("Error: Please enter a valid name for the model"); 36 | } 37 | else console.log("Invalid command line arguments. Please run `node-redshift --help` for more help on commands"); 38 | -------------------------------------------------------------------------------- /examples/connection_pooling.js: -------------------------------------------------------------------------------- 1 | var Redshift = require('../index.js'); 2 | 3 | var client = { 4 | user: 'user', 5 | database: 'database', 6 | password: 'password', 7 | port: 'port', 8 | host: 'host' 9 | }; 10 | 11 | var redshift = new Redshift(client); //no need to call connect(), without rawConnection, it automatically connects 12 | 13 | // using callbacks 14 | redshift.query('SELECT * FROM "Tags"', {raw: true}, function(err, data){ 15 | if(err) throw err; 16 | else{ 17 | console.log(data); 18 | 19 | // if you want to close client pool, uncomment redshift.close() line 20 | // but you won't be able to make subsequent calls because connection is terminated 21 | // redshift.close(); 22 | } 23 | }); 24 | 25 | // using promises 26 | redshift.query('SELECT * FROM "Tags"', {raw: true}) 27 | .then(function(data){ 28 | console.log(data); 29 | 30 | // if you want to close client pool, uncomment redshift.close() line 31 | // but you won't be able to make subsequent calls because connection is terminated 32 | // redshift.close(); 33 | }, function(err){ 34 | throw err; 35 | }); -------------------------------------------------------------------------------- /examples/parameterized_query.js: -------------------------------------------------------------------------------- 1 | var Redshift = require('../index.js'); 2 | 3 | var client = { 4 | user: 'user', 5 | database: 'database', 6 | password: 'password', 7 | port: 'port', 8 | host: 'host' 9 | }; 10 | 11 | var redshift = new Redshift(client); //no need to call connect(), without rawConnection, it automatically connects 12 | 13 | redshift.parameterizedQuery('SELECT * FROM "Tags" WHERE "id" = $1', ['42'], {raw: true}) 14 | .then(function(data){ 15 | console.log(data); 16 | }) 17 | .catch(function(err){ 18 | throw err; 19 | }); -------------------------------------------------------------------------------- /examples/raw_connection.js: -------------------------------------------------------------------------------- 1 | var Redshift = require('../index.js'); 2 | 3 | var client = { 4 | user: 'user', 5 | database: 'database', 6 | password: 'password', 7 | port: 'port', 8 | host: 'host' 9 | }; 10 | 11 | var redshift = new Redshift(client, {rawConnection: true}); 12 | 13 | // using callbacks 14 | // redshift.connect(function(err){ //create connection manually 15 | // if(err) throw err; 16 | // else{ 17 | // redshift.query('SELECT * FROM "Tags"', {raw: true}, function(err, data){ //query redshift 18 | // if(err) throw err; 19 | // else{ 20 | // console.log(data); 21 | 22 | // redshift.close(); 23 | // } 24 | // }); 25 | // } 26 | // }); 27 | 28 | // using promises 29 | // redshift.connect(function(err){ //create connection manually 30 | // if(err) throw err; 31 | // else{ 32 | 33 | // redshift.query('SELECT * FROM "Tags"', {raw: true}) 34 | // .then(function(data){ //query redshift 35 | // console.log(data); 36 | 37 | // redshift.close(); 38 | // }, function(err){ 39 | // throw err; 40 | // }); 41 | // } 42 | // }); 43 | 44 | // you can also skip connecting and closing manually by using the rawQuery function which creates a new redshift instance temporarily, 45 | // connects to your db, makes a query, returns the data and disconnects from the database in one operation 46 | redshift.rawQuery(`SELECT * FROM "Tags"`, {raw: true}) 47 | .then(function(data){ 48 | console.log(data); 49 | }) 50 | .catch(function(err){ 51 | console.log(err); 52 | }); -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/connection.js'); 2 | module.exports.query = require('./lib/query.js'); 3 | module.exports.model = require('./lib/model.js'); 4 | module.exports.import = require('./lib/model.js').import; -------------------------------------------------------------------------------- /lib/connection.js: -------------------------------------------------------------------------------- 1 | var pg = require('pg'); 2 | var Promise = require('bluebird'); 3 | 4 | /** 5 | * Redshift constructor function 6 | * @param {Object} config connection object with {host, port, database, user, password} 7 | * @param {Object} options {rawConnection: } 8 | */ 9 | var Redshift = function (config, options) { 10 | if (config && typeof config === 'string' || typeof config === 'object') { 11 | var that = this; 12 | that.config = config; 13 | 14 | if (options && options.rawConnection) { 15 | that.connectionType = 'client'; 16 | var client = new pg.Client(that.config); 17 | that.client = client; 18 | } else { 19 | that.connectionType = 'pool'; 20 | that.pool = new pg.Pool(that.config); 21 | that.pool.on('error', function (err, client) { 22 | // if an error is encountered by a client while it sits idle in the pool 23 | // the pool itself will emit an error event with both the error and 24 | // the client which emitted the original error 25 | // this is a rare occurrence but can happen if there is a network partition 26 | // between your application and the database, the database restarts, etc. 27 | console.error('Redshift pg.Pool idle client error', err.message, err.stack) 28 | }); 29 | } 30 | 31 | // unless there's an option disabling long stack traces, enable long stack traces 32 | if(!options || (options && (options.longStackTraces == undefined || options.longStackTraces === true))){ 33 | Promise.config({ 34 | longStackTraces: true 35 | }); 36 | } 37 | 38 | // add additional pg modules to redshift object 39 | that.types = pg.types; 40 | } else { 41 | throw new Error('invalid Redshift connection configuration'); 42 | } 43 | }; 44 | 45 | // Close client or pool 46 | Redshift.prototype.close = function (callback) { 47 | var that = this; //store original context of this because it will change inside callbacks 48 | if (that.connectionType && that.connectionType === 'client' && that.client) { 49 | that.client.end(callback); 50 | } else if (that.connectionType && that.connectionType === 'pool' && that.pool) { 51 | that.pool.end(callback); 52 | delete that.pool; 53 | } 54 | }; 55 | 56 | 57 | Redshift.prototype.connect = function (callback) { 58 | var that = this; 59 | 60 | if (that.connectionType && that.connectionType === 'client' && that.client) { 61 | that.client.connect(callback); 62 | 63 | } else if (that.connectionType === 'pool') { 64 | callback(new Error("Don't call connect if using pools")); 65 | 66 | } else { 67 | callback(new Error("Couldn't connect to redshift. Invalid connection type")); 68 | } 69 | }; 70 | 71 | module.exports = Redshift; -------------------------------------------------------------------------------- /lib/migration.js: -------------------------------------------------------------------------------- 1 | // adapated from https://github.com/tj/node-migrate/blob/master/bin/migrate 2 | // this was originally CLI, but I want to make this API accessible programatically 3 | 4 | var migrate = require('migrate'); 5 | var join = require('path').join; 6 | var fs = require('fs'); 7 | var folderName = 'redshift_migrations'; 8 | 9 | var template = [ 10 | '\'use strict\'' 11 | , '' 12 | , 'exports.up = function(next) {' 13 | , ' next();' 14 | , '};' 15 | , '' 16 | , 'exports.down = function(next) {' 17 | , ' next();' 18 | , '};' 19 | , '' 20 | ].join('\n'); 21 | 22 | 23 | 24 | function create(name) { 25 | try { 26 | fs.mkdirSync(folderName, 0774); 27 | } catch (err) { 28 | // ignore 29 | } 30 | var curr = Date.now(); 31 | name = curr + '-' + name; 32 | var path = join(folderName, name + '.js'); 33 | console.log('create', join(process.cwd(), path)); 34 | fs.writeFileSync(path, template); 35 | } 36 | 37 | module.exports.create = create; 38 | 39 | function up(migrationName) { 40 | performMigration('up', migrationName); 41 | } 42 | 43 | module.exports.up = up; 44 | /** 45 | * down [name] 46 | */ 47 | 48 | function down(migrationName) { 49 | performMigration('down', migrationName); 50 | } 51 | 52 | module.exports.down = down; 53 | 54 | function performMigration(direction, migrationName) { 55 | var state = join(folderName, '.migrate'); 56 | var set = migrate.load(state, folderName); 57 | 58 | set.on('migration', function (migration, direction) { 59 | console.log(direction, migration.title); 60 | }); 61 | 62 | // `migrationName` might be a number of migrations to jump up or down, so we 63 | // have to convert it to a migration name the underlying `node-migrate` can 64 | // handle 65 | 66 | if (Number.isInteger(Number(migrationName))) { 67 | var numMigrations = Number(migrationName) 68 | 69 | if (direction === 'down') { 70 | numMigrations = -numMigrations 71 | } 72 | 73 | var stateObj = JSON.parse(fs.readFileSync(state, 'utf8')) 74 | migrationName = set.migrations[stateObj.pos + numMigrations].title 75 | } 76 | 77 | var migrationPath = migrationName ? 78 | join(folderName, migrationName) : 79 | migrationName; 80 | 81 | set[direction](migrationName, function (err) { 82 | if (err) { 83 | console.log('error', err); 84 | process.exit(1); 85 | } 86 | 87 | console.log('migration', 'complete'); 88 | process.exit(0); 89 | }); 90 | } 91 | -------------------------------------------------------------------------------- /lib/model.js: -------------------------------------------------------------------------------- 1 | var join = require('path').join; 2 | var fs = require('fs'); 3 | var folderName = 'redshift_models'; 4 | var ORM = require('./orm.js'); 5 | var Redshift = require('./connection.js'); 6 | 7 | 8 | var template = [ 9 | "'use strict';" 10 | , "var model = require('node-redshift').model;" 11 | , "var person = {" 12 | , " 'tableName': 'people'," 13 | , " 'tableProperties': {" 14 | , " 'id': {" 15 | , " 'type': 'key'" 16 | , " }," 17 | , " 'name': { " 18 | , " 'type': 'string'," 19 | , " 'required': true" 20 | , " }," 21 | , " 'email': { " 22 | , " 'type': 'string'," 23 | , " 'required': true" 24 | , " }" 25 | , " }" 26 | , "};" 27 | , "module.exports = person;" 28 | ].join('\n'); 29 | 30 | function create(name) { 31 | try { 32 | fs.mkdirSync(folderName, 0774); 33 | } catch (err) { 34 | // ignore 35 | } 36 | var path = join(folderName, name + '.js'); 37 | fs.writeFileSync(path, template); 38 | } 39 | 40 | module.exports.create = create; 41 | 42 | Redshift.prototype.import = function (name) { 43 | if (!Redshift.prototype.models) Redshift.prototype.models = []; { 44 | var path = join(process.cwd(), name); 45 | } 46 | if (Redshift.prototype.models[path]) { 47 | return Redshift.prototype.models[path]; 48 | } else { 49 | var obj = require(path); 50 | 51 | if (typeof obj != 'object') { 52 | throw new Error('Cannot build without an object'); 53 | } 54 | if (obj.hasOwnProperty('tableName') == false && obj.tableName != null) { 55 | throw new Error('Cannot build without a tableName to connect'); 56 | } 57 | if (obj.hasOwnProperty('tableProperties') == false && obj.tableProperties != null) { 58 | throw new Error('Cannot build without tableProperties to export'); 59 | } 60 | 61 | var _return = new ORM(this); 62 | _return.tableName = obj.tableName; 63 | _return.tableProperties = obj.tableProperties; 64 | 65 | Redshift.prototype.models[path] = _return; 66 | return _return; 67 | } 68 | }; 69 | 70 | module.exports.import = Redshift.prototype.import; -------------------------------------------------------------------------------- /lib/validation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = validate; 4 | 5 | function validate(modelObj, data) { 6 | var validKeys = Object.keys(modelObj); 7 | for (var key in data) { 8 | if (data.hasOwnProperty(key)) { 9 | if (validKeys.indexOf(key) === -1) { 10 | delete data[key]; 11 | } 12 | } 13 | } 14 | return data; 15 | } -------------------------------------------------------------------------------- /node_modules/.bin/migrate: -------------------------------------------------------------------------------- 1 | ../migrate/bin/migrate -------------------------------------------------------------------------------- /node_modules/.bin/semver: -------------------------------------------------------------------------------- 1 | ../semver/bin/semver -------------------------------------------------------------------------------- /node_modules/ap/README.markdown: -------------------------------------------------------------------------------- 1 | ap 2 | == 3 | 4 | `Function.prototype.bind` sets `this` which is super annoying if you just want 5 | to do currying over arguments while passing `this` through. 6 | 7 | Instead you can do: 8 | 9 | ``` js 10 | var ap = require('ap'); 11 | var z = ap([3], function (x, y) { 12 | return this.z * (x * 2 + y); 13 | }).call({ z : 10 }, 4); 14 | console.log(z); 15 | ``` 16 | 17 | *** 18 | 19 | ``` 20 | 100 21 | ``` 22 | 23 | methods 24 | ======= 25 | 26 | ``` js 27 | var ap = require('ap') 28 | ``` 29 | 30 | ## ap(args, fn) 31 | 32 | Fill in the arguments `args` at the beginning of `fn`'s arguments list. 33 | 34 | ## ap.pa(args, fn) 35 | 36 | Fill in the arguments `args` at the end of `fn`'s arguments list. 37 | 38 | ## ap.apa(left, right, fn) 39 | 40 | Fill in `left` arguments starting from the beginning of `fn`'s argument list and 41 | `right` arguments starting from the end. 42 | 43 | ## ap.partial(fn, args...) 44 | 45 | Fill in `fn`'s arguments with `args...` from the beginning of `fn`'s arguments 46 | list. 47 | 48 | ## ap.partialRight(fn, args...) 49 | 50 | Fill in `fn`'s arguments with `args...` starting from the end of `fn`'s 51 | arguments list. 52 | 53 | ## ap.curry(fn, args...) 54 | 55 | Curry `fn`, returning a new function with `args...` partially applied from the 56 | beginning of `fn`'s arguments list. 57 | 58 | ## ap.curryRight(fn, args...) 59 | 60 | Curry `fn` returning a new function with `args...` partially applied from the 61 | end of `fn`'s arguments list. 62 | -------------------------------------------------------------------------------- /node_modules/ap/examples/z.js: -------------------------------------------------------------------------------- 1 | var ap = require('../'); 2 | var z = ap([3], function (x, y) { 3 | return this.z * (x * 2 + y); 4 | }).call({ z : 10 }, 4); 5 | console.log(z); 6 | -------------------------------------------------------------------------------- /node_modules/ap/index.js: -------------------------------------------------------------------------------- 1 | exports = module.exports = ap; 2 | function ap (args, fn) { 3 | return function () { 4 | var rest = [].slice.call(arguments) 5 | , first = args.slice() 6 | first.push.apply(first, rest) 7 | return fn.apply(this, first); 8 | }; 9 | } 10 | 11 | exports.pa = pa; 12 | function pa (args, fn) { 13 | return function () { 14 | var rest = [].slice.call(arguments) 15 | rest.push.apply(rest, args) 16 | return fn.apply(this, rest); 17 | }; 18 | } 19 | 20 | exports.apa = apa; 21 | function apa (left, right, fn) { 22 | return function () { 23 | return fn.apply(this, 24 | left.concat.apply(left, arguments).concat(right) 25 | ); 26 | }; 27 | } 28 | 29 | exports.partial = partial; 30 | function partial (fn) { 31 | var args = [].slice.call(arguments, 1); 32 | return ap(args, fn); 33 | } 34 | 35 | exports.partialRight = partialRight; 36 | function partialRight (fn) { 37 | var args = [].slice.call(arguments, 1); 38 | return pa(args, fn); 39 | } 40 | 41 | exports.curry = curry; 42 | function curry (fn) { 43 | return partial(partial, fn); 44 | } 45 | 46 | exports.curryRight = function curryRight (fn) { 47 | return partial(partialRight, fn); 48 | } 49 | -------------------------------------------------------------------------------- /node_modules/bluebird/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2017 Petka Antonov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/bluebird/README.md: -------------------------------------------------------------------------------- 1 | 2 | Promises/A+ logo 4 | 5 | [![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird) 6 | [![coverage-98%](http://img.shields.io/badge/coverage-98%-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html) 7 | 8 | **Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises) 9 | 10 | # Introduction 11 | 12 | Bluebird is a fully featured promise library with focus on innovative features and performance 13 | 14 | See the [**bluebird website**](http://bluebirdjs.com/docs/getting-started.html) for further documentation, references and instructions. See the [**API reference**](http://bluebirdjs.com/docs/api-reference.html) here. 15 | 16 | For bluebird 2.x documentation and files, see the [2.x tree](https://github.com/petkaantonov/bluebird/tree/2.x). 17 | 18 | # Questions and issues 19 | 20 | The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`. 21 | 22 | 23 | 24 | ## Thanks 25 | 26 | Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8. 27 | 28 | # License 29 | 30 | The MIT License (MIT) 31 | 32 | Copyright (c) 2013-2017 Petka Antonov 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a copy 35 | of this software and associated documentation files (the "Software"), to deal 36 | in the Software without restriction, including without limitation the rights 37 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 38 | copies of the Software, and to permit persons to whom the Software is 39 | furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in 42 | all copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 45 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 47 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 48 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 49 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 50 | THE SOFTWARE. 51 | 52 | -------------------------------------------------------------------------------- /node_modules/bluebird/changelog.md: -------------------------------------------------------------------------------- 1 | [http://bluebirdjs.com/docs/changelog.html](http://bluebirdjs.com/docs/changelog.html) 2 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/any.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise) { 3 | var SomePromiseArray = Promise._SomePromiseArray; 4 | function any(promises) { 5 | var ret = new SomePromiseArray(promises); 6 | var promise = ret.promise(); 7 | ret.setHowMany(1); 8 | ret.setUnwrap(); 9 | ret.init(); 10 | return promise; 11 | } 12 | 13 | Promise.any = function (promises) { 14 | return any(promises); 15 | }; 16 | 17 | Promise.prototype.any = function () { 18 | return any(this); 19 | }; 20 | 21 | }; 22 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/assert.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = (function(){ 3 | var AssertionError = (function() { 4 | function AssertionError(a) { 5 | this.constructor$(a); 6 | this.message = a; 7 | this.name = "AssertionError"; 8 | } 9 | AssertionError.prototype = new Error(); 10 | AssertionError.prototype.constructor = AssertionError; 11 | AssertionError.prototype.constructor$ = Error; 12 | return AssertionError; 13 | })(); 14 | 15 | function getParams(args) { 16 | var params = []; 17 | for (var i = 0; i < args.length; ++i) params.push("arg" + i); 18 | return params; 19 | } 20 | 21 | function nativeAssert(callName, args, expect) { 22 | try { 23 | var params = getParams(args); 24 | var constructorArgs = params; 25 | constructorArgs.push("return " + 26 | callName + "("+ params.join(",") + ");"); 27 | var fn = Function.apply(null, constructorArgs); 28 | return fn.apply(null, args); 29 | } catch (e) { 30 | if (!(e instanceof SyntaxError)) { 31 | throw e; 32 | } else { 33 | return expect; 34 | } 35 | } 36 | } 37 | 38 | return function assert(boolExpr, message) { 39 | if (boolExpr === true) return; 40 | 41 | if (typeof boolExpr === "string" && 42 | boolExpr.charAt(0) === "%") { 43 | var nativeCallName = boolExpr; 44 | var $_len = arguments.length;var args = new Array(Math.max($_len - 2, 0)); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];}; 45 | if (nativeAssert(nativeCallName, args, message) === message) return; 46 | message = (nativeCallName + " !== " + message); 47 | } 48 | 49 | var ret = new AssertionError(message); 50 | if (Error.captureStackTrace) { 51 | Error.captureStackTrace(ret, assert); 52 | } 53 | throw ret; 54 | }; 55 | })(); 56 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/bind.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { 3 | var calledBind = false; 4 | var rejectThis = function(_, e) { 5 | this._reject(e); 6 | }; 7 | 8 | var targetRejected = function(e, context) { 9 | context.promiseRejectionQueued = true; 10 | context.bindingPromise._then(rejectThis, rejectThis, null, this, e); 11 | }; 12 | 13 | var bindingResolved = function(thisArg, context) { 14 | if (((this._bitField & 50397184) === 0)) { 15 | this._resolveCallback(context.target); 16 | } 17 | }; 18 | 19 | var bindingRejected = function(e, context) { 20 | if (!context.promiseRejectionQueued) this._reject(e); 21 | }; 22 | 23 | Promise.prototype.bind = function (thisArg) { 24 | if (!calledBind) { 25 | calledBind = true; 26 | Promise.prototype._propagateFrom = debug.propagateFromFunction(); 27 | Promise.prototype._boundValue = debug.boundValueFunction(); 28 | } 29 | var maybePromise = tryConvertToPromise(thisArg); 30 | var ret = new Promise(INTERNAL); 31 | ret._propagateFrom(this, 1); 32 | var target = this._target(); 33 | ret._setBoundTo(maybePromise); 34 | if (maybePromise instanceof Promise) { 35 | var context = { 36 | promiseRejectionQueued: false, 37 | promise: ret, 38 | target: target, 39 | bindingPromise: maybePromise 40 | }; 41 | target._then(INTERNAL, targetRejected, undefined, ret, context); 42 | maybePromise._then( 43 | bindingResolved, bindingRejected, undefined, ret, context); 44 | ret._setOnCancel(maybePromise); 45 | } else { 46 | ret._resolveCallback(target); 47 | } 48 | return ret; 49 | }; 50 | 51 | Promise.prototype._setBoundTo = function (obj) { 52 | if (obj !== undefined) { 53 | this._bitField = this._bitField | 2097152; 54 | this._boundTo = obj; 55 | } else { 56 | this._bitField = this._bitField & (~2097152); 57 | } 58 | }; 59 | 60 | Promise.prototype._isBound = function () { 61 | return (this._bitField & 2097152) === 2097152; 62 | }; 63 | 64 | Promise.bind = function (thisArg, value) { 65 | return Promise.resolve(value).bind(thisArg); 66 | }; 67 | }; 68 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/bluebird.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var old; 3 | if (typeof Promise !== "undefined") old = Promise; 4 | function noConflict() { 5 | try { if (Promise === bluebird) Promise = old; } 6 | catch (e) {} 7 | return bluebird; 8 | } 9 | var bluebird = require("./promise")(); 10 | bluebird.noConflict = noConflict; 11 | module.exports = bluebird; 12 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/catch_filter.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(NEXT_FILTER) { 3 | var util = require("./util"); 4 | var getKeys = require("./es5").keys; 5 | var tryCatch = util.tryCatch; 6 | var errorObj = util.errorObj; 7 | 8 | function catchFilter(instances, cb, promise) { 9 | return function(e) { 10 | var boundTo = promise._boundValue(); 11 | predicateLoop: for (var i = 0; i < instances.length; ++i) { 12 | var item = instances[i]; 13 | 14 | if (item === Error || 15 | (item != null && item.prototype instanceof Error)) { 16 | if (e instanceof item) { 17 | return tryCatch(cb).call(boundTo, e); 18 | } 19 | } else if (typeof item === "function") { 20 | var matchesPredicate = tryCatch(item).call(boundTo, e); 21 | if (matchesPredicate === errorObj) { 22 | return matchesPredicate; 23 | } else if (matchesPredicate) { 24 | return tryCatch(cb).call(boundTo, e); 25 | } 26 | } else if (util.isObject(e)) { 27 | var keys = getKeys(item); 28 | for (var j = 0; j < keys.length; ++j) { 29 | var key = keys[j]; 30 | if (item[key] != e[key]) { 31 | continue predicateLoop; 32 | } 33 | } 34 | return tryCatch(cb).call(boundTo, e); 35 | } 36 | } 37 | return NEXT_FILTER; 38 | }; 39 | } 40 | 41 | return catchFilter; 42 | }; 43 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/context.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise) { 3 | var longStackTraces = false; 4 | var contextStack = []; 5 | 6 | Promise.prototype._promiseCreated = function() {}; 7 | Promise.prototype._pushContext = function() {}; 8 | Promise.prototype._popContext = function() {return null;}; 9 | Promise._peekContext = Promise.prototype._peekContext = function() {}; 10 | 11 | function Context() { 12 | this._trace = new Context.CapturedTrace(peekContext()); 13 | } 14 | Context.prototype._pushContext = function () { 15 | if (this._trace !== undefined) { 16 | this._trace._promiseCreated = null; 17 | contextStack.push(this._trace); 18 | } 19 | }; 20 | 21 | Context.prototype._popContext = function () { 22 | if (this._trace !== undefined) { 23 | var trace = contextStack.pop(); 24 | var ret = trace._promiseCreated; 25 | trace._promiseCreated = null; 26 | return ret; 27 | } 28 | return null; 29 | }; 30 | 31 | function createContext() { 32 | if (longStackTraces) return new Context(); 33 | } 34 | 35 | function peekContext() { 36 | var lastIndex = contextStack.length - 1; 37 | if (lastIndex >= 0) { 38 | return contextStack[lastIndex]; 39 | } 40 | return undefined; 41 | } 42 | Context.CapturedTrace = null; 43 | Context.create = createContext; 44 | Context.deactivateLongStackTraces = function() {}; 45 | Context.activateLongStackTraces = function() { 46 | var Promise_pushContext = Promise.prototype._pushContext; 47 | var Promise_popContext = Promise.prototype._popContext; 48 | var Promise_PeekContext = Promise._peekContext; 49 | var Promise_peekContext = Promise.prototype._peekContext; 50 | var Promise_promiseCreated = Promise.prototype._promiseCreated; 51 | Context.deactivateLongStackTraces = function() { 52 | Promise.prototype._pushContext = Promise_pushContext; 53 | Promise.prototype._popContext = Promise_popContext; 54 | Promise._peekContext = Promise_PeekContext; 55 | Promise.prototype._peekContext = Promise_peekContext; 56 | Promise.prototype._promiseCreated = Promise_promiseCreated; 57 | longStackTraces = false; 58 | }; 59 | longStackTraces = true; 60 | Promise.prototype._pushContext = Context.prototype._pushContext; 61 | Promise.prototype._popContext = Context.prototype._popContext; 62 | Promise._peekContext = Promise.prototype._peekContext = peekContext; 63 | Promise.prototype._promiseCreated = function() { 64 | var ctx = this._peekContext(); 65 | if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; 66 | }; 67 | }; 68 | return Context; 69 | }; 70 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/direct_resolve.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise) { 3 | function returner() { 4 | return this.value; 5 | } 6 | function thrower() { 7 | throw this.reason; 8 | } 9 | 10 | Promise.prototype["return"] = 11 | Promise.prototype.thenReturn = function (value) { 12 | if (value instanceof Promise) value.suppressUnhandledRejections(); 13 | return this._then( 14 | returner, undefined, undefined, {value: value}, undefined); 15 | }; 16 | 17 | Promise.prototype["throw"] = 18 | Promise.prototype.thenThrow = function (reason) { 19 | return this._then( 20 | thrower, undefined, undefined, {reason: reason}, undefined); 21 | }; 22 | 23 | Promise.prototype.catchThrow = function (reason) { 24 | if (arguments.length <= 1) { 25 | return this._then( 26 | undefined, thrower, undefined, {reason: reason}, undefined); 27 | } else { 28 | var _reason = arguments[1]; 29 | var handler = function() {throw _reason;}; 30 | return this.caught(reason, handler); 31 | } 32 | }; 33 | 34 | Promise.prototype.catchReturn = function (value) { 35 | if (arguments.length <= 1) { 36 | if (value instanceof Promise) value.suppressUnhandledRejections(); 37 | return this._then( 38 | undefined, returner, undefined, {value: value}, undefined); 39 | } else { 40 | var _value = arguments[1]; 41 | if (_value instanceof Promise) _value.suppressUnhandledRejections(); 42 | var handler = function() {return _value;}; 43 | return this.caught(value, handler); 44 | } 45 | }; 46 | }; 47 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/each.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise, INTERNAL) { 3 | var PromiseReduce = Promise.reduce; 4 | var PromiseAll = Promise.all; 5 | 6 | function promiseAllThis() { 7 | return PromiseAll(this); 8 | } 9 | 10 | function PromiseMapSeries(promises, fn) { 11 | return PromiseReduce(promises, fn, INTERNAL, INTERNAL); 12 | } 13 | 14 | Promise.prototype.each = function (fn) { 15 | return PromiseReduce(this, fn, INTERNAL, 0) 16 | ._then(promiseAllThis, undefined, undefined, this, undefined); 17 | }; 18 | 19 | Promise.prototype.mapSeries = function (fn) { 20 | return PromiseReduce(this, fn, INTERNAL, INTERNAL); 21 | }; 22 | 23 | Promise.each = function (promises, fn) { 24 | return PromiseReduce(promises, fn, INTERNAL, 0) 25 | ._then(promiseAllThis, undefined, undefined, promises, undefined); 26 | }; 27 | 28 | Promise.mapSeries = PromiseMapSeries; 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/es5.js: -------------------------------------------------------------------------------- 1 | var isES5 = (function(){ 2 | "use strict"; 3 | return this === undefined; 4 | })(); 5 | 6 | if (isES5) { 7 | module.exports = { 8 | freeze: Object.freeze, 9 | defineProperty: Object.defineProperty, 10 | getDescriptor: Object.getOwnPropertyDescriptor, 11 | keys: Object.keys, 12 | names: Object.getOwnPropertyNames, 13 | getPrototypeOf: Object.getPrototypeOf, 14 | isArray: Array.isArray, 15 | isES5: isES5, 16 | propertyIsWritable: function(obj, prop) { 17 | var descriptor = Object.getOwnPropertyDescriptor(obj, prop); 18 | return !!(!descriptor || descriptor.writable || descriptor.set); 19 | } 20 | }; 21 | } else { 22 | var has = {}.hasOwnProperty; 23 | var str = {}.toString; 24 | var proto = {}.constructor.prototype; 25 | 26 | var ObjectKeys = function (o) { 27 | var ret = []; 28 | for (var key in o) { 29 | if (has.call(o, key)) { 30 | ret.push(key); 31 | } 32 | } 33 | return ret; 34 | }; 35 | 36 | var ObjectGetDescriptor = function(o, key) { 37 | return {value: o[key]}; 38 | }; 39 | 40 | var ObjectDefineProperty = function (o, key, desc) { 41 | o[key] = desc.value; 42 | return o; 43 | }; 44 | 45 | var ObjectFreeze = function (obj) { 46 | return obj; 47 | }; 48 | 49 | var ObjectGetPrototypeOf = function (obj) { 50 | try { 51 | return Object(obj).constructor.prototype; 52 | } 53 | catch (e) { 54 | return proto; 55 | } 56 | }; 57 | 58 | var ArrayIsArray = function (obj) { 59 | try { 60 | return str.call(obj) === "[object Array]"; 61 | } 62 | catch(e) { 63 | return false; 64 | } 65 | }; 66 | 67 | module.exports = { 68 | isArray: ArrayIsArray, 69 | keys: ObjectKeys, 70 | names: ObjectKeys, 71 | defineProperty: ObjectDefineProperty, 72 | getDescriptor: ObjectGetDescriptor, 73 | freeze: ObjectFreeze, 74 | getPrototypeOf: ObjectGetPrototypeOf, 75 | isES5: isES5, 76 | propertyIsWritable: function() { 77 | return true; 78 | } 79 | }; 80 | } 81 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/filter.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise, INTERNAL) { 3 | var PromiseMap = Promise.map; 4 | 5 | Promise.prototype.filter = function (fn, options) { 6 | return PromiseMap(this, fn, options, INTERNAL); 7 | }; 8 | 9 | Promise.filter = function (promises, fn, options) { 10 | return PromiseMap(promises, fn, options, INTERNAL); 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/method.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = 3 | function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { 4 | var util = require("./util"); 5 | var tryCatch = util.tryCatch; 6 | 7 | Promise.method = function (fn) { 8 | if (typeof fn !== "function") { 9 | throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); 10 | } 11 | return function () { 12 | var ret = new Promise(INTERNAL); 13 | ret._captureStackTrace(); 14 | ret._pushContext(); 15 | var value = tryCatch(fn).apply(this, arguments); 16 | var promiseCreated = ret._popContext(); 17 | debug.checkForgottenReturns( 18 | value, promiseCreated, "Promise.method", ret); 19 | ret._resolveFromSyncValue(value); 20 | return ret; 21 | }; 22 | }; 23 | 24 | Promise.attempt = Promise["try"] = function (fn) { 25 | if (typeof fn !== "function") { 26 | return apiRejection("expecting a function but got " + util.classString(fn)); 27 | } 28 | var ret = new Promise(INTERNAL); 29 | ret._captureStackTrace(); 30 | ret._pushContext(); 31 | var value; 32 | if (arguments.length > 1) { 33 | debug.deprecated("calling Promise.try with more than 1 argument"); 34 | var arg = arguments[1]; 35 | var ctx = arguments[2]; 36 | value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) 37 | : tryCatch(fn).call(ctx, arg); 38 | } else { 39 | value = tryCatch(fn)(); 40 | } 41 | var promiseCreated = ret._popContext(); 42 | debug.checkForgottenReturns( 43 | value, promiseCreated, "Promise.try", ret); 44 | ret._resolveFromSyncValue(value); 45 | return ret; 46 | }; 47 | 48 | Promise.prototype._resolveFromSyncValue = function (value) { 49 | if (value === util.errorObj) { 50 | this._rejectCallback(value.e, false); 51 | } else { 52 | this._resolveCallback(value, true); 53 | } 54 | }; 55 | }; 56 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/nodeback.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var util = require("./util"); 3 | var maybeWrapAsError = util.maybeWrapAsError; 4 | var errors = require("./errors"); 5 | var OperationalError = errors.OperationalError; 6 | var es5 = require("./es5"); 7 | 8 | function isUntypedError(obj) { 9 | return obj instanceof Error && 10 | es5.getPrototypeOf(obj) === Error.prototype; 11 | } 12 | 13 | var rErrorKey = /^(?:name|message|stack|cause)$/; 14 | function wrapAsOperationalError(obj) { 15 | var ret; 16 | if (isUntypedError(obj)) { 17 | ret = new OperationalError(obj); 18 | ret.name = obj.name; 19 | ret.message = obj.message; 20 | ret.stack = obj.stack; 21 | var keys = es5.keys(obj); 22 | for (var i = 0; i < keys.length; ++i) { 23 | var key = keys[i]; 24 | if (!rErrorKey.test(key)) { 25 | ret[key] = obj[key]; 26 | } 27 | } 28 | return ret; 29 | } 30 | util.markAsOriginatingFromRejection(obj); 31 | return obj; 32 | } 33 | 34 | function nodebackForPromise(promise, multiArgs) { 35 | return function(err, value) { 36 | if (promise === null) return; 37 | if (err) { 38 | var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); 39 | promise._attachExtraTrace(wrapped); 40 | promise._reject(wrapped); 41 | } else if (!multiArgs) { 42 | promise._fulfill(value); 43 | } else { 44 | var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; 45 | promise._fulfill(args); 46 | } 47 | promise = null; 48 | }; 49 | } 50 | 51 | module.exports = nodebackForPromise; 52 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/nodeify.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise) { 3 | var util = require("./util"); 4 | var async = Promise._async; 5 | var tryCatch = util.tryCatch; 6 | var errorObj = util.errorObj; 7 | 8 | function spreadAdapter(val, nodeback) { 9 | var promise = this; 10 | if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); 11 | var ret = 12 | tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); 13 | if (ret === errorObj) { 14 | async.throwLater(ret.e); 15 | } 16 | } 17 | 18 | function successAdapter(val, nodeback) { 19 | var promise = this; 20 | var receiver = promise._boundValue(); 21 | var ret = val === undefined 22 | ? tryCatch(nodeback).call(receiver, null) 23 | : tryCatch(nodeback).call(receiver, null, val); 24 | if (ret === errorObj) { 25 | async.throwLater(ret.e); 26 | } 27 | } 28 | function errorAdapter(reason, nodeback) { 29 | var promise = this; 30 | if (!reason) { 31 | var newReason = new Error(reason + ""); 32 | newReason.cause = reason; 33 | reason = newReason; 34 | } 35 | var ret = tryCatch(nodeback).call(promise._boundValue(), reason); 36 | if (ret === errorObj) { 37 | async.throwLater(ret.e); 38 | } 39 | } 40 | 41 | Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, 42 | options) { 43 | if (typeof nodeback == "function") { 44 | var adapter = successAdapter; 45 | if (options !== undefined && Object(options).spread) { 46 | adapter = spreadAdapter; 47 | } 48 | this._then( 49 | adapter, 50 | errorAdapter, 51 | undefined, 52 | this, 53 | nodeback 54 | ); 55 | } 56 | return this; 57 | }; 58 | }; 59 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/queue.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function arrayMove(src, srcIndex, dst, dstIndex, len) { 3 | for (var j = 0; j < len; ++j) { 4 | dst[j + dstIndex] = src[j + srcIndex]; 5 | src[j + srcIndex] = void 0; 6 | } 7 | } 8 | 9 | function Queue(capacity) { 10 | this._capacity = capacity; 11 | this._length = 0; 12 | this._front = 0; 13 | } 14 | 15 | Queue.prototype._willBeOverCapacity = function (size) { 16 | return this._capacity < size; 17 | }; 18 | 19 | Queue.prototype._pushOne = function (arg) { 20 | var length = this.length(); 21 | this._checkCapacity(length + 1); 22 | var i = (this._front + length) & (this._capacity - 1); 23 | this[i] = arg; 24 | this._length = length + 1; 25 | }; 26 | 27 | Queue.prototype.push = function (fn, receiver, arg) { 28 | var length = this.length() + 3; 29 | if (this._willBeOverCapacity(length)) { 30 | this._pushOne(fn); 31 | this._pushOne(receiver); 32 | this._pushOne(arg); 33 | return; 34 | } 35 | var j = this._front + length - 3; 36 | this._checkCapacity(length); 37 | var wrapMask = this._capacity - 1; 38 | this[(j + 0) & wrapMask] = fn; 39 | this[(j + 1) & wrapMask] = receiver; 40 | this[(j + 2) & wrapMask] = arg; 41 | this._length = length; 42 | }; 43 | 44 | Queue.prototype.shift = function () { 45 | var front = this._front, 46 | ret = this[front]; 47 | 48 | this[front] = undefined; 49 | this._front = (front + 1) & (this._capacity - 1); 50 | this._length--; 51 | return ret; 52 | }; 53 | 54 | Queue.prototype.length = function () { 55 | return this._length; 56 | }; 57 | 58 | Queue.prototype._checkCapacity = function (size) { 59 | if (this._capacity < size) { 60 | this._resizeTo(this._capacity << 1); 61 | } 62 | }; 63 | 64 | Queue.prototype._resizeTo = function (capacity) { 65 | var oldCapacity = this._capacity; 66 | this._capacity = capacity; 67 | var front = this._front; 68 | var length = this._length; 69 | var moveItemsCount = (front + length) & (oldCapacity - 1); 70 | arrayMove(this, 0, this, oldCapacity, moveItemsCount); 71 | }; 72 | 73 | module.exports = Queue; 74 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/race.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function( 3 | Promise, INTERNAL, tryConvertToPromise, apiRejection) { 4 | var util = require("./util"); 5 | 6 | var raceLater = function (promise) { 7 | return promise.then(function(array) { 8 | return race(array, promise); 9 | }); 10 | }; 11 | 12 | function race(promises, parent) { 13 | var maybePromise = tryConvertToPromise(promises); 14 | 15 | if (maybePromise instanceof Promise) { 16 | return raceLater(maybePromise); 17 | } else { 18 | promises = util.asArray(promises); 19 | if (promises === null) 20 | return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); 21 | } 22 | 23 | var ret = new Promise(INTERNAL); 24 | if (parent !== undefined) { 25 | ret._propagateFrom(parent, 3); 26 | } 27 | var fulfill = ret._fulfill; 28 | var reject = ret._reject; 29 | for (var i = 0, len = promises.length; i < len; ++i) { 30 | var val = promises[i]; 31 | 32 | if (val === undefined && !(i in promises)) { 33 | continue; 34 | } 35 | 36 | Promise.cast(val)._then(fulfill, reject, undefined, ret, null); 37 | } 38 | return ret; 39 | } 40 | 41 | Promise.race = function (promises) { 42 | return race(promises, undefined); 43 | }; 44 | 45 | Promise.prototype.race = function () { 46 | return race(this, undefined); 47 | }; 48 | 49 | }; 50 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/schedule.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var util = require("./util"); 3 | var schedule; 4 | var noAsyncScheduler = function() { 5 | throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); 6 | }; 7 | var NativePromise = util.getNativePromise(); 8 | if (util.isNode && typeof MutationObserver === "undefined") { 9 | var GlobalSetImmediate = global.setImmediate; 10 | var ProcessNextTick = process.nextTick; 11 | schedule = util.isRecentNode 12 | ? function(fn) { GlobalSetImmediate.call(global, fn); } 13 | : function(fn) { ProcessNextTick.call(process, fn); }; 14 | } else if (typeof NativePromise === "function" && 15 | typeof NativePromise.resolve === "function") { 16 | var nativePromise = NativePromise.resolve(); 17 | schedule = function(fn) { 18 | nativePromise.then(fn); 19 | }; 20 | } else if ((typeof MutationObserver !== "undefined") && 21 | !(typeof window !== "undefined" && 22 | window.navigator && 23 | (window.navigator.standalone || window.cordova))) { 24 | schedule = (function() { 25 | var div = document.createElement("div"); 26 | var opts = {attributes: true}; 27 | var toggleScheduled = false; 28 | var div2 = document.createElement("div"); 29 | var o2 = new MutationObserver(function() { 30 | div.classList.toggle("foo"); 31 | toggleScheduled = false; 32 | }); 33 | o2.observe(div2, opts); 34 | 35 | var scheduleToggle = function() { 36 | if (toggleScheduled) return; 37 | toggleScheduled = true; 38 | div2.classList.toggle("foo"); 39 | }; 40 | 41 | return function schedule(fn) { 42 | var o = new MutationObserver(function() { 43 | o.disconnect(); 44 | fn(); 45 | }); 46 | o.observe(div, opts); 47 | scheduleToggle(); 48 | }; 49 | })(); 50 | } else if (typeof setImmediate !== "undefined") { 51 | schedule = function (fn) { 52 | setImmediate(fn); 53 | }; 54 | } else if (typeof setTimeout !== "undefined") { 55 | schedule = function (fn) { 56 | setTimeout(fn, 0); 57 | }; 58 | } else { 59 | schedule = noAsyncScheduler; 60 | } 61 | module.exports = schedule; 62 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/settle.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = 3 | function(Promise, PromiseArray, debug) { 4 | var PromiseInspection = Promise.PromiseInspection; 5 | var util = require("./util"); 6 | 7 | function SettledPromiseArray(values) { 8 | this.constructor$(values); 9 | } 10 | util.inherits(SettledPromiseArray, PromiseArray); 11 | 12 | SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { 13 | this._values[index] = inspection; 14 | var totalResolved = ++this._totalResolved; 15 | if (totalResolved >= this._length) { 16 | this._resolve(this._values); 17 | return true; 18 | } 19 | return false; 20 | }; 21 | 22 | SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { 23 | var ret = new PromiseInspection(); 24 | ret._bitField = 33554432; 25 | ret._settledValueField = value; 26 | return this._promiseResolved(index, ret); 27 | }; 28 | SettledPromiseArray.prototype._promiseRejected = function (reason, index) { 29 | var ret = new PromiseInspection(); 30 | ret._bitField = 16777216; 31 | ret._settledValueField = reason; 32 | return this._promiseResolved(index, ret); 33 | }; 34 | 35 | Promise.settle = function (promises) { 36 | debug.deprecated(".settle()", ".reflect()"); 37 | return new SettledPromiseArray(promises).promise(); 38 | }; 39 | 40 | Promise.prototype.settle = function () { 41 | return Promise.settle(this); 42 | }; 43 | }; 44 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/thenables.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise, INTERNAL) { 3 | var util = require("./util"); 4 | var errorObj = util.errorObj; 5 | var isObject = util.isObject; 6 | 7 | function tryConvertToPromise(obj, context) { 8 | if (isObject(obj)) { 9 | if (obj instanceof Promise) return obj; 10 | var then = getThen(obj); 11 | if (then === errorObj) { 12 | if (context) context._pushContext(); 13 | var ret = Promise.reject(then.e); 14 | if (context) context._popContext(); 15 | return ret; 16 | } else if (typeof then === "function") { 17 | if (isAnyBluebirdPromise(obj)) { 18 | var ret = new Promise(INTERNAL); 19 | obj._then( 20 | ret._fulfill, 21 | ret._reject, 22 | undefined, 23 | ret, 24 | null 25 | ); 26 | return ret; 27 | } 28 | return doThenable(obj, then, context); 29 | } 30 | } 31 | return obj; 32 | } 33 | 34 | function doGetThen(obj) { 35 | return obj.then; 36 | } 37 | 38 | function getThen(obj) { 39 | try { 40 | return doGetThen(obj); 41 | } catch (e) { 42 | errorObj.e = e; 43 | return errorObj; 44 | } 45 | } 46 | 47 | var hasProp = {}.hasOwnProperty; 48 | function isAnyBluebirdPromise(obj) { 49 | try { 50 | return hasProp.call(obj, "_promise0"); 51 | } catch (e) { 52 | return false; 53 | } 54 | } 55 | 56 | function doThenable(x, then, context) { 57 | var promise = new Promise(INTERNAL); 58 | var ret = promise; 59 | if (context) context._pushContext(); 60 | promise._captureStackTrace(); 61 | if (context) context._popContext(); 62 | var synchronous = true; 63 | var result = util.tryCatch(then).call(x, resolve, reject); 64 | synchronous = false; 65 | 66 | if (promise && result === errorObj) { 67 | promise._rejectCallback(result.e, true, true); 68 | promise = null; 69 | } 70 | 71 | function resolve(value) { 72 | if (!promise) return; 73 | promise._resolveCallback(value); 74 | promise = null; 75 | } 76 | 77 | function reject(reason) { 78 | if (!promise) return; 79 | promise._rejectCallback(reason, synchronous, true); 80 | promise = null; 81 | } 82 | return ret; 83 | } 84 | 85 | return tryConvertToPromise; 86 | }; 87 | -------------------------------------------------------------------------------- /node_modules/bluebird/js/release/timers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = function(Promise, INTERNAL, debug) { 3 | var util = require("./util"); 4 | var TimeoutError = Promise.TimeoutError; 5 | 6 | function HandleWrapper(handle) { 7 | this.handle = handle; 8 | } 9 | 10 | HandleWrapper.prototype._resultCancelled = function() { 11 | clearTimeout(this.handle); 12 | }; 13 | 14 | var afterValue = function(value) { return delay(+this).thenReturn(value); }; 15 | var delay = Promise.delay = function (ms, value) { 16 | var ret; 17 | var handle; 18 | if (value !== undefined) { 19 | ret = Promise.resolve(value) 20 | ._then(afterValue, null, null, ms, undefined); 21 | if (debug.cancellation() && value instanceof Promise) { 22 | ret._setOnCancel(value); 23 | } 24 | } else { 25 | ret = new Promise(INTERNAL); 26 | handle = setTimeout(function() { ret._fulfill(); }, +ms); 27 | if (debug.cancellation()) { 28 | ret._setOnCancel(new HandleWrapper(handle)); 29 | } 30 | ret._captureStackTrace(); 31 | } 32 | ret._setAsyncGuaranteed(); 33 | return ret; 34 | }; 35 | 36 | Promise.prototype.delay = function (ms) { 37 | return delay(ms, this); 38 | }; 39 | 40 | var afterTimeout = function (promise, message, parent) { 41 | var err; 42 | if (typeof message !== "string") { 43 | if (message instanceof Error) { 44 | err = message; 45 | } else { 46 | err = new TimeoutError("operation timed out"); 47 | } 48 | } else { 49 | err = new TimeoutError(message); 50 | } 51 | util.markAsOriginatingFromRejection(err); 52 | promise._attachExtraTrace(err); 53 | promise._reject(err); 54 | 55 | if (parent != null) { 56 | parent.cancel(); 57 | } 58 | }; 59 | 60 | function successClear(value) { 61 | clearTimeout(this.handle); 62 | return value; 63 | } 64 | 65 | function failureClear(reason) { 66 | clearTimeout(this.handle); 67 | throw reason; 68 | } 69 | 70 | Promise.prototype.timeout = function (ms, message) { 71 | ms = +ms; 72 | var ret, parent; 73 | 74 | var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { 75 | if (ret.isPending()) { 76 | afterTimeout(ret, message, parent); 77 | } 78 | }, ms)); 79 | 80 | if (debug.cancellation()) { 81 | parent = this.then(); 82 | ret = parent._then(successClear, failureClear, 83 | undefined, handleWrapper, undefined); 84 | ret._setOnCancel(handleWrapper); 85 | } else { 86 | ret = this._then(successClear, failureClear, 87 | undefined, handleWrapper, undefined); 88 | } 89 | 90 | return ret; 91 | }; 92 | 93 | }; 94 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/.npmignore: -------------------------------------------------------------------------------- 1 | benchmark/versions/ 2 | node_modules 3 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.9 5 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/README.md: -------------------------------------------------------------------------------- 1 | # buffer-writer 2 | 3 | [![Build Status](https://secure.travis-ci.org/brianc/node-buffer-writer.png?branch=master)](http://travis-ci.org/brianc/node-buffer-writer) 4 | 5 | Fast & efficient buffer writer used to keep memory usage low by internally recycling a single large buffer. 6 | 7 | Used as the binary protocol writer in [node-postgres](https://github.com/brianc/node-postgres) 8 | 9 | Since postgres requires big endian encoding, this only writes big endian numbers for now, but can & probably will easily be extended to write little endian as well. 10 | 11 | I'll admit this has a few postgres specific things I might need to take out in the future, such as `addHeader` 12 | 13 | ## api 14 | 15 | `var writer = new (require('buffer-writer')());` 16 | 17 | ### writer.addInt32(num) 18 | 19 | Writes a 4-byte big endian binary encoded number to the end of the buffer. 20 | 21 | ### writer.addInt16(num) 22 | 23 | Writes a 2-byte big endian binary encoded number to the end of the buffer. 24 | 25 | ### writer.addCString(string) 26 | 27 | Writes a string to the buffer `utf8` encoded and adds a null character (`\0`) at the end. 28 | 29 | ### var buffer = writer.addHeader(char) 30 | 31 | Writes the 5 byte PostgreSQL required header to the beginning of the buffer. (1 byte for character, 1 BE Int32 for length of the buffer) 32 | 33 | ### var buffer = writer.join() 34 | 35 | Collects all data in the writer and joins it into a single, new buffer. 36 | 37 | ### var buffer = writer.flush(char) 38 | 39 | Writes the 5 byte postgres required message header, collects all data in the writer and joins it into a single, new buffer, and then resets the writer. 40 | 41 | ## thoughts 42 | 43 | This is kind of node-postgres specific. If you're interested in using this for a more general purpose thing, lemme know. 44 | I would love to work with you on getting this more reusable for your needs. 45 | 46 | ## license 47 | 48 | MIT 49 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/benchmark/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | 4 | var bench = require('bench'); 5 | var async = require('async'); 6 | var rmdir = require('rmdir'); 7 | var ok = require('okay'); 8 | var cloned = require('cloned'); 9 | cloned.workingDir = __dirname + '/versions'; 10 | 11 | exports.compare = { 12 | 'math': function() { 13 | var two = 1 + 1; 14 | }, 15 | 'another': function() { 16 | var yay = 2 + 2; 17 | } 18 | }; 19 | 20 | var clone = function(rev, cb) { 21 | var outputDir = path.join(cloned.workingDir, rev); 22 | console.log(outputDir) 23 | if(fs.existsSync(outputDir)) { 24 | return cb(null, { 25 | rev: rev, 26 | dir: outputDir 27 | }); 28 | } 29 | console.log('cloning version ' + rev); 30 | cloned(rev, ok(cb, function(dir) { 31 | console.log('cloned version ' + rev + ' to ' + dir); 32 | cb(null, { 33 | rev: rev, 34 | dir: dir 35 | }); 36 | })); 37 | }; 38 | 39 | var versions = [ 40 | 'ef599d3' 41 | ]; 42 | 43 | var scripts = fs.readdirSync(__dirname).filter(function(x) { 44 | return x.indexOf('benchmark') > 0; 45 | }); 46 | 47 | if(process.argv[2]) { 48 | scripts = [process.argv[2]] 49 | } 50 | 51 | 52 | var run = function() { 53 | async.map(versions, clone, function(err, results) { 54 | if(err) throw err; 55 | exports.compare = { }; 56 | var suites = []; 57 | scripts.forEach(function(script) { 58 | for(var i = 0; i < results.length; i++) { 59 | var result = results[i]; 60 | var benchPath = path.join(result.dir, 'benchmark', script); 61 | var suite = {}; 62 | suites.push(suite); 63 | if(fs.existsSync(benchPath)) { 64 | var bench = require(benchPath); 65 | suite[script + '@' + result.rev] = bench; 66 | } else { 67 | console.log('%s missing at revision %s', benchPath, result.rev); 68 | } 69 | } 70 | suite[script + '@HEAD'] = require(__dirname + '/' + script); 71 | }); 72 | var compare = function(suite, cb) { 73 | console.log('running...') 74 | bench.compare(suite, null, null, null, function(err, data) { 75 | if(err) return cb(err); 76 | bench.show(data); 77 | cb(null); 78 | }); 79 | } 80 | async.eachSeries(suites, compare, function(err, res) { 81 | console.log('all suites done') 82 | }) 83 | }); 84 | }; 85 | 86 | run(); 87 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/benchmark/int-16-benchmark.js: -------------------------------------------------------------------------------- 1 | var Writer = require(__dirname + '/../'); 2 | 3 | module.exports = function() { 4 | var writer = new Writer(); 5 | writer.addInt16(-100000000); 6 | writer.addInt16(-1000); 7 | writer.addInt16(-1); 8 | writer.addInt16(0); 9 | writer.addInt16(1); 10 | writer.addInt16(1000); 11 | writer.addInt16(1000000000); 12 | writer.addInt16(-100000000); 13 | writer.addInt16(-100000000); 14 | writer.addInt16(-1000); 15 | writer.addInt16(-1); 16 | writer.addInt16(0); 17 | writer.addInt16(1); 18 | writer.addInt16(1000); 19 | writer.addInt16(1000000000); 20 | writer.addInt16(-1000); 21 | writer.addInt16(-1); 22 | writer.addInt16(0); 23 | writer.addInt16(1); 24 | writer.addInt16(1000); 25 | writer.addInt16(1000000000); 26 | }; 27 | 28 | if(!module.parent) { 29 | module.exports(); 30 | console.log('benchmark ok'); 31 | } 32 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/benchmark/int-32-benchmark.js: -------------------------------------------------------------------------------- 1 | var Writer = require(__dirname + '/../'); 2 | 3 | module.exports = function() { 4 | var writer = new Writer(); 5 | writer.addInt32(-10000000000000); 6 | writer.addInt32(-1000); 7 | writer.addInt32(-1); 8 | writer.addInt32(0); 9 | writer.addInt32(1); 10 | writer.addInt32(1000); 11 | writer.addInt32(10000000000000); 12 | }; 13 | 14 | if(!module.parent) { 15 | module.exports(); 16 | console.log('benchmark ok'); 17 | } 18 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/benchmark/join-benchmark.js: -------------------------------------------------------------------------------- 1 | var Writer = require(__dirname + '/../'); 2 | 3 | var writer = new Writer(); 4 | writer.addCString('hello'); 5 | writer.addCString('something else, really'); 6 | writer.addInt32(38013); 7 | writer.addCString('and that\'s all she wrote, folks\n...\n...not really'); 8 | 9 | module.exports = function() { 10 | writer.join(0x50); 11 | }; 12 | 13 | if(!module.parent) { 14 | module.exports(); 15 | console.log('benchmark ok'); 16 | } 17 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/benchmark/resize-benchmark.js: -------------------------------------------------------------------------------- 1 | var Writer = require(__dirname + '/../'); 2 | 3 | var string = ""; 4 | for(var i = 0; i < 10; i++) { 5 | string += 'Once upon a time long ago there lived a little programming language named JavaScript'; 6 | } 7 | 8 | module.exports = function() { 9 | var writer = new Writer(4); 10 | writer.addCString(string); 11 | writer.addCString(string); 12 | writer.addCString(string); 13 | writer.addCString(string); 14 | writer.addCString(string); 15 | writer.addCString(string); 16 | writer.addCString(string); 17 | writer.addCString(string); 18 | }; 19 | 20 | if(!module.parent) { 21 | module.exports(); 22 | console.log('benchmark ok'); 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/benchmark/small-benchmark.js: -------------------------------------------------------------------------------- 1 | var Writer = require(__dirname + '/../'); 2 | 3 | module.exports = function() { 4 | var writer = new Writer(); 5 | writer.addInt32(10); 6 | writer.addInt16(5); 7 | writer.addCString('test'); 8 | writer.flush('X'); 9 | }; 10 | 11 | if(!module.parent) { 12 | module.exports(); 13 | console.log('benchmark ok'); 14 | } 15 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "buffer-writer@1.0.1", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg" 6 | ] 7 | ], 8 | "_from": "buffer-writer@1.0.1", 9 | "_id": "buffer-writer@1.0.1", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/buffer-writer", 13 | "_nodeVersion": "5.5.0", 14 | "_npmOperationalInternal": { 15 | "host": "packages-5-east.internal.npmjs.com", 16 | "tmp": "tmp/buffer-writer-1.0.1.tgz_1455554615929_0.2564993395935744" 17 | }, 18 | "_npmUser": { 19 | "email": "brian.m.carlson@gmail.com", 20 | "name": "brianc" 21 | }, 22 | "_npmVersion": "3.3.12", 23 | "_phantomChildren": {}, 24 | "_requested": { 25 | "name": "buffer-writer", 26 | "raw": "buffer-writer@1.0.1", 27 | "rawSpec": "1.0.1", 28 | "scope": null, 29 | "spec": "1.0.1", 30 | "type": "version" 31 | }, 32 | "_requiredBy": [ 33 | "/pg" 34 | ], 35 | "_resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz", 36 | "_shasum": "22a936901e3029afcd7547eb4487ceb697a3bf08", 37 | "_shrinkwrap": null, 38 | "_spec": "buffer-writer@1.0.1", 39 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg", 40 | "author": { 41 | "name": "Brian M. Carlson" 42 | }, 43 | "bugs": { 44 | "url": "https://github.com/brianc/node-buffer-writer/issues" 45 | }, 46 | "dependencies": {}, 47 | "description": "a fast, efficient buffer writer", 48 | "devDependencies": { 49 | "async": "~0.2.6", 50 | "bench": "~0.3.5", 51 | "benchmark": "~1.0.0", 52 | "cloned": "0.0.1", 53 | "microtime": "~0.3.3", 54 | "mocha": "~1.8.1", 55 | "okay": "0.0.2", 56 | "rmdir": "~1.0.0" 57 | }, 58 | "directories": {}, 59 | "dist": { 60 | "shasum": "22a936901e3029afcd7547eb4487ceb697a3bf08", 61 | "tarball": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz" 62 | }, 63 | "gitHead": "d7c48cb142d87d76662954359bf1abcd25144329", 64 | "homepage": "https://github.com/brianc/node-buffer-writer#readme", 65 | "keywords": [ 66 | "buffer", 67 | "writer", 68 | "builder" 69 | ], 70 | "license": "MIT", 71 | "main": "index.js", 72 | "maintainers": [ 73 | { 74 | "email": "brian.m.carlson@gmail.com", 75 | "name": "brianc" 76 | } 77 | ], 78 | "name": "buffer-writer", 79 | "optionalDependencies": {}, 80 | "readme": "ERROR: No README data found!", 81 | "repository": { 82 | "type": "git", 83 | "url": "git://github.com/brianc/node-buffer-writer.git" 84 | }, 85 | "scripts": { 86 | "test": "mocha" 87 | }, 88 | "version": "1.0.1" 89 | } 90 | -------------------------------------------------------------------------------- /node_modules/buffer-writer/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --ui tdd 2 | -------------------------------------------------------------------------------- /node_modules/commander/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2011 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/commander/node_modules/graceful-readlink/.npmignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .DS_Store 3 | node_modules/ 4 | -------------------------------------------------------------------------------- /node_modules/commander/node_modules/graceful-readlink/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.12" 5 | - "io.js" 6 | -------------------------------------------------------------------------------- /node_modules/commander/node_modules/graceful-readlink/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Zhiye Li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /node_modules/commander/node_modules/graceful-readlink/README.md: -------------------------------------------------------------------------------- 1 | # graceful-readlink 2 | [![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink) 3 | [![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink) 4 | 5 | 6 | ## Usage 7 | 8 | ```js 9 | var readlinkSync = require('graceful-readlink').readlinkSync; 10 | console.log(readlinkSync(f)); 11 | // output 12 | // the file pointed to when `f` is a symbolic link 13 | // the `f` itself when `f` is not a symbolic link 14 | ``` 15 | ## Licence 16 | 17 | MIT License 18 | -------------------------------------------------------------------------------- /node_modules/commander/node_modules/graceful-readlink/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs') 2 | , lstat = fs.lstatSync; 3 | 4 | exports.readlinkSync = function (p) { 5 | if (lstat(p).isSymbolicLink()) { 6 | return fs.readlinkSync(p); 7 | } else { 8 | return p; 9 | } 10 | }; 11 | 12 | 13 | -------------------------------------------------------------------------------- /node_modules/commander/node_modules/graceful-readlink/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graceful-readlink", 3 | "version": "1.0.1", 4 | "description": "graceful fs.readlink", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/zhiyelee/graceful-readlink.git" 9 | }, 10 | "homepage": "https://github.com/zhiyelee/graceful-readlink", 11 | "bugs": { 12 | "url": "https://github.com/zhiyelee/graceful-readlink/issues" 13 | }, 14 | "keywords": [ 15 | "fs.readlink", 16 | "readlink" 17 | ], 18 | "author": { 19 | "name": "zhiyelee" 20 | }, 21 | "license": "MIT", 22 | "scripts": { 23 | "test": "echo \"Error: no test specified\" && exit 1" 24 | }, 25 | "gitHead": "f6655275bebef706fb63fd01b5f062a7052419a5", 26 | "_id": "graceful-readlink@1.0.1", 27 | "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", 28 | "_from": "graceful-readlink@>=1.0.0", 29 | "_npmVersion": "2.1.17", 30 | "_nodeVersion": "0.11.14", 31 | "_npmUser": { 32 | "name": "zhiyelee", 33 | "email": "zhiyelee@gmail.com" 34 | }, 35 | "maintainers": [ 36 | { 37 | "name": "zhiyelee", 38 | "email": "zhiyelee@gmail.com" 39 | } 40 | ], 41 | "dist": { 42 | "shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", 43 | "tarball": "http://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" 44 | }, 45 | "directories": {}, 46 | "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", 47 | "readme": "ERROR: No README data found!" 48 | } 49 | -------------------------------------------------------------------------------- /node_modules/commander/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "commander", 3 | "version": "2.9.0", 4 | "description": "the complete solution for node.js command-line programs", 5 | "keywords": [ 6 | "command", 7 | "option", 8 | "parser" 9 | ], 10 | "author": { 11 | "name": "TJ Holowaychuk", 12 | "email": "tj@vision-media.ca" 13 | }, 14 | "license": "MIT", 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/tj/commander.js.git" 18 | }, 19 | "devDependencies": { 20 | "should": ">= 0.0.1", 21 | "sinon": ">=1.17.1" 22 | }, 23 | "scripts": { 24 | "test": "make test" 25 | }, 26 | "main": "index", 27 | "engines": { 28 | "node": ">= 0.6.x" 29 | }, 30 | "files": [ 31 | "index.js" 32 | ], 33 | "dependencies": { 34 | "graceful-readlink": ">= 1.0.0" 35 | }, 36 | "gitHead": "b2aad7a8471d434593a85306aa73777a526e9f75", 37 | "bugs": { 38 | "url": "https://github.com/tj/commander.js/issues" 39 | }, 40 | "homepage": "https://github.com/tj/commander.js#readme", 41 | "_id": "commander@2.9.0", 42 | "_shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", 43 | "_from": "commander@*", 44 | "_npmVersion": "2.11.3", 45 | "_nodeVersion": "0.12.7", 46 | "_npmUser": { 47 | "name": "zhiyelee", 48 | "email": "zhiyelee@gmail.com" 49 | }, 50 | "dist": { 51 | "shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", 52 | "tarball": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz" 53 | }, 54 | "maintainers": [ 55 | { 56 | "name": "tjholowaychuk", 57 | "email": "tj@vision-media.ca" 58 | }, 59 | { 60 | "name": "somekittens", 61 | "email": "rkoutnik@gmail.com" 62 | }, 63 | { 64 | "name": "zhiyelee", 65 | "email": "zhiyelee@gmail.com" 66 | } 67 | ], 68 | "directories": {}, 69 | "_resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz" 70 | } 71 | -------------------------------------------------------------------------------- /node_modules/generic-pool/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "plugins": [ 4 | "standard" 5 | ] 6 | }; -------------------------------------------------------------------------------- /node_modules/generic-pool/.npmignore: -------------------------------------------------------------------------------- 1 | fabfile.pyc 2 | node-pool.iml 3 | node-pool.tmproj 4 | node_modules 5 | -------------------------------------------------------------------------------- /node_modules/generic-pool/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.6" 4 | - "0.8" 5 | - "0.10" 6 | - "0.12" 7 | - "4" 8 | - "5" 9 | 10 | install: 11 | - make install 12 | - make lint-install 13 | 14 | script: 15 | - make lint 16 | - make test 17 | 18 | sudo: false 19 | 20 | matrix: 21 | fast_finish: true 22 | -------------------------------------------------------------------------------- /node_modules/generic-pool/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean install check test lint-install lint 2 | 3 | INCOMPATIBLE_ESLINT_VERSIONS=$(shell node --version | egrep 'v0.[2-9]' | cut -d '.' -f 1-2) 4 | 5 | all: 6 | 7 | clean: 8 | rm -rf node_modules 9 | 10 | install: 11 | npm install 12 | 13 | check: 14 | npm test 15 | 16 | test: 17 | npm test 18 | 19 | lint-install: 20 | ifeq ($(INCOMPATIBLE_ESLINT_VERSIONS),) 21 | npm run lint-install 22 | else 23 | @echo "Lint not available on $(INCOMPATIBLE_ESLINT_VERSIONS)" 24 | endif 25 | 26 | lint: 27 | ifeq ($(INCOMPATIBLE_ESLINT_VERSIONS),) 28 | npm run lint 29 | else 30 | @echo "Lint not available on $(INCOMPATIBLE_ESLINT_VERSIONS)" 31 | endif 32 | -------------------------------------------------------------------------------- /node_modules/generic-pool/fabfile.py: -------------------------------------------------------------------------------- 1 | # 2 | # dependencies: 3 | # fabric (apt-get install fabric) 4 | # node-jslint (http://github.com/reid/node-jslint) 5 | # expresso (or replace with whatever node.js test tool you're using) 6 | # 7 | 8 | from fabric.api import local 9 | import os, os.path 10 | 11 | def test(): 12 | local('expresso -I lib test/*', capture=False) 13 | 14 | def jslint(): 15 | ignore = [ "/lib-cov/" ] 16 | for root, subFolders, files in os.walk("."): 17 | for file in files: 18 | if file.endswith(".js"): 19 | filename = os.path.join(root,file) 20 | processFile = True 21 | for i in ignore: 22 | if filename.find(i) != -1: 23 | processFile = False 24 | if processFile: 25 | print filename 26 | local('jslint %s' % filename, capture=False) 27 | 28 | -------------------------------------------------------------------------------- /node_modules/migrate/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "support/should"] 2 | path = support/should 3 | url = git://github.com/visionmedia/should.js.git 4 | -------------------------------------------------------------------------------- /node_modules/migrate/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /node_modules/migrate/History.md: -------------------------------------------------------------------------------- 1 | 0.2.1 / 2015-04-24 2 | ================== 3 | 4 | * Ability to use a custom template file 5 | * Expose easy api for programmatic use 6 | * State is now saved after each successful migration 7 | * Proper tests with `mocha` 8 | * Add `use strict` to the template 9 | 10 | 0.2.0 / 2014-12-26 11 | ================== 12 | 13 | * Report errors on migration next 14 | * The name format of migrations is now timestamp-based instead of numerical 15 | * Remove inner library version 16 | 17 | 0.1.6 / 2014-10-28 18 | ================== 19 | 20 | * Fix paths for windows users 21 | * Added command line option --state-file (to set the location of the migration state file) 22 | 23 | 0.1.3 / 2012-06-25 24 | ================== 25 | 26 | * Update migrate to support v0.8.x 27 | 28 | 0.1.2 / 2012-03-15 29 | ================== 30 | 31 | * 0.7.x support 32 | 33 | 0.1.1 / 2011-12-04 34 | ================== 35 | 36 | * Fixed a typo [kishorenc] 37 | 38 | 0.1.0 / 2011-12-03 39 | ================== 40 | 41 | * Added support for incremental migrations. [Kishore Nallan] 42 | 43 | 0.0.5 / 2011-11-07 44 | ================== 45 | 46 | * 0.6.0 support 47 | 48 | 0.0.4 / 2011-09-12 49 | ================== 50 | 51 | * Fixed: load js files only [aheckmann] 52 | 53 | 0.0.3 / 2011-09-09 54 | ================== 55 | 56 | * Fixed initial `create` support 57 | 58 | 0.0.2 / 2011-09-09 59 | ================== 60 | 61 | * Fixed `make test` 62 | 63 | 0.0.1 / 2011-04-24 64 | ================== 65 | 66 | * Initial release 67 | -------------------------------------------------------------------------------- /node_modules/migrate/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @node test/test.migrate.js 4 | 5 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/migrate/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/migrate'); -------------------------------------------------------------------------------- /node_modules/migrate/lib/migrate.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * migrate 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Set = require('./set') 13 | , path = require('path') 14 | , fs = require('fs'); 15 | 16 | /** 17 | * Expose the migrate function. 18 | */ 19 | 20 | exports = module.exports = migrate; 21 | 22 | function migrate(title, up, down) { 23 | // migration 24 | if ('string' == typeof title && up && down) { 25 | migrate.set.addMigration(title, up, down); 26 | // specify migration file 27 | } else if ('string' == typeof title) { 28 | migrate.set = new Set(title); 29 | // no migration path 30 | } else if (!migrate.set) { 31 | throw new Error('must invoke migrate(path) before running migrations'); 32 | // run migrations 33 | } else { 34 | return migrate.set; 35 | } 36 | } 37 | 38 | exports.load = function (stateFile, migrationsDirectory) { 39 | 40 | var set = new Set(stateFile); 41 | var dir = path.resolve(migrationsDirectory); 42 | 43 | fs.readdirSync(dir).filter(function(file){ 44 | return file.match(/^\d+.*\.js$/); 45 | }).sort().forEach(function (file) { 46 | var mod = require(path.join(dir, file)); 47 | set.addMigration(file, mod.up, mod.down); 48 | }); 49 | 50 | return set; 51 | }; 52 | -------------------------------------------------------------------------------- /node_modules/migrate/lib/migration.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * migrate - Migration 4 | * Copyright (c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Expose `Migration`. 10 | */ 11 | 12 | module.exports = Migration; 13 | 14 | function Migration(title, up, down) { 15 | this.title = title; 16 | this.up = up; 17 | this.down = down; 18 | } -------------------------------------------------------------------------------- /node_modules/migrate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "migrate", 3 | "version": "0.2.2", 4 | "description": "Abstract migration framework for node", 5 | "keywords": [ 6 | "migrate", 7 | "migrations" 8 | ], 9 | "author": { 10 | "name": "TJ Holowaychuk", 11 | "email": "tj@vision-media.ca" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/visionmedia/node-migrate.git" 16 | }, 17 | "bin": { 18 | "migrate": "./bin/migrate" 19 | }, 20 | "devDependencies": { 21 | "mocha": "^2.2.1" 22 | }, 23 | "main": "index", 24 | "engines": { 25 | "node": ">= 0.4.x" 26 | }, 27 | "scripts": { 28 | "test": "mocha" 29 | }, 30 | "gitHead": "65e314371d46b9a5dc841e269078f02fdbba642f", 31 | "bugs": { 32 | "url": "https://github.com/visionmedia/node-migrate/issues" 33 | }, 34 | "homepage": "https://github.com/visionmedia/node-migrate#readme", 35 | "_id": "migrate@0.2.2", 36 | "_shasum": "e796ad9bfcbe4b6b73ff9c9a0d355e5e56073aac", 37 | "_from": "migrate@*", 38 | "_npmVersion": "2.12.1", 39 | "_nodeVersion": "0.12.6", 40 | "_npmUser": { 41 | "name": "linusu", 42 | "email": "linus@folkdatorn.se" 43 | }, 44 | "dist": { 45 | "shasum": "e796ad9bfcbe4b6b73ff9c9a0d355e5e56073aac", 46 | "tarball": "http://registry.npmjs.org/migrate/-/migrate-0.2.2.tgz" 47 | }, 48 | "maintainers": [ 49 | { 50 | "name": "tjholowaychuk", 51 | "email": "tj@vision-media.ca" 52 | }, 53 | { 54 | "name": "joaosa", 55 | "email": "jjadonotenter@gmail.com" 56 | }, 57 | { 58 | "name": "linusu", 59 | "email": "linus@folkdatorn.se" 60 | } 61 | ], 62 | "directories": {}, 63 | "_resolved": "https://registry.npmjs.org/migrate/-/migrate-0.2.2.tgz", 64 | "readme": "ERROR: No README data found!" 65 | } 66 | -------------------------------------------------------------------------------- /node_modules/object-assign/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /* eslint-disable no-unused-vars */ 3 | var hasOwnProperty = Object.prototype.hasOwnProperty; 4 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; 5 | 6 | function toObject(val) { 7 | if (val === null || val === undefined) { 8 | throw new TypeError('Object.assign cannot be called with null or undefined'); 9 | } 10 | 11 | return Object(val); 12 | } 13 | 14 | function shouldUseNative() { 15 | try { 16 | if (!Object.assign) { 17 | return false; 18 | } 19 | 20 | // Detect buggy property enumeration order in older V8 versions. 21 | 22 | // https://bugs.chromium.org/p/v8/issues/detail?id=4118 23 | var test1 = new String('abc'); // eslint-disable-line 24 | test1[5] = 'de'; 25 | if (Object.getOwnPropertyNames(test1)[0] === '5') { 26 | return false; 27 | } 28 | 29 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 30 | var test2 = {}; 31 | for (var i = 0; i < 10; i++) { 32 | test2['_' + String.fromCharCode(i)] = i; 33 | } 34 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) { 35 | return test2[n]; 36 | }); 37 | if (order2.join('') !== '0123456789') { 38 | return false; 39 | } 40 | 41 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 42 | var test3 = {}; 43 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { 44 | test3[letter] = letter; 45 | }); 46 | if (Object.keys(Object.assign({}, test3)).join('') !== 47 | 'abcdefghijklmnopqrst') { 48 | return false; 49 | } 50 | 51 | return true; 52 | } catch (e) { 53 | // We don't expect any of the above to throw, but better to be safe. 54 | return false; 55 | } 56 | } 57 | 58 | module.exports = shouldUseNative() ? Object.assign : function (target, source) { 59 | var from; 60 | var to = toObject(target); 61 | var symbols; 62 | 63 | for (var s = 1; s < arguments.length; s++) { 64 | from = Object(arguments[s]); 65 | 66 | for (var key in from) { 67 | if (hasOwnProperty.call(from, key)) { 68 | to[key] = from[key]; 69 | } 70 | } 71 | 72 | if (Object.getOwnPropertySymbols) { 73 | symbols = Object.getOwnPropertySymbols(from); 74 | for (var i = 0; i < symbols.length; i++) { 75 | if (propIsEnumerable.call(from, symbols[i])) { 76 | to[symbols[i]] = from[symbols[i]]; 77 | } 78 | } 79 | } 80 | } 81 | 82 | return to; 83 | }; 84 | -------------------------------------------------------------------------------- /node_modules/object-assign/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/object-assign/readme.md: -------------------------------------------------------------------------------- 1 | # object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) 2 | 3 | > ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill 4 | 5 | > Ponyfill: A polyfill that doesn't overwrite the native method 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install --save object-assign 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | const objectAssign = require('object-assign'); 19 | 20 | objectAssign({foo: 0}, {bar: 1}); 21 | //=> {foo: 0, bar: 1} 22 | 23 | // multiple sources 24 | objectAssign({foo: 0}, {bar: 1}, {baz: 2}); 25 | //=> {foo: 0, bar: 1, baz: 2} 26 | 27 | // overwrites equal keys 28 | objectAssign({foo: 0}, {foo: 1}, {foo: 2}); 29 | //=> {foo: 2} 30 | 31 | // ignores null and undefined sources 32 | objectAssign({foo: 0}, null, {bar: 1}, undefined); 33 | //=> {foo: 0, bar: 1} 34 | ``` 35 | 36 | 37 | ## API 38 | 39 | ### objectAssign(target, source, [source, ...]) 40 | 41 | Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. 42 | 43 | 44 | ## Resources 45 | 46 | - [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) 47 | 48 | 49 | ## Related 50 | 51 | - [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` 52 | 53 | 54 | ## License 55 | 56 | MIT © [Sindre Sorhus](https://sindresorhus.com) 57 | -------------------------------------------------------------------------------- /node_modules/packet-reader/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/packet-reader/index.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert') 2 | 3 | var Reader = module.exports = function(options) { 4 | //TODO - remove for version 1.0 5 | if(typeof options == 'number') { 6 | options = { headerSize: options } 7 | } 8 | options = options || {} 9 | this.offset = 0 10 | this.lastChunk = false 11 | this.chunk = null 12 | this.headerSize = options.headerSize || 0 13 | this.lengthPadding = options.lengthPadding || 0 14 | this.header = null 15 | assert(this.headerSize < 2, 'pre-length header of more than 1 byte length not currently supported') 16 | } 17 | 18 | Reader.prototype.addChunk = function(chunk) { 19 | this.offset = 0 20 | this.chunk = chunk 21 | if(this.lastChunk) { 22 | this.chunk = Buffer.concat([this.lastChunk, this.chunk]) 23 | this.lastChunk = false 24 | } 25 | } 26 | 27 | Reader.prototype._save = function() { 28 | //save any unread chunks for next read 29 | if(this.offset < this.chunk.length) { 30 | this.lastChunk = this.chunk.slice(this.offset) 31 | } 32 | return false 33 | } 34 | 35 | Reader.prototype.read = function() { 36 | if(this.chunk.length < (this.headerSize + 4 + this.offset)) { 37 | return this._save() 38 | } 39 | 40 | if(this.headerSize) { 41 | this.header = this.chunk[this.offset] 42 | } 43 | 44 | //read length of next item 45 | var length = this.chunk.readUInt32BE(this.offset + this.headerSize) + this.lengthPadding 46 | 47 | //next item spans more chunks than we have 48 | var remaining = this.chunk.length - (this.offset + 4 + this.headerSize) 49 | if(length > remaining) { 50 | return this._save() 51 | } 52 | 53 | this.offset += (this.headerSize + 4) 54 | var result = this.chunk.slice(this.offset, this.offset + length) 55 | this.offset += length 56 | return result 57 | } 58 | -------------------------------------------------------------------------------- /node_modules/packet-reader/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "packet-reader@0.2.0", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg" 6 | ] 7 | ], 8 | "_from": "packet-reader@0.2.0", 9 | "_id": "packet-reader@0.2.0", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/packet-reader", 13 | "_npmUser": { 14 | "email": "brian.m.carlson@gmail.com", 15 | "name": "brianc" 16 | }, 17 | "_npmVersion": "1.4.3", 18 | "_phantomChildren": {}, 19 | "_requested": { 20 | "name": "packet-reader", 21 | "raw": "packet-reader@0.2.0", 22 | "rawSpec": "0.2.0", 23 | "scope": null, 24 | "spec": "0.2.0", 25 | "type": "version" 26 | }, 27 | "_requiredBy": [ 28 | "/pg" 29 | ], 30 | "_resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-0.2.0.tgz", 31 | "_shasum": "819df4d010b82d5ea5671f8a1a3acf039bcd7700", 32 | "_shrinkwrap": null, 33 | "_spec": "packet-reader@0.2.0", 34 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg", 35 | "author": { 36 | "name": "Brian M. Carlson" 37 | }, 38 | "bugs": { 39 | "url": "https://github.com/brianc/node-packet-parser/issues" 40 | }, 41 | "dependencies": {}, 42 | "description": "Read binary packets...", 43 | "devDependencies": { 44 | "mocha": "~1.16.2" 45 | }, 46 | "directories": { 47 | "test": "test" 48 | }, 49 | "dist": { 50 | "shasum": "819df4d010b82d5ea5671f8a1a3acf039bcd7700", 51 | "tarball": "http://registry.npmjs.org/packet-reader/-/packet-reader-0.2.0.tgz" 52 | }, 53 | "homepage": "https://github.com/brianc/node-packet-parser", 54 | "license": "MIT", 55 | "main": "index.js", 56 | "maintainers": [ 57 | { 58 | "email": "brian.m.carlson@gmail.com", 59 | "name": "brianc" 60 | } 61 | ], 62 | "name": "packet-reader", 63 | "optionalDependencies": {}, 64 | "readme": "ERROR: No README data found!", 65 | "repository": { 66 | "type": "git", 67 | "url": "git://github.com/brianc/node-packet-parser.git" 68 | }, 69 | "scripts": { 70 | "test": "mocha" 71 | }, 72 | "version": "0.2.0" 73 | } 74 | -------------------------------------------------------------------------------- /node_modules/pg-connection-string/.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Deployed apps should consider commenting this line out: 24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 25 | node_modules 26 | -------------------------------------------------------------------------------- /node_modules/pg-connection-string/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.10' 4 | -------------------------------------------------------------------------------- /node_modules/pg-connection-string/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Iced Development 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /node_modules/pg-connection-string/README.md: -------------------------------------------------------------------------------- 1 | pg-connection-string 2 | ==================== 3 | 4 | [![Build Status](https://travis-ci.org/iceddev/pg-connection-string.svg?branch=master)](https://travis-ci.org/iceddev/pg-connection-string) 5 | 6 | Functions for dealing with a PostgresSQL connection string 7 | 8 | `parse` method taken from [node-postgres](https://github.com/brianc/node-postgres.git) 9 | Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com) 10 | MIT License 11 | 12 | ## Usage 13 | 14 | ```js 15 | var parse = require('pg-connection-string').parse; 16 | 17 | var config = parse('postgres://someuser:somepassword@somehost:381/sometable') 18 | ``` 19 | -------------------------------------------------------------------------------- /node_modules/pg-connection-string/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var url = require('url'); 4 | 5 | //Parse method copied from https://github.com/brianc/node-postgres 6 | //Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com) 7 | //MIT License 8 | 9 | //parses a connection string 10 | function parse(str) { 11 | var config; 12 | //unix socket 13 | if(str.charAt(0) === '/') { 14 | config = str.split(' '); 15 | return { host: config[0], database: config[1] }; 16 | } 17 | // url parse expects spaces encoded as %20 18 | if(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) { 19 | str = encodeURI(str).replace(/\%25(\d\d)/g, "%$1"); 20 | } 21 | var result = url.parse(str, true); 22 | config = {}; 23 | 24 | if (result.query.application_name) { 25 | config.application_name = result.query.application_name; 26 | } 27 | if (result.query.fallback_application_name) { 28 | config.fallback_application_name = result.query.fallback_application_name; 29 | } 30 | 31 | config.port = result.port; 32 | if(result.protocol == 'socket:') { 33 | config.host = decodeURI(result.pathname); 34 | config.database = result.query.db; 35 | config.client_encoding = result.query.encoding; 36 | return config; 37 | } 38 | config.host = result.hostname; 39 | 40 | // result.pathname is not always guaranteed to have a '/' prefix (e.g. relative urls) 41 | // only strip the slash if it is present. 42 | var pathname = result.pathname; 43 | if (pathname && pathname.charAt(0) === '/') { 44 | pathname = result.pathname.slice(1) || null; 45 | } 46 | config.database = pathname && decodeURI(pathname); 47 | 48 | var auth = (result.auth || ':').split(':'); 49 | config.user = auth[0]; 50 | config.password = auth.splice(1).join(':'); 51 | 52 | var ssl = result.query.ssl; 53 | if (ssl === 'true' || ssl === '1') { 54 | config.ssl = true; 55 | } 56 | 57 | return config; 58 | } 59 | 60 | module.exports = { 61 | parse: parse 62 | }; 63 | -------------------------------------------------------------------------------- /node_modules/pg-connection-string/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "pg-connection-string@0.1.3", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg" 6 | ] 7 | ], 8 | "_from": "pg-connection-string@0.1.3", 9 | "_id": "pg-connection-string@0.1.3", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/pg-connection-string", 13 | "_npmUser": { 14 | "email": "blaine@iceddev.com", 15 | "name": "phated" 16 | }, 17 | "_npmVersion": "1.4.28", 18 | "_phantomChildren": {}, 19 | "_requested": { 20 | "name": "pg-connection-string", 21 | "raw": "pg-connection-string@0.1.3", 22 | "rawSpec": "0.1.3", 23 | "scope": null, 24 | "spec": "0.1.3", 25 | "type": "version" 26 | }, 27 | "_requiredBy": [ 28 | "/pg" 29 | ], 30 | "_resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz", 31 | "_shasum": "da1847b20940e42ee1492beaf65d49d91b245df7", 32 | "_shrinkwrap": null, 33 | "_spec": "pg-connection-string@0.1.3", 34 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg", 35 | "author": { 36 | "email": "blaine@iceddev.com", 37 | "name": "Blaine Bublitz", 38 | "url": "http://iceddev.com/" 39 | }, 40 | "bugs": { 41 | "url": "https://github.com/iceddev/pg-connection-string/issues" 42 | }, 43 | "dependencies": {}, 44 | "description": "Functions for dealing with a PostgresSQL connection string", 45 | "devDependencies": { 46 | "tap": "^0.4.11" 47 | }, 48 | "directories": {}, 49 | "dist": { 50 | "shasum": "da1847b20940e42ee1492beaf65d49d91b245df7", 51 | "tarball": "http://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz" 52 | }, 53 | "gitHead": "4c151b9403420c1c9a9682facef1fcdbb9b79b3b", 54 | "homepage": "https://github.com/iceddev/pg-connection-string", 55 | "keywords": [ 56 | "pg", 57 | "connection", 58 | "string", 59 | "parse" 60 | ], 61 | "license": "MIT", 62 | "main": "index.js", 63 | "maintainers": [ 64 | { 65 | "email": "blaine@iceddev.com", 66 | "name": "phated" 67 | } 68 | ], 69 | "name": "pg-connection-string", 70 | "optionalDependencies": {}, 71 | "readme": "ERROR: No README data found!", 72 | "repository": { 73 | "type": "git", 74 | "url": "git+https://github.com/iceddev/pg-connection-string.git" 75 | }, 76 | "scripts": { 77 | "test": "tap ./test" 78 | }, 79 | "version": "0.1.3" 80 | } 81 | -------------------------------------------------------------------------------- /node_modules/pg-pool/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | -------------------------------------------------------------------------------- /node_modules/pg-pool/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | matrix: 4 | include: 5 | - node_js: "0.10" 6 | addons: 7 | postgresql: "9.1" 8 | - node_js: "0.12" 9 | addons: 10 | postgresql: "9.1" 11 | - node_js: "4" 12 | addons: 13 | postgresql: "9.1" 14 | - node_js: "5" 15 | addons: 16 | postgresql: "9.4" 17 | - node_js: "6" 18 | addons: 19 | postgresql: "9.4" 20 | -------------------------------------------------------------------------------- /node_modules/pg-pool/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: jshint test publish-patch test 2 | 3 | test: 4 | npm test 5 | 6 | patch: test 7 | npm version patch -m "Bump version" 8 | git push origin master --tags 9 | npm publish 10 | 11 | minor: test 12 | npm version minor -m "Bump version" 13 | git push origin master --tags 14 | npm publish 15 | -------------------------------------------------------------------------------- /node_modules/pg-pool/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "pg-pool@1.*", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg" 6 | ] 7 | ], 8 | "_from": "pg-pool@>=1.0.0 <2.0.0", 9 | "_id": "pg-pool@1.6.0", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/pg-pool", 13 | "_nodeVersion": "6.9.1", 14 | "_npmOperationalInternal": { 15 | "host": "packages-12-west.internal.npmjs.com", 16 | "tmp": "tmp/pg-pool-1.6.0.tgz_1480894084943_0.6403497341088951" 17 | }, 18 | "_npmUser": { 19 | "email": "brian.m.carlson@gmail.com", 20 | "name": "brianc" 21 | }, 22 | "_npmVersion": "3.10.8", 23 | "_phantomChildren": {}, 24 | "_requested": { 25 | "name": "pg-pool", 26 | "raw": "pg-pool@1.*", 27 | "rawSpec": "1.*", 28 | "scope": null, 29 | "spec": ">=1.0.0 <2.0.0", 30 | "type": "range" 31 | }, 32 | "_requiredBy": [ 33 | "/pg" 34 | ], 35 | "_resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-1.6.0.tgz", 36 | "_shasum": "2e300199927b6d7db6be71e2e3435dddddf07b41", 37 | "_shrinkwrap": null, 38 | "_spec": "pg-pool@1.*", 39 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg", 40 | "author": { 41 | "name": "Brian M. Carlson" 42 | }, 43 | "bugs": { 44 | "url": "https://github.com/brianc/node-pg-pool/issues" 45 | }, 46 | "dependencies": { 47 | "generic-pool": "2.4.2", 48 | "object-assign": "4.1.0" 49 | }, 50 | "description": "Connection pool for node-postgres", 51 | "devDependencies": { 52 | "bluebird": "3.4.1", 53 | "expect.js": "0.3.1", 54 | "lodash": "4.13.1", 55 | "mocha": "^2.3.3", 56 | "pg": "5.1.0", 57 | "standard": "7.1.2", 58 | "standard-format": "2.2.1" 59 | }, 60 | "directories": { 61 | "test": "test" 62 | }, 63 | "dist": { 64 | "shasum": "2e300199927b6d7db6be71e2e3435dddddf07b41", 65 | "tarball": "https://registry.npmjs.org/pg-pool/-/pg-pool-1.6.0.tgz" 66 | }, 67 | "gitHead": "ab70f579234cb51f7508cb18d09ff6d4e6944948", 68 | "homepage": "https://github.com/brianc/node-pg-pool#readme", 69 | "keywords": [ 70 | "pg", 71 | "postgres", 72 | "pool", 73 | "database" 74 | ], 75 | "license": "MIT", 76 | "main": "index.js", 77 | "maintainers": [ 78 | { 79 | "email": "brian.m.carlson@gmail.com", 80 | "name": "brianc" 81 | } 82 | ], 83 | "name": "pg-pool", 84 | "optionalDependencies": {}, 85 | "readme": "ERROR: No README data found!", 86 | "repository": { 87 | "type": "git", 88 | "url": "git://github.com/brianc/node-pg-pool.git" 89 | }, 90 | "scripts": { 91 | "test": "standard && node_modules/.bin/mocha" 92 | }, 93 | "version": "1.6.0" 94 | } 95 | -------------------------------------------------------------------------------- /node_modules/pg-pool/test/events.js: -------------------------------------------------------------------------------- 1 | var expect = require('expect.js') 2 | var EventEmitter = require('events').EventEmitter 3 | var describe = require('mocha').describe 4 | var it = require('mocha').it 5 | var objectAssign = require('object-assign') 6 | var Pool = require('../') 7 | 8 | describe('events', function () { 9 | it('emits connect before callback', function (done) { 10 | var pool = new Pool() 11 | var emittedClient = false 12 | pool.on('connect', function (client) { 13 | emittedClient = client 14 | }) 15 | 16 | pool.connect(function (err, client, release) { 17 | if (err) return done(err) 18 | release() 19 | pool.end() 20 | expect(client).to.be(emittedClient) 21 | done() 22 | }) 23 | }) 24 | 25 | it('emits "connect" only with a successful connection', function (done) { 26 | var pool = new Pool({ 27 | // This client will always fail to connect 28 | Client: mockClient({ 29 | connect: function (cb) { 30 | process.nextTick(function () { cb(new Error('bad news')) }) 31 | } 32 | }) 33 | }) 34 | pool.on('connect', function () { 35 | throw new Error('should never get here') 36 | }) 37 | pool._create(function (err) { 38 | if (err) done() 39 | else done(new Error('expected failure')) 40 | }) 41 | }) 42 | 43 | it('emits acquire every time a client is acquired', function (done) { 44 | var pool = new Pool() 45 | var acquireCount = 0 46 | pool.on('acquire', function (client) { 47 | expect(client).to.be.ok() 48 | acquireCount++ 49 | }) 50 | for (var i = 0; i < 10; i++) { 51 | pool.connect(function (err, client, release) { 52 | err ? done(err) : release() 53 | release() 54 | if (err) return done(err) 55 | }) 56 | pool.query('SELECT now()') 57 | } 58 | setTimeout(function () { 59 | expect(acquireCount).to.be(20) 60 | pool.end(done) 61 | }, 40) 62 | }) 63 | }) 64 | 65 | function mockClient (methods) { 66 | return function () { 67 | var client = new EventEmitter() 68 | objectAssign(client, methods) 69 | return client 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /node_modules/pg-pool/test/logging.js: -------------------------------------------------------------------------------- 1 | var expect = require('expect.js') 2 | 3 | var describe = require('mocha').describe 4 | var it = require('mocha').it 5 | 6 | var Pool = require('../') 7 | 8 | describe('logging', function () { 9 | it('logs to supplied log function if given', function () { 10 | var messages = [] 11 | var log = function (msg) { 12 | messages.push(msg) 13 | } 14 | var pool = new Pool({ log: log }) 15 | return pool.query('SELECT NOW()').then(function () { 16 | expect(messages.length).to.be.greaterThan(0) 17 | return pool.end() 18 | }) 19 | }) 20 | }) 21 | -------------------------------------------------------------------------------- /node_modules/pg-pool/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --no-exit 2 | --bail 3 | -------------------------------------------------------------------------------- /node_modules/pg-types/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/pg-types/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.12' 4 | - '5' 5 | env: 6 | - PGUSER=postgres 7 | -------------------------------------------------------------------------------- /node_modules/pg-types/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: publish-patch test 2 | 3 | test: 4 | npm test 5 | 6 | patch: test 7 | npm version patch -m "Bump version" 8 | git push origin master --tags 9 | npm publish 10 | 11 | minor: test 12 | npm version minor -m "Bump version" 13 | git push origin master --tags 14 | npm publish 15 | -------------------------------------------------------------------------------- /node_modules/pg-types/index.js: -------------------------------------------------------------------------------- 1 | var textParsers = require('./lib/textParsers'); 2 | var binaryParsers = require('./lib/binaryParsers'); 3 | var arrayParser = require('./lib/arrayParser'); 4 | 5 | exports.getTypeParser = getTypeParser; 6 | exports.setTypeParser = setTypeParser; 7 | exports.arrayParser = arrayParser; 8 | 9 | var typeParsers = { 10 | text: {}, 11 | binary: {} 12 | }; 13 | 14 | //the empty parse function 15 | function noParse (val) { 16 | return String(val); 17 | }; 18 | 19 | //returns a function used to convert a specific type (specified by 20 | //oid) into a result javascript type 21 | //note: the oid can be obtained via the following sql query: 22 | //SELECT oid FROM pg_type WHERE typname = 'TYPE_NAME_HERE'; 23 | function getTypeParser (oid, format) { 24 | format = format || 'text'; 25 | if (!typeParsers[format]) { 26 | return noParse; 27 | } 28 | return typeParsers[format][oid] || noParse; 29 | }; 30 | 31 | function setTypeParser (oid, format, parseFn) { 32 | if(typeof format == 'function') { 33 | parseFn = format; 34 | format = 'text'; 35 | } 36 | typeParsers[format][oid] = parseFn; 37 | }; 38 | 39 | textParsers.init(function(oid, converter) { 40 | typeParsers.text[oid] = converter; 41 | }); 42 | 43 | binaryParsers.init(function(oid, converter) { 44 | typeParsers.binary[oid] = converter; 45 | }); 46 | -------------------------------------------------------------------------------- /node_modules/pg-types/lib/arrayParser.js: -------------------------------------------------------------------------------- 1 | var array = require('postgres-array'); 2 | 3 | module.exports = { 4 | create: function (source, transform) { 5 | return { 6 | parse: function() { 7 | return array.parse(source, transform); 8 | } 9 | }; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /node_modules/pg-types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "pg-types@1.*", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg" 6 | ] 7 | ], 8 | "_from": "pg-types@>=1.0.0 <2.0.0", 9 | "_id": "pg-types@1.11.0", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/pg-types", 13 | "_nodeVersion": "5.5.0", 14 | "_npmOperationalInternal": { 15 | "host": "packages-16-east.internal.npmjs.com", 16 | "tmp": "tmp/pg-types-1.11.0.tgz_1461347783750_0.13011627295054495" 17 | }, 18 | "_npmUser": { 19 | "email": "brian.m.carlson@gmail.com", 20 | "name": "brianc" 21 | }, 22 | "_npmVersion": "3.3.12", 23 | "_phantomChildren": {}, 24 | "_requested": { 25 | "name": "pg-types", 26 | "raw": "pg-types@1.*", 27 | "rawSpec": "1.*", 28 | "scope": null, 29 | "spec": ">=1.0.0 <2.0.0", 30 | "type": "range" 31 | }, 32 | "_requiredBy": [ 33 | "/pg" 34 | ], 35 | "_resolved": "https://registry.npmjs.org/pg-types/-/pg-types-1.11.0.tgz", 36 | "_shasum": "aae91a82d952b633bb88d006350a166daaf6ea90", 37 | "_shrinkwrap": null, 38 | "_spec": "pg-types@1.*", 39 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg", 40 | "author": { 41 | "name": "Brian M. Carlson" 42 | }, 43 | "bugs": { 44 | "url": "https://github.com/brianc/node-pg-types/issues" 45 | }, 46 | "dependencies": { 47 | "ap": "~0.2.0", 48 | "postgres-array": "~1.0.0", 49 | "postgres-bytea": "~1.0.0", 50 | "postgres-date": "~1.0.0", 51 | "postgres-interval": "~1.0.0" 52 | }, 53 | "description": "Query result type converters for node-postgres", 54 | "devDependencies": { 55 | "pff": "^1.0.0", 56 | "tap-spec": "^4.0.0", 57 | "tape": "^4.0.0" 58 | }, 59 | "directories": {}, 60 | "dist": { 61 | "shasum": "aae91a82d952b633bb88d006350a166daaf6ea90", 62 | "tarball": "https://registry.npmjs.org/pg-types/-/pg-types-1.11.0.tgz" 63 | }, 64 | "gitHead": "ed2d0e36e33217b34530727a98d20b325389e73a", 65 | "homepage": "https://github.com/brianc/node-pg-types", 66 | "keywords": [ 67 | "postgres", 68 | "PostgreSQL", 69 | "pg" 70 | ], 71 | "license": "MIT", 72 | "main": "index.js", 73 | "maintainers": [ 74 | { 75 | "email": "brian.m.carlson@gmail.com", 76 | "name": "brianc" 77 | } 78 | ], 79 | "name": "pg-types", 80 | "optionalDependencies": {}, 81 | "readme": "ERROR: No README data found!", 82 | "repository": { 83 | "type": "git", 84 | "url": "git://github.com/brianc/node-pg-types.git" 85 | }, 86 | "scripts": { 87 | "test": "tape test/*.js | tap-spec" 88 | }, 89 | "version": "1.11.0" 90 | } 91 | -------------------------------------------------------------------------------- /node_modules/pg-types/test/index.js: -------------------------------------------------------------------------------- 1 | 2 | var test = require('tape') 3 | var printf = require('pff') 4 | var getTypeParser = require('../').getTypeParser 5 | var types = require('./types') 6 | 7 | test('types', function (t) { 8 | Object.keys(types).forEach(function (typeName) { 9 | var type = types[typeName] 10 | t.test(typeName, function (t) { 11 | var parser = getTypeParser(type.id, type.format) 12 | type.tests.forEach(function (tests) { 13 | var input = tests[0] 14 | var expected = tests[1] 15 | var result = parser(input) 16 | if (typeof expected === 'function') { 17 | return expected(t, result) 18 | } 19 | t.equal(result, expected) 20 | }) 21 | t.end() 22 | }) 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /node_modules/pg/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailing": true, 3 | "indent": 2, 4 | "evil": true 5 | } 6 | -------------------------------------------------------------------------------- /node_modules/pg/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | *.swp 3 | *.log 4 | .lock-wscript 5 | build/ 6 | *~ 7 | test/ 8 | script/ -------------------------------------------------------------------------------- /node_modules/pg/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | dist: trusty 4 | before_script: 5 | - node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres 6 | env: 7 | - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres 8 | 9 | node_js: "6" 10 | addons: 11 | postgresql: "9.6" 12 | 13 | matrix: 14 | include: 15 | - node_js: "0.10" 16 | addons: 17 | postgresql: "9.6" 18 | env: [] 19 | - node_js: "0.12" 20 | addons: 21 | postgresql: "9.6" 22 | env: [] 23 | - node_js: "4" 24 | addons: 25 | postgresql: "9.6" 26 | - node_js: "5" 27 | addons: 28 | postgresql: "9.6" 29 | - node_js: "6" 30 | addons: 31 | postgresql: "9.1" 32 | dist: precise 33 | - node_js: "6" 34 | addons: 35 | postgresql: "9.2" 36 | - node_js: "6" 37 | addons: 38 | postgresql: "9.3" 39 | - node_js: "6" 40 | addons: 41 | postgresql: "9.4" 42 | - node_js: "6" 43 | addons: 44 | postgresql: "9.5" 45 | -------------------------------------------------------------------------------- /node_modules/pg/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/sh 2 | 3 | connectionString=postgres:// 4 | 5 | params := $(connectionString) 6 | 7 | node-command := xargs -n 1 -I file node file $(params) 8 | 9 | .PHONY : test test-connection test-integration bench test-native \ 10 | jshint publish test-missing-native update-npm 11 | 12 | all: 13 | npm install 14 | 15 | help: 16 | @echo "make test-all [connectionString=postgres://]" 17 | 18 | test: test-unit 19 | 20 | test-all: jshint test-missing-native test-unit test-integration test-native test-binary 21 | 22 | 23 | update-npm: 24 | @npm i npm --global 25 | 26 | bench: 27 | @find benchmark -name "*-bench.js" | $(node-command) 28 | 29 | test-unit: 30 | @find test/unit -name "*-tests.js" | $(node-command) 31 | 32 | test-connection: 33 | @echo "***Testing connection***" 34 | @node script/create-test-tables.js $(params) 35 | 36 | test-missing-native: 37 | @echo "***Testing optional native install***" 38 | @rm -rf node_modules/pg-native 39 | @node test/native/missing-native.js 40 | @rm -rf node_modules/pg-native 41 | 42 | node_modules/pg-native/index.js: 43 | @npm i pg-native 44 | 45 | test-native: node_modules/pg-native/index.js test-connection 46 | @echo "***Testing native bindings***" 47 | @find test/native -name "*-tests.js" | $(node-command) 48 | @find test/integration -name "*-tests.js" | $(node-command) native 49 | 50 | test-integration: test-connection 51 | @echo "***Testing Pure Javascript***" 52 | @find test/integration -name "*-tests.js" | $(node-command) 53 | 54 | test-binary: test-connection 55 | @echo "***Testing Pure Javascript (binary)***" 56 | @find test/integration -name "*-tests.js" | $(node-command) binary 57 | 58 | test-pool: 59 | @find test/integration/connection-pool -name "*.js" | $(node-command) binary 60 | 61 | jshint: 62 | @echo "***Starting jshint***" 63 | @./node_modules/.bin/jshint lib 64 | -------------------------------------------------------------------------------- /node_modules/pg/lib/defaults.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com) 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the MIT license found in the 6 | * README.md file in the root directory of this source tree. 7 | */ 8 | 9 | var defaults = module.exports = { 10 | // database host. defaults to localhost 11 | host: 'localhost', 12 | 13 | //database user's name 14 | user: process.platform === 'win32' ? process.env.USERNAME : process.env.USER, 15 | 16 | //name of database to connect 17 | database: process.platform === 'win32' ? process.env.USERNAME : process.env.USER, 18 | 19 | //database user's password 20 | password: null, 21 | 22 | // a Postgres connection string to be used instead of setting individual connection items 23 | // NOTE: Setting this value will cause it to override any other value (such as database or user) defined 24 | // in the defaults object. 25 | connectionString : undefined, 26 | 27 | //database port 28 | port: 5432, 29 | 30 | //number of rows to return at a time from a prepared statement's 31 | //portal. 0 will return all rows at once 32 | rows: 0, 33 | 34 | // binary result mode 35 | binary: false, 36 | 37 | //Connection pool options - see https://github.com/coopernurse/node-pool 38 | //number of connections to use in connection pool 39 | //0 will disable connection pooling 40 | poolSize: 10, 41 | 42 | //max milliseconds a client can go unused before it is removed 43 | //from the pool and destroyed 44 | poolIdleTimeout: 30000, 45 | 46 | //frequency to check for idle clients within the client pool 47 | reapIntervalMillis: 1000, 48 | 49 | //if true the most recently released resources will be the first to be allocated 50 | returnToHead: false, 51 | 52 | //pool log function / boolean 53 | poolLog: false, 54 | 55 | client_encoding: "", 56 | 57 | ssl: false, 58 | 59 | application_name: undefined, 60 | fallback_application_name: undefined, 61 | 62 | parseInputDatesAsUTC: false 63 | }; 64 | 65 | //parse int8 so you can get your count values as actual numbers 66 | module.exports.__defineSetter__("parseInt8", function(val) { 67 | require('pg-types').setTypeParser(20, 'text', val ? parseInt : function(val) { return val; }); 68 | }); 69 | -------------------------------------------------------------------------------- /node_modules/pg/lib/native/result.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com) 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the MIT license found in the 6 | * README.md file in the root directory of this source tree. 7 | */ 8 | 9 | var NativeResult = module.exports = function(pq) { 10 | this.command = null; 11 | this.rowCount = 0; 12 | this.rows = null; 13 | this.fields = null; 14 | }; 15 | 16 | NativeResult.prototype.addCommandComplete = function(pq) { 17 | this.command = pq.cmdStatus().split(' ')[0]; 18 | this.rowCount = parseInt(pq.cmdTuples(), 10); 19 | var nfields = pq.nfields(); 20 | if(nfields < 1) return; 21 | 22 | this.fields = []; 23 | for(var i = 0; i < nfields; i++) { 24 | this.fields.push({ 25 | name: pq.fname(i), 26 | dataTypeID: pq.ftype(i) 27 | }); 28 | } 29 | }; 30 | 31 | NativeResult.prototype.addRow = function(row) { 32 | // This is empty to ensure pg code doesn't break when switching to pg-native 33 | // pg-native loads all rows into the final result object by default. 34 | // This is because libpg loads all rows into memory before passing the result 35 | // to pg-native. 36 | }; 37 | -------------------------------------------------------------------------------- /node_modules/pg/lib/pool-factory.js: -------------------------------------------------------------------------------- 1 | var Client = require('./client'); 2 | var util = require('util'); 3 | var Pool = require('pg-pool'); 4 | 5 | module.exports = function(Client) { 6 | 7 | var BoundPool = function(options) { 8 | var config = { Client: Client }; 9 | for (var key in options) { 10 | config[key] = options[key]; 11 | } 12 | Pool.call(this, config); 13 | }; 14 | 15 | util.inherits(BoundPool, Pool); 16 | 17 | return BoundPool; 18 | }; 19 | -------------------------------------------------------------------------------- /node_modules/pg/lib/type-overrides.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com) 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the MIT license found in the 6 | * README.md file in the root directory of this source tree. 7 | */ 8 | 9 | var types = require('pg-types'); 10 | 11 | function TypeOverrides(userTypes) { 12 | this._types = userTypes || types; 13 | this.text = {}; 14 | this.binary = {}; 15 | } 16 | 17 | TypeOverrides.prototype.getOverrides = function(format) { 18 | switch(format) { 19 | case 'text': return this.text; 20 | case 'binary': return this.binary; 21 | default: return {}; 22 | } 23 | }; 24 | 25 | TypeOverrides.prototype.setTypeParser = function(oid, format, parseFn) { 26 | if(typeof format == 'function') { 27 | parseFn = format; 28 | format = 'text'; 29 | } 30 | this.getOverrides(format)[oid] = parseFn; 31 | }; 32 | 33 | TypeOverrides.prototype.getTypeParser = function(oid, format) { 34 | format = format || 'text'; 35 | return this.getOverrides(format)[oid] || this._types.getTypeParser(oid, format); 36 | }; 37 | 38 | module.exports = TypeOverrides; 39 | -------------------------------------------------------------------------------- /node_modules/pgpass/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "strict" : true , 3 | "laxcomma" : true , 4 | "camelcase" : true , 5 | "node" : true , 6 | "trailing" : true 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/pgpass/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *~ 3 | #* 4 | lib-cov 5 | coverage.html 6 | npm-debug.log 7 | -------------------------------------------------------------------------------- /node_modules/pgpass/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - "0.10" 5 | - "0.12" 6 | - "4" 7 | - "5" 8 | - "6" 9 | 10 | env: 11 | - CXX=g++-4.8 12 | 13 | addons: 14 | apt: 15 | sources: 16 | - ubuntu-toolchain-r-test 17 | packages: 18 | - g++-4.8 19 | - lsof 20 | -------------------------------------------------------------------------------- /node_modules/pgpass/lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path') 4 | , fs = require('fs') 5 | , helper = require('./helper.js') 6 | ; 7 | 8 | 9 | module.exports = function(connInfo, cb) { 10 | var file = helper.getFileName(); 11 | 12 | fs.stat(file, function(err, stat){ 13 | if (err || !helper.usePgPass(stat, file)) { 14 | return cb(undefined); 15 | } 16 | 17 | var st = fs.createReadStream(file); 18 | 19 | helper.getPassword(connInfo, st, cb); 20 | }); 21 | }; 22 | 23 | module.exports.warnTo = helper.warnTo; 24 | -------------------------------------------------------------------------------- /node_modules/pgpass/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "pgpass@1.x", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg" 6 | ] 7 | ], 8 | "_from": "pgpass@>=1.0.0 <2.0.0", 9 | "_id": "pgpass@1.0.1", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/pgpass", 13 | "_npmOperationalInternal": { 14 | "host": "packages-16-east.internal.npmjs.com", 15 | "tmp": "tmp/pgpass-1.0.1.tgz_1470077614991_0.0017669571097940207" 16 | }, 17 | "_npmUser": { 18 | "email": "hannes.hoerl+npm@snowreporter.com", 19 | "name": "hoegaarden" 20 | }, 21 | "_npmVersion": "1.4.24", 22 | "_phantomChildren": {}, 23 | "_requested": { 24 | "name": "pgpass", 25 | "raw": "pgpass@1.x", 26 | "rawSpec": "1.x", 27 | "scope": null, 28 | "spec": ">=1.0.0 <2.0.0", 29 | "type": "range" 30 | }, 31 | "_requiredBy": [ 32 | "/pg" 33 | ], 34 | "_resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.1.tgz", 35 | "_shasum": "0de8b5bef993295d90a7e17d976f568dcd25d49f", 36 | "_shrinkwrap": null, 37 | "_spec": "pgpass@1.x", 38 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg", 39 | "author": { 40 | "email": "hannes.hoerl+pgpass@snowreporter.com", 41 | "name": "Hannes Hörl" 42 | }, 43 | "bugs": { 44 | "url": "https://github.com/hoegaarden/pgpass/issues" 45 | }, 46 | "dependencies": { 47 | "split": "^1.0.0" 48 | }, 49 | "description": "Module for reading .pgpass", 50 | "devDependencies": { 51 | "jscoverage": "^0.6.0", 52 | "jshint": "^2.9.2", 53 | "mocha": "^2.5.3", 54 | "pg": "^4.5.6", 55 | "pg-escape": "^0.2.0", 56 | "pg-native": "^1.10.0", 57 | "resumer": "0.0.0", 58 | "tmp": "0.0.28", 59 | "which": "^1.2.10" 60 | }, 61 | "directories": {}, 62 | "dist": { 63 | "shasum": "0de8b5bef993295d90a7e17d976f568dcd25d49f", 64 | "tarball": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.1.tgz" 65 | }, 66 | "gitHead": "504c267eeff2aaff0d38b626a8c62d2606207b86", 67 | "homepage": "https://github.com/hoegaarden/pgpass", 68 | "keywords": [ 69 | "postgres", 70 | "pg", 71 | "pgpass", 72 | "password", 73 | "postgresql" 74 | ], 75 | "license": "MIT", 76 | "main": "lib/index", 77 | "maintainers": [ 78 | { 79 | "email": "hannes.hoerl+npm@snowreporter.com", 80 | "name": "hoegaarden" 81 | } 82 | ], 83 | "name": "pgpass", 84 | "optionalDependencies": {}, 85 | "readme": "ERROR: No README data found!", 86 | "repository": { 87 | "type": "git", 88 | "url": "git+https://github.com/hoegaarden/pgpass.git" 89 | }, 90 | "scripts": { 91 | "coverage": "rm -rf -- lib-cov ; jscoverage lib lib-cov && mocha --recursive -R html-cov > coverage.html", 92 | "hint": "jshint --verbose lib test", 93 | "pretest": "chmod 600 ./test/_pgpass", 94 | "test": "npm run hint && mocha --recursive -R list && npm run coverage" 95 | }, 96 | "version": "1.0.1" 97 | } 98 | -------------------------------------------------------------------------------- /node_modules/pgpass/test/#1 de-escaping.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global describe: false */ 4 | /* global it: false */ 5 | /* global after: false */ 6 | /* global before: false */ 7 | 8 | /* jshint -W106 */ 9 | var COV = process.env.npm_lifecycle_event === 'coverage'; 10 | /* jshint +W106 */ 11 | 12 | var assert = require('assert') 13 | , path = require('path') 14 | , pgPass = require( path.join('..', COV ? 'lib-cov' : 'lib' , 'index') ) 15 | ; 16 | 17 | 18 | var conn = { 19 | 'host' : 'host5' , 20 | 'database' : 'database5' , 21 | 'user' : 'dummy\\:user' 22 | }; 23 | 24 | describe('#1', function(){ 25 | before(function(){ 26 | process.env.PGPASS_NO_DEESCAPE = true; 27 | process.env.PGPASSFILE = path.join(__dirname, '_pgpass'); 28 | }); 29 | after(function(){ 30 | delete process.env.PGPASS_NO_DEESCAPE; 31 | delete process.env.PGPASSFILE; 32 | }); 33 | 34 | it('should not de-escape NODE_PG_NO_DESCAPE is set', function(done){ 35 | process.env.PGPASSFILE = path.join(__dirname, '_pgpass'); 36 | 37 | pgPass(conn, function(res){ 38 | assert.strictEqual('some:password', res); 39 | done(); 40 | }); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /node_modules/pgpass/test/#1 escaping.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global describe: false */ 4 | /* global it: false */ 5 | 6 | /* jshint -W106 */ 7 | var COV = process.env.npm_lifecycle_event === 'coverage'; 8 | /* jshint +W106 */ 9 | 10 | var assert = require('assert') 11 | , path = require('path') 12 | , pgPass = require( path.join('..', COV ? 'lib-cov' : 'lib' , 'index') ) 13 | ; 14 | 15 | 16 | var conn = { 17 | 'host' : 'host4' , 18 | 'port' : 100 , 19 | 'database' : 'database4' , 20 | 'user' : 'user4' 21 | }; 22 | 23 | describe('#1', function(){ 24 | it('should handle escaping right', function(done){ 25 | process.env.PGPASSFILE = path.join(__dirname, '_pgpass'); 26 | pgPass(conn, function(res){ 27 | assert.strictEqual('some:wired:password', res); 28 | done(); 29 | }); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /node_modules/pgpass/test/#6 too many open files.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global describe: false */ 4 | /* global it: false */ 5 | 6 | /* jshint -W106 */ 7 | var COV = process.env.npm_lifecycle_event === 'coverage'; 8 | /* jshint +W106 */ 9 | 10 | var assert = require('assert') 11 | , path = require('path') 12 | , pgPass = require( path.join('..', COV ? 'lib-cov' : 'lib' , 'index') ) 13 | , spawn = require('child_process').spawn 14 | , os = require('os') 15 | ; 16 | 17 | var conn = { 18 | 'host' : 'host4' , 19 | 'port' : 100 , 20 | 'database' : 'database4' , 21 | 'user' : 'user4' 22 | }; 23 | 24 | var lsofBin; 25 | try { 26 | lsofBin = require('which').sync('lsof'); 27 | } catch (e) { 28 | if (process.env.SKIP_LSOF) { 29 | console.warn('WARNING: lsof not found, skipping test', __filename); 30 | } else { 31 | console.error('ERROR: lsof not found'); 32 | process.exit(1); 33 | } 34 | } 35 | 36 | if (lsofBin) { 37 | describe('#6', function(){ 38 | it('should close stream', function(done){ 39 | var passFile = path.join(__dirname, '_pgpass'); 40 | process.env.PGPASSFILE = passFile; 41 | 42 | pgPass(conn, function(pass){ 43 | var out = ''; 44 | var err = ''; 45 | var lsofArgs = [ 46 | '-w', '-Fn', '-p', process.pid 47 | ]; 48 | var lsof = spawn(lsofBin, lsofArgs); 49 | 50 | lsof.stdout.on('data', function(d){ 51 | out = out.concat( d.toString() ); 52 | }); 53 | lsof.stderr.on('data', function(d){ 54 | err = err.concat( d.toString() ); 55 | }); 56 | lsof.on('exit', function(code){ 57 | var res = out.split(os.EOL).filter(function(el){ 58 | return (el == 'n'.concat(passFile)); 59 | }); 60 | assert.equal(res.length, 0, 'open files found'); 61 | assert.equal(err, '', 'printed errors'); 62 | assert.equal(code, 0, 'exited with errors'); 63 | done(); 64 | }); 65 | }); 66 | }); 67 | }); 68 | } // if lsofBin 69 | -------------------------------------------------------------------------------- /node_modules/pgpass/test/_pgpass: -------------------------------------------------------------------------------- 1 | # comments?? 2 | host1:1:database1:user1:pass1 3 | *:*:*:user2:pass2 4 | host3:3:database3:user3:pass3 5 | 6 | host4:*:database4:user4:some\:wired\:password 7 | 8 | host5:*:database5:dummy\:user:some:password 9 | 10 | 11 | -------------------------------------------------------------------------------- /node_modules/pgpass/test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global describe: false */ 4 | /* global it: false */ 5 | 6 | /* jshint -W106 */ 7 | var COV = process.env.npm_lifecycle_event === 'coverage'; 8 | /* jshint +W106 */ 9 | 10 | var assert = require('assert') 11 | , path = require('path') 12 | , pgPass = require( path.join('..', COV ? 'lib-cov' : 'lib' , 'index') ) 13 | ; 14 | 15 | 16 | var conn = { 17 | 'host' : 'host1' , 18 | 'port' : 100 , 19 | 'database' : 'somedb' , 20 | 'user' : 'user2' 21 | }; 22 | 23 | describe('MAIN', function(){ 24 | it('should ignore non existent file', function(done){ 25 | process.env.PGPASSFILE = path.join(__dirname, '_no_such_file_'); 26 | pgPass(conn, function(res){ 27 | assert(undefined === res); 28 | done(); 29 | }); 30 | }); 31 | 32 | 33 | it('should read .pgpass', function(done){ 34 | process.env.PGPASSFILE = path.join(__dirname, '_pgpass'); 35 | pgPass(conn, function(res){ 36 | assert.strictEqual('pass2', res); 37 | done(); 38 | }); 39 | }); 40 | 41 | 42 | it('should not read .pgpass because of PGPASSWORD', function(done){ 43 | process.env.PGPASSFILE = path.join(__dirname, '_pgpass'); 44 | process.env.PGPASSWORD = 'something'; 45 | pgPass(conn, function(res){ 46 | assert(undefined === res); 47 | delete process.env.PGPASSWORD; 48 | done(); 49 | }); 50 | }); 51 | 52 | }); 53 | -------------------------------------------------------------------------------- /node_modules/postgres-array/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.parse = function (source, transform) { 4 | return new ArrayParser(source, transform).parse() 5 | } 6 | 7 | function ArrayParser (source, transform) { 8 | this.source = source 9 | this.transform = transform || identity 10 | this.position = 0 11 | this.entries = [] 12 | this.recorded = [] 13 | this.dimension = 0 14 | } 15 | 16 | ArrayParser.prototype.isEof = function () { 17 | return this.position >= this.source.length 18 | } 19 | 20 | ArrayParser.prototype.nextCharacter = function () { 21 | var character = this.source[this.position++] 22 | if (character === '\\') { 23 | return { 24 | value: this.source[this.position++], 25 | escaped: true 26 | } 27 | } 28 | return { 29 | value: character, 30 | escaped: false 31 | } 32 | } 33 | 34 | ArrayParser.prototype.record = function (character) { 35 | this.recorded.push(character) 36 | } 37 | 38 | ArrayParser.prototype.newEntry = function (includeEmpty) { 39 | var entry 40 | if (this.recorded.length > 0 || includeEmpty) { 41 | entry = this.recorded.join('') 42 | if (entry === 'NULL' && !includeEmpty) { 43 | entry = null 44 | } 45 | if (entry !== null) entry = this.transform(entry) 46 | this.entries.push(entry) 47 | this.recorded = [] 48 | } 49 | } 50 | 51 | ArrayParser.prototype.parse = function (nested) { 52 | var character, parser, quote 53 | while (!this.isEof()) { 54 | character = this.nextCharacter() 55 | if (character.value === '{' && !quote) { 56 | this.dimension++ 57 | if (this.dimension > 1) { 58 | parser = new ArrayParser(this.source.substr(this.position - 1), this.transform) 59 | this.entries.push(parser.parse(true)) 60 | this.position += parser.position - 2 61 | } 62 | } else if (character.value === '}' && !quote) { 63 | this.dimension-- 64 | if (!this.dimension) { 65 | this.newEntry() 66 | if (nested) return this.entries 67 | } 68 | } else if (character.value === '"' && !character.escaped) { 69 | if (quote) this.newEntry(true) 70 | quote = !quote 71 | } else if (character.value === ',' && !quote) { 72 | this.newEntry() 73 | } else { 74 | this.record(character.value) 75 | } 76 | } 77 | if (this.dimension !== 0) { 78 | throw new Error('array dimension not balanced') 79 | } 80 | return this.entries 81 | } 82 | 83 | function identity (value) { 84 | return value 85 | } 86 | -------------------------------------------------------------------------------- /node_modules/postgres-array/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Ben Drucker (bendrucker.me) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/postgres-array/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "postgres-array@~1.0.0", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types" 6 | ] 7 | ], 8 | "_from": "postgres-array@>=1.0.0 <1.1.0", 9 | "_id": "postgres-array@1.0.2", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/postgres-array", 13 | "_nodeVersion": "7.1.0", 14 | "_npmOperationalInternal": { 15 | "host": "packages-18-east.internal.npmjs.com", 16 | "tmp": "tmp/postgres-array-1.0.2.tgz_1481324051273_0.7649495950900018" 17 | }, 18 | "_npmUser": { 19 | "email": "bvdrucker@gmail.com", 20 | "name": "bendrucker" 21 | }, 22 | "_npmVersion": "3.10.9", 23 | "_phantomChildren": {}, 24 | "_requested": { 25 | "name": "postgres-array", 26 | "raw": "postgres-array@~1.0.0", 27 | "rawSpec": "~1.0.0", 28 | "scope": null, 29 | "spec": ">=1.0.0 <1.1.0", 30 | "type": "range" 31 | }, 32 | "_requiredBy": [ 33 | "/pg-types" 34 | ], 35 | "_resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-1.0.2.tgz", 36 | "_shasum": "8e0b32eb03bf77a5c0a7851e0441c169a256a238", 37 | "_shrinkwrap": null, 38 | "_spec": "postgres-array@~1.0.0", 39 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types", 40 | "author": { 41 | "email": "bvdrucker@gmail.com", 42 | "name": "Ben Drucker", 43 | "url": "bendrucker.me" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/bendrucker/postgres-array/issues" 47 | }, 48 | "dependencies": {}, 49 | "description": "Parse postgres array columns", 50 | "devDependencies": { 51 | "ap": "^0.2.0", 52 | "standard": "^4.0.0", 53 | "tape": "^4.0.0" 54 | }, 55 | "directories": {}, 56 | "dist": { 57 | "shasum": "8e0b32eb03bf77a5c0a7851e0441c169a256a238", 58 | "tarball": "https://registry.npmjs.org/postgres-array/-/postgres-array-1.0.2.tgz" 59 | }, 60 | "engines": { 61 | "node": ">=0.10.0" 62 | }, 63 | "files": [ 64 | "index.js", 65 | "readme.md" 66 | ], 67 | "gitHead": "f683e48602e00833c09713f4511c740534c4e32d", 68 | "homepage": "https://github.com/bendrucker/postgres-array#readme", 69 | "keywords": [ 70 | "postgres", 71 | "array", 72 | "parser" 73 | ], 74 | "license": "MIT", 75 | "main": "index.js", 76 | "maintainers": [ 77 | { 78 | "email": "bvdrucker@gmail.com", 79 | "name": "bendrucker" 80 | } 81 | ], 82 | "name": "postgres-array", 83 | "optionalDependencies": {}, 84 | "readme": "ERROR: No README data found!", 85 | "repository": { 86 | "type": "git", 87 | "url": "git+https://github.com/bendrucker/postgres-array.git" 88 | }, 89 | "scripts": { 90 | "test": "standard && tape test.js" 91 | }, 92 | "version": "1.0.2" 93 | } 94 | -------------------------------------------------------------------------------- /node_modules/postgres-array/readme.md: -------------------------------------------------------------------------------- 1 | # postgres-array [![Build Status](https://travis-ci.org/bendrucker/postgres-array.svg?branch=master)](https://travis-ci.org/bendrucker/postgres-array) 2 | 3 | > Parse postgres array columns 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save postgres-array 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var postgresArray = require('postgres-array') 17 | 18 | postgresArray.parse('{1,2,3}', parseInt); 19 | //=> [1, 2, 3] 20 | ``` 21 | 22 | ## API 23 | 24 | #### `parse(input, [transform])` -> `array` 25 | 26 | ##### input 27 | 28 | *Required* 29 | Type: `string` 30 | 31 | A Postgres array string. 32 | 33 | ##### transform 34 | 35 | Type: `function` 36 | Default: `identity` 37 | 38 | A function that transforms non-null values inserted into the array. 39 | 40 | 41 | ## License 42 | 43 | MIT © [Ben Drucker](http://bendrucker.me) 44 | -------------------------------------------------------------------------------- /node_modules/postgres-bytea/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = function parseBytea (input) { 4 | if (/^\\x/.test(input)) { 5 | // new 'hex' style response (pg >9.0) 6 | return new Buffer(input.substr(2), 'hex') 7 | } 8 | var output = '' 9 | var i = 0 10 | while (i < input.length) { 11 | if (input[i] !== '\\') { 12 | output += input[i] 13 | ++i 14 | } else { 15 | if (/[0-7]{3}/.test(input.substr(i + 1, 3))) { 16 | output += String.fromCharCode(parseInt(input.substr(i + 1, 3), 8)) 17 | i += 4 18 | } else { 19 | var backslashes = 1 20 | while (i + backslashes < input.length && input[i + backslashes] === '\\') { 21 | backslashes++ 22 | } 23 | for (var k = 0; k < Math.floor(backslashes / 2); ++k) { 24 | output += '\\' 25 | } 26 | i += Math.floor(backslashes / 2) * 2 27 | } 28 | } 29 | } 30 | return new Buffer(output, 'binary') 31 | } 32 | -------------------------------------------------------------------------------- /node_modules/postgres-bytea/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Ben Drucker (bendrucker.me) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/postgres-bytea/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "postgres-bytea@~1.0.0", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types" 6 | ] 7 | ], 8 | "_from": "postgres-bytea@>=1.0.0 <1.1.0", 9 | "_id": "postgres-bytea@1.0.0", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/postgres-bytea", 13 | "_nodeVersion": "2.2.1", 14 | "_npmUser": { 15 | "email": "bvdrucker@gmail.com", 16 | "name": "bendrucker" 17 | }, 18 | "_npmVersion": "2.11.0", 19 | "_phantomChildren": {}, 20 | "_requested": { 21 | "name": "postgres-bytea", 22 | "raw": "postgres-bytea@~1.0.0", 23 | "rawSpec": "~1.0.0", 24 | "scope": null, 25 | "spec": ">=1.0.0 <1.1.0", 26 | "type": "range" 27 | }, 28 | "_requiredBy": [ 29 | "/pg-types" 30 | ], 31 | "_resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", 32 | "_shasum": "027b533c0aa890e26d172d47cf9ccecc521acd35", 33 | "_shrinkwrap": null, 34 | "_spec": "postgres-bytea@~1.0.0", 35 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types", 36 | "author": { 37 | "email": "bvdrucker@gmail.com", 38 | "name": "Ben Drucker", 39 | "url": "bendrucker.me" 40 | }, 41 | "bugs": { 42 | "url": "https://github.com/bendrucker/postgres-bytea/issues" 43 | }, 44 | "dependencies": {}, 45 | "description": "Postgres bytea parser", 46 | "devDependencies": { 47 | "standard": "^4.0.0", 48 | "tape": "^4.0.0" 49 | }, 50 | "directories": {}, 51 | "dist": { 52 | "shasum": "027b533c0aa890e26d172d47cf9ccecc521acd35", 53 | "tarball": "http://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz" 54 | }, 55 | "engines": { 56 | "node": ">=0.10.0" 57 | }, 58 | "files": [ 59 | "index.js", 60 | "readme.md" 61 | ], 62 | "gitHead": "6a1c2665b40e7a6548d7102a8b0fb4905a1a90b7", 63 | "homepage": "https://github.com/bendrucker/postgres-bytea#readme", 64 | "keywords": [ 65 | "bytea", 66 | "postgres", 67 | "binary", 68 | "parser" 69 | ], 70 | "license": "MIT", 71 | "main": "index.js", 72 | "maintainers": [ 73 | { 74 | "email": "bvdrucker@gmail.com", 75 | "name": "bendrucker" 76 | } 77 | ], 78 | "name": "postgres-bytea", 79 | "optionalDependencies": {}, 80 | "readme": "ERROR: No README data found!", 81 | "repository": { 82 | "type": "git", 83 | "url": "git+https://github.com/bendrucker/postgres-bytea.git" 84 | }, 85 | "scripts": { 86 | "test": "standard && tape test.js" 87 | }, 88 | "version": "1.0.0" 89 | } 90 | -------------------------------------------------------------------------------- /node_modules/postgres-bytea/readme.md: -------------------------------------------------------------------------------- 1 | # postgres-bytea [![Build Status](https://travis-ci.org/bendrucker/postgres-bytea.svg?branch=master)](https://travis-ci.org/bendrucker/postgres-bytea) 2 | 3 | > Postgres bytea parser 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save postgres-bytea 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var bytea = require('postgres-bytea'); 17 | bytea('\\000\\100\\200') 18 | //=> buffer 19 | ``` 20 | 21 | ## API 22 | 23 | #### `bytea(input)` -> `buffer` 24 | 25 | ##### input 26 | 27 | *Required* 28 | Type: `string` 29 | 30 | A Postgres bytea binary string. 31 | 32 | ## License 33 | 34 | MIT © [Ben Drucker](http://bendrucker.me) 35 | -------------------------------------------------------------------------------- /node_modules/postgres-date/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var DATE_TIME = /(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?/ 4 | var DATE = /^(\d{1,})-(\d{2})-(\d{2})$/ 5 | var TIME_ZONE = /([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/ 6 | var BC = /BC$/ 7 | var INFINITY = /^-?infinity$/ 8 | 9 | module.exports = function parseDate (isoDate) { 10 | if (INFINITY.test(isoDate)) { 11 | // Capitalize to Infinity before passing to Number 12 | return Number(isoDate.replace('i', 'I')) 13 | } 14 | var matches = DATE_TIME.exec(isoDate) 15 | 16 | if (!matches) { 17 | // Force YYYY-MM-DD dates to be parsed as local time 18 | return DATE.test(isoDate) ? 19 | getDate(isoDate) : 20 | null 21 | } 22 | 23 | var isBC = BC.test(isoDate) 24 | var year = parseInt(matches[1], 10) 25 | var isFirstCentury = year > 0 && year < 100 26 | year = (isBC ? '-' : '') + year 27 | 28 | var month = parseInt(matches[2], 10) - 1 29 | var day = matches[3] 30 | var hour = parseInt(matches[4], 10) 31 | var minute = parseInt(matches[5], 10) 32 | var second = parseInt(matches[6], 10) 33 | 34 | var ms = matches[7] 35 | ms = ms ? 1000 * parseFloat(ms) : 0 36 | 37 | var date 38 | var offset = timeZoneOffset(isoDate) 39 | if (offset != null) { 40 | var utc = Date.UTC(year, month, day, hour, minute, second, ms) 41 | date = new Date(utc - offset) 42 | } else { 43 | date = new Date(year, month, day, hour, minute, second, ms) 44 | } 45 | 46 | if (isFirstCentury) { 47 | date.setUTCFullYear(year) 48 | } 49 | 50 | return date 51 | } 52 | 53 | function getDate (isoDate) { 54 | var matches = DATE.exec(isoDate) 55 | var year = parseInt(matches[1], 10) 56 | var month = parseInt(matches[2], 10) - 1 57 | var day = matches[3] 58 | // YYYY-MM-DD will be parsed as local time 59 | var date = new Date(year, month, day) 60 | date.setFullYear(year) 61 | return date 62 | } 63 | 64 | // match timezones: 65 | // Z (UTC) 66 | // -05 67 | // +06:30 68 | function timeZoneOffset (isoDate) { 69 | var zone = TIME_ZONE.exec(isoDate.split(' ')[1]) 70 | if (!zone) return 71 | var type = zone[1] 72 | 73 | if (type === 'Z') { 74 | return 0 75 | } 76 | var sign = type === '-' ? -1 : 1 77 | var offset = parseInt(zone[2], 10) * 3600 + 78 | parseInt(zone[3] || 0, 10) * 60 + 79 | parseInt(zone[4] || 0, 10) 80 | 81 | return offset * sign * 1000 82 | } 83 | -------------------------------------------------------------------------------- /node_modules/postgres-date/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Ben Drucker (bendrucker.me) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/postgres-date/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "postgres-date@~1.0.0", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types" 6 | ] 7 | ], 8 | "_from": "postgres-date@>=1.0.0 <1.1.0", 9 | "_id": "postgres-date@1.0.3", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/postgres-date", 13 | "_nodeVersion": "5.11.1", 14 | "_npmOperationalInternal": { 15 | "host": "packages-16-east.internal.npmjs.com", 16 | "tmp": "tmp/postgres-date-1.0.3.tgz_1467778611321_0.30105624767020345" 17 | }, 18 | "_npmUser": { 19 | "email": "bvdrucker@gmail.com", 20 | "name": "bendrucker" 21 | }, 22 | "_npmVersion": "3.8.6", 23 | "_phantomChildren": {}, 24 | "_requested": { 25 | "name": "postgres-date", 26 | "raw": "postgres-date@~1.0.0", 27 | "rawSpec": "~1.0.0", 28 | "scope": null, 29 | "spec": ">=1.0.0 <1.1.0", 30 | "type": "range" 31 | }, 32 | "_requiredBy": [ 33 | "/pg-types" 34 | ], 35 | "_resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.3.tgz", 36 | "_shasum": "e2d89702efdb258ff9d9cee0fe91bd06975257a8", 37 | "_shrinkwrap": null, 38 | "_spec": "postgres-date@~1.0.0", 39 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types", 40 | "author": { 41 | "email": "bvdrucker@gmail.com", 42 | "name": "Ben Drucker", 43 | "url": "bendrucker.me" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/bendrucker/postgres-date/issues" 47 | }, 48 | "dependencies": {}, 49 | "description": "Postgres date column parser", 50 | "devDependencies": { 51 | "standard": "^4.0.0", 52 | "tape": "^4.0.0" 53 | }, 54 | "directories": {}, 55 | "dist": { 56 | "shasum": "e2d89702efdb258ff9d9cee0fe91bd06975257a8", 57 | "tarball": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.3.tgz" 58 | }, 59 | "engines": { 60 | "node": ">=0.10.0" 61 | }, 62 | "files": [ 63 | "index.js", 64 | "readme.md" 65 | ], 66 | "gitHead": "b4156af39aa661a719b907ecc78bdc44d7fcb55a", 67 | "homepage": "https://github.com/bendrucker/postgres-date#readme", 68 | "keywords": [ 69 | "postgres", 70 | "date", 71 | "parser" 72 | ], 73 | "license": "MIT", 74 | "main": "index.js", 75 | "maintainers": [ 76 | { 77 | "email": "bvdrucker@gmail.com", 78 | "name": "bendrucker" 79 | } 80 | ], 81 | "name": "postgres-date", 82 | "optionalDependencies": {}, 83 | "readme": "ERROR: No README data found!", 84 | "repository": { 85 | "type": "git", 86 | "url": "git+https://github.com/bendrucker/postgres-date.git" 87 | }, 88 | "scripts": { 89 | "test": "standard && tape test.js" 90 | }, 91 | "version": "1.0.3" 92 | } 93 | -------------------------------------------------------------------------------- /node_modules/postgres-date/readme.md: -------------------------------------------------------------------------------- 1 | # postgres-date [![Build Status](https://travis-ci.org/bendrucker/postgres-date.svg?branch=master)](https://travis-ci.org/bendrucker/postgres-date) 2 | 3 | > Postgres date column parser 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save postgres-date 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var parse = require('postgres-date') 17 | parse('2011-01-23 22:15:51Z') 18 | // => 2011-01-23T22:15:51.000Z 19 | ``` 20 | 21 | ## API 22 | 23 | #### `parse(isoDate)` -> `date` 24 | 25 | ##### isoDate 26 | 27 | *Required* 28 | Type: `string` 29 | 30 | A date string from Postgres. 31 | 32 | ## License 33 | 34 | MIT © [Ben Drucker](http://bendrucker.me) 35 | -------------------------------------------------------------------------------- /node_modules/postgres-interval/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var extend = require('xtend/mutable') 4 | 5 | module.exports = PostgresInterval 6 | 7 | function PostgresInterval (raw) { 8 | if (!(this instanceof PostgresInterval)) { 9 | return new PostgresInterval(raw) 10 | } 11 | extend(this, parse(raw)) 12 | } 13 | var properties = ['seconds', 'minutes', 'hours', 'days', 'months', 'years'] 14 | PostgresInterval.prototype.toPostgres = function () { 15 | var filtered = properties.filter(this.hasOwnProperty, this) 16 | if (filtered.length === 0) return '0' 17 | return filtered 18 | .map(function (property) { 19 | return this[property] + ' ' + property 20 | }, this) 21 | .join(' ') 22 | } 23 | 24 | var NUMBER = '([+-]?\\d+)' 25 | var YEAR = NUMBER + '\\s+years?' 26 | var MONTH = NUMBER + '\\s+mons?' 27 | var DAY = NUMBER + '\\s+days?' 28 | var TIME = '([+-])?([\\d]*):(\\d\\d):(\\d\\d):?(\\d\\d\\d)?' 29 | var INTERVAL = new RegExp([YEAR, MONTH, DAY, TIME].map(function (regexString) { 30 | return '(' + regexString + ')?' 31 | }) 32 | .join('\\s*')) 33 | 34 | // Positions of values in regex match 35 | var positions = { 36 | years: 2, 37 | months: 4, 38 | days: 6, 39 | hours: 9, 40 | minutes: 10, 41 | seconds: 11, 42 | milliseconds: 12 43 | } 44 | // We can use negative time 45 | var negatives = ['hours', 'minutes', 'seconds'] 46 | 47 | function parse (interval) { 48 | if (!interval) return {} 49 | var matches = INTERVAL.exec(interval) 50 | var isNegative = matches[8] === '-' 51 | return Object.keys(positions) 52 | .reduce(function (parsed, property) { 53 | var position = positions[property] 54 | var value = matches[position] 55 | // no empty string 56 | if (!value) return parsed 57 | value = parseInt(value, 10) 58 | // no zeros 59 | if (!value) return parsed 60 | if (isNegative && ~negatives.indexOf(property)) { 61 | value *= -1 62 | } 63 | parsed[property] = value 64 | return parsed 65 | }, {}) 66 | } 67 | -------------------------------------------------------------------------------- /node_modules/postgres-interval/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Ben Drucker (bendrucker.me) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/postgres-interval/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "postgres-interval@~1.0.0", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types" 6 | ] 7 | ], 8 | "_from": "postgres-interval@>=1.0.0 <1.1.0", 9 | "_id": "postgres-interval@1.0.2", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/postgres-interval", 13 | "_nodeVersion": "5.9.1", 14 | "_npmOperationalInternal": { 15 | "host": "packages-12-west.internal.npmjs.com", 16 | "tmp": "tmp/postgres-interval-1.0.2.tgz_1460489398083_0.6353156298864633" 17 | }, 18 | "_npmUser": { 19 | "email": "bvdrucker@gmail.com", 20 | "name": "bendrucker" 21 | }, 22 | "_npmVersion": "3.7.3", 23 | "_phantomChildren": {}, 24 | "_requested": { 25 | "name": "postgres-interval", 26 | "raw": "postgres-interval@~1.0.0", 27 | "rawSpec": "~1.0.0", 28 | "scope": null, 29 | "spec": ">=1.0.0 <1.1.0", 30 | "type": "range" 31 | }, 32 | "_requiredBy": [ 33 | "/pg-types" 34 | ], 35 | "_resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.0.2.tgz", 36 | "_shasum": "7261438d862b412921c6fdb7617668424b73a6ed", 37 | "_shrinkwrap": null, 38 | "_spec": "postgres-interval@~1.0.0", 39 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg-types", 40 | "author": { 41 | "email": "bvdrucker@gmail.com", 42 | "name": "Ben Drucker", 43 | "url": "bendrucker.me" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/bendrucker/postgres-interval/issues" 47 | }, 48 | "dependencies": { 49 | "xtend": "^4.0.0" 50 | }, 51 | "description": "Parse Postgres interval columns", 52 | "devDependencies": { 53 | "standard": "^4.0.0", 54 | "tape": "^4.0.0" 55 | }, 56 | "directories": {}, 57 | "dist": { 58 | "shasum": "7261438d862b412921c6fdb7617668424b73a6ed", 59 | "tarball": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.0.2.tgz" 60 | }, 61 | "engines": { 62 | "node": ">=0.10.0" 63 | }, 64 | "files": [ 65 | "index.js", 66 | "readme.md" 67 | ], 68 | "gitHead": "171f36c53ce9a6f80d7e6b08579232946388de28", 69 | "homepage": "https://github.com/bendrucker/postgres-interval#readme", 70 | "keywords": [ 71 | "postgres", 72 | "interval", 73 | "parser" 74 | ], 75 | "license": "MIT", 76 | "main": "index.js", 77 | "maintainers": [ 78 | { 79 | "email": "bvdrucker@gmail.com", 80 | "name": "bendrucker" 81 | } 82 | ], 83 | "name": "postgres-interval", 84 | "optionalDependencies": {}, 85 | "readme": "ERROR: No README data found!", 86 | "repository": { 87 | "type": "git", 88 | "url": "git+https://github.com/bendrucker/postgres-interval.git" 89 | }, 90 | "scripts": { 91 | "test": "standard && tape test.js" 92 | }, 93 | "version": "1.0.2" 94 | } 95 | -------------------------------------------------------------------------------- /node_modules/postgres-interval/readme.md: -------------------------------------------------------------------------------- 1 | # postgres-interval [![Build Status](https://travis-ci.org/bendrucker/postgres-interval.svg?branch=master)](https://travis-ci.org/bendrucker/postgres-interval) 2 | 3 | > Parse Postgres interval columns 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save postgres-interval 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var parse = require('postgres-interval') 17 | var interval = parse('01:02:03') 18 | //=> {hours: 1, minutes: 2, seconds: 3} 19 | interval.toPostgres() 20 | // 3 seconds 2 minutes 1 hours 21 | ``` 22 | 23 | ## API 24 | 25 | #### `parse(pgInterval)` -> `interval` 26 | 27 | ##### pgInterval 28 | 29 | *Required* 30 | Type: `string` 31 | 32 | A Postgres interval string. 33 | 34 | #### `interval.toPostgres()` -> `string` 35 | 36 | Returns an interval string. This allows the interval object to be passed into prepared statements. 37 | 38 | ## License 39 | 40 | MIT © [Ben Drucker](http://bendrucker.me) 41 | -------------------------------------------------------------------------------- /node_modules/semver/.npmignore: -------------------------------------------------------------------------------- 1 | # nada 2 | -------------------------------------------------------------------------------- /node_modules/semver/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/semver/Makefile: -------------------------------------------------------------------------------- 1 | files = semver.browser.js \ 2 | semver.min.js \ 3 | semver.browser.js.gz \ 4 | semver.min.js.gz 5 | 6 | all: $(files) 7 | 8 | clean: 9 | rm -f $(files) 10 | 11 | semver.browser.js: head.js.txt semver.js foot.js.txt 12 | ( cat head.js.txt; \ 13 | cat semver.js | \ 14 | egrep -v '^ *\/\* nomin \*\/' | \ 15 | perl -pi -e 's/debug\([^\)]+\)//g'; \ 16 | cat foot.js.txt ) > semver.browser.js 17 | 18 | semver.min.js: semver.browser.js 19 | uglifyjs -m semver.min.js 20 | 21 | %.gz: % 22 | gzip --stdout -9 <$< >$@ 23 | 24 | .PHONY: all clean 25 | -------------------------------------------------------------------------------- /node_modules/semver/foot.js.txt: -------------------------------------------------------------------------------- 1 | 2 | })( 3 | typeof exports === 'object' ? exports : 4 | typeof define === 'function' && define.amd ? {} : 5 | semver = {} 6 | ); 7 | -------------------------------------------------------------------------------- /node_modules/semver/head.js.txt: -------------------------------------------------------------------------------- 1 | ;(function(exports) { 2 | 3 | -------------------------------------------------------------------------------- /node_modules/semver/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "semver@4.3.2", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pg" 6 | ] 7 | ], 8 | "_from": "semver@4.3.2", 9 | "_id": "semver@4.3.2", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/semver", 13 | "_nodeVersion": "1.4.2", 14 | "_npmUser": { 15 | "email": "isaacs@npmjs.com", 16 | "name": "isaacs" 17 | }, 18 | "_npmVersion": "2.7.4", 19 | "_phantomChildren": {}, 20 | "_requested": { 21 | "name": "semver", 22 | "raw": "semver@4.3.2", 23 | "rawSpec": "4.3.2", 24 | "scope": null, 25 | "spec": "4.3.2", 26 | "type": "version" 27 | }, 28 | "_requiredBy": [ 29 | "/pg" 30 | ], 31 | "_resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz", 32 | "_shasum": "c7a07158a80bedd052355b770d82d6640f803be7", 33 | "_shrinkwrap": null, 34 | "_spec": "semver@4.3.2", 35 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pg", 36 | "bin": { 37 | "semver": "./bin/semver" 38 | }, 39 | "browser": "semver.browser.js", 40 | "bugs": { 41 | "url": "https://github.com/npm/node-semver/issues" 42 | }, 43 | "dependencies": {}, 44 | "description": "The semantic version parser used by npm.", 45 | "devDependencies": { 46 | "tap": "0.x >=0.0.4", 47 | "uglify-js": "~2.3.6" 48 | }, 49 | "directories": {}, 50 | "dist": { 51 | "shasum": "c7a07158a80bedd052355b770d82d6640f803be7", 52 | "tarball": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz" 53 | }, 54 | "gitHead": "22e583cc12d21b80bd7175b64ebe55890aa34e46", 55 | "homepage": "https://github.com/npm/node-semver", 56 | "license": "BSD", 57 | "main": "semver.js", 58 | "maintainers": [ 59 | { 60 | "email": "i@izs.me", 61 | "name": "isaacs" 62 | }, 63 | { 64 | "email": "ogd@aoaioxxysz.net", 65 | "name": "othiym23" 66 | } 67 | ], 68 | "min": "semver.min.js", 69 | "name": "semver", 70 | "optionalDependencies": {}, 71 | "readme": "ERROR: No README data found!", 72 | "repository": { 73 | "type": "git", 74 | "url": "git://github.com/npm/node-semver.git" 75 | }, 76 | "scripts": { 77 | "prepublish": "make", 78 | "test": "tap test/*.js" 79 | }, 80 | "version": "4.3.2" 81 | } 82 | -------------------------------------------------------------------------------- /node_modules/semver/semver.browser.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmanjunath/node-redshift/fe0bf8f753d7edc7e8748c4c7de0f099ba56c6f1/node_modules/semver/semver.browser.js.gz -------------------------------------------------------------------------------- /node_modules/semver/semver.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmanjunath/node-redshift/fe0bf8f753d7edc7e8748c4c7de0f099ba56c6f1/node_modules/semver/semver.min.js.gz -------------------------------------------------------------------------------- /node_modules/semver/test/amd.js: -------------------------------------------------------------------------------- 1 | var tap = require('tap'); 2 | var test = tap.test; 3 | 4 | test('amd', function(t) { 5 | global.define = define; 6 | define.amd = true; 7 | var defined = null; 8 | function define(stuff) { 9 | defined = stuff; 10 | } 11 | var fromRequire = require('../'); 12 | t.ok(defined, 'amd function called'); 13 | t.equal(fromRequire, defined, 'amd stuff same as require stuff'); 14 | t.end(); 15 | }); 16 | -------------------------------------------------------------------------------- /node_modules/semver/test/big-numbers.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var semver = require('../') 3 | 4 | test('long version is too long', function (t) { 5 | var v = '1.2.' + new Array(256).join('1') 6 | t.throws(function () { 7 | new semver.SemVer(v) 8 | }) 9 | t.equal(semver.valid(v, false), null) 10 | t.equal(semver.valid(v, true), null) 11 | t.equal(semver.inc(v, 'patch'), null) 12 | t.end() 13 | }) 14 | 15 | test('big number is like too long version', function (t) { 16 | var v = '1.2.' + new Array(100).join('1') 17 | t.throws(function () { 18 | new semver.SemVer(v) 19 | }) 20 | t.equal(semver.valid(v, false), null) 21 | t.equal(semver.valid(v, true), null) 22 | t.equal(semver.inc(v, 'patch'), null) 23 | t.end() 24 | }) 25 | -------------------------------------------------------------------------------- /node_modules/semver/test/clean.js: -------------------------------------------------------------------------------- 1 | var tap = require('tap'); 2 | var test = tap.test; 3 | var semver = require('../semver.js'); 4 | var clean = semver.clean; 5 | 6 | test('\nclean tests', function(t) { 7 | // [range, version] 8 | // Version should be detectable despite extra characters 9 | [ 10 | ['1.2.3', '1.2.3'], 11 | [' 1.2.3 ', '1.2.3'], 12 | [' 1.2.3-4 ', '1.2.3-4'], 13 | [' 1.2.3-pre ', '1.2.3-pre'], 14 | [' =v1.2.3 ', '1.2.3'], 15 | ['v1.2.3', '1.2.3'], 16 | [' v1.2.3 ', '1.2.3'], 17 | ['\t1.2.3', '1.2.3'], 18 | ['>1.2.3', null], 19 | ['~1.2.3', null], 20 | ['<=1.2.3', null], 21 | ['1.2.x', null] 22 | ].forEach(function(tuple) { 23 | var range = tuple[0]; 24 | var version = tuple[1]; 25 | var msg = 'clean(' + range + ') = ' + version; 26 | t.equal(clean(range), version, msg); 27 | }); 28 | t.end(); 29 | }); 30 | -------------------------------------------------------------------------------- /node_modules/semver/test/major-minor-patch.js: -------------------------------------------------------------------------------- 1 | var tap = require('tap'); 2 | var test = tap.test; 3 | var semver = require('../semver.js'); 4 | 5 | test('\nmajor tests', function(t) { 6 | // [range, version] 7 | // Version should be detectable despite extra characters 8 | [ 9 | ['1.2.3', 1], 10 | [' 1.2.3 ', 1], 11 | [' 2.2.3-4 ', 2], 12 | [' 3.2.3-pre ', 3], 13 | ['v5.2.3', 5], 14 | [' v8.2.3 ', 8], 15 | ['\t13.2.3', 13], 16 | ['=21.2.3', 21, true], 17 | ['v=34.2.3', 34, true] 18 | ].forEach(function(tuple) { 19 | var range = tuple[0]; 20 | var version = tuple[1]; 21 | var loose = tuple[2] || false; 22 | var msg = 'major(' + range + ') = ' + version; 23 | t.equal(semver.major(range, loose), version, msg); 24 | }); 25 | t.end(); 26 | }); 27 | 28 | test('\nminor tests', function(t) { 29 | // [range, version] 30 | // Version should be detectable despite extra characters 31 | [ 32 | ['1.1.3', 1], 33 | [' 1.1.3 ', 1], 34 | [' 1.2.3-4 ', 2], 35 | [' 1.3.3-pre ', 3], 36 | ['v1.5.3', 5], 37 | [' v1.8.3 ', 8], 38 | ['\t1.13.3', 13], 39 | ['=1.21.3', 21, true], 40 | ['v=1.34.3', 34, true] 41 | ].forEach(function(tuple) { 42 | var range = tuple[0]; 43 | var version = tuple[1]; 44 | var loose = tuple[2] || false; 45 | var msg = 'minor(' + range + ') = ' + version; 46 | t.equal(semver.minor(range, loose), version, msg); 47 | }); 48 | t.end(); 49 | }); 50 | 51 | test('\npatch tests', function(t) { 52 | // [range, version] 53 | // Version should be detectable despite extra characters 54 | [ 55 | ['1.2.1', 1], 56 | [' 1.2.1 ', 1], 57 | [' 1.2.2-4 ', 2], 58 | [' 1.2.3-pre ', 3], 59 | ['v1.2.5', 5], 60 | [' v1.2.8 ', 8], 61 | ['\t1.2.13', 13], 62 | ['=1.2.21', 21, true], 63 | ['v=1.2.34', 34, true] 64 | ].forEach(function(tuple) { 65 | var range = tuple[0]; 66 | var version = tuple[1]; 67 | var loose = tuple[2] || false; 68 | var msg = 'patch(' + range + ') = ' + version; 69 | t.equal(semver.patch(range, loose), version, msg); 70 | }); 71 | t.end(); 72 | }); 73 | -------------------------------------------------------------------------------- /node_modules/semver/test/no-module.js: -------------------------------------------------------------------------------- 1 | var tap = require('tap'); 2 | var test = tap.test; 3 | 4 | test('no module system', function(t) { 5 | var fs = require('fs'); 6 | var vm = require('vm'); 7 | var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); 8 | var src = fs.readFileSync(require.resolve('../'), 'utf8'); 9 | var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); 10 | vm.runInThisContext(head + src + foot, 'semver.js'); 11 | 12 | // just some basic poking to see if it did some stuff 13 | t.type(global.semver, 'object'); 14 | t.type(global.semver.SemVer, 'function'); 15 | t.type(global.semver.Range, 'function'); 16 | t.ok(global.semver.satisfies('1.2.3', '1.2')); 17 | t.end(); 18 | }); 19 | 20 | -------------------------------------------------------------------------------- /node_modules/split/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | node_modules/* 3 | npm_debug.log 4 | -------------------------------------------------------------------------------- /node_modules/split/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /node_modules/split/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Dominic Tarr 2 | 3 | Permission is hereby granted, free of charge, 4 | to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to 6 | deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, 8 | merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom 10 | the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 20 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/split/examples/pretty.js: -------------------------------------------------------------------------------- 1 | 2 | var inspect = require('util').inspect 3 | var es = require('event-stream') //load event-stream 4 | var split = require('../') 5 | 6 | if(!module.parent) { 7 | es.pipe( //pipe joins streams together 8 | process.openStdin(), //open stdin 9 | split(), //split stream to break on newlines 10 | es.map(function (data, callback) {//turn this async function into a stream 11 | var j 12 | try { 13 | j = JSON.parse(data) //try to parse input into json 14 | } catch (err) { 15 | return callback(null, data) //if it fails just pass it anyway 16 | } 17 | callback(null, inspect(j)) //render it nicely 18 | }), 19 | process.stdout // pipe it to stdout ! 20 | ) 21 | } 22 | 23 | // run this 24 | // 25 | // curl -sS registry.npmjs.org/event-stream | node pretty.js 26 | // 27 | -------------------------------------------------------------------------------- /node_modules/split/index.js: -------------------------------------------------------------------------------- 1 | //filter will reemit the data if cb(err,pass) pass is truthy 2 | 3 | // reduce is more tricky 4 | // maybe we want to group the reductions or emit progress updates occasionally 5 | // the most basic reduce just emits one 'data' event after it has recieved 'end' 6 | 7 | 8 | var through = require('through') 9 | var Decoder = require('string_decoder').StringDecoder 10 | 11 | module.exports = split 12 | 13 | //TODO pass in a function to map across the lines. 14 | 15 | function split (matcher, mapper, options) { 16 | var decoder = new Decoder() 17 | var soFar = '' 18 | var maxLength = options && options.maxLength; 19 | var trailing = options && options.trailing === false ? false : true 20 | if('function' === typeof matcher) 21 | mapper = matcher, matcher = null 22 | if (!matcher) 23 | matcher = /\r?\n/ 24 | 25 | function emit(stream, piece) { 26 | if(mapper) { 27 | try { 28 | piece = mapper(piece) 29 | } 30 | catch (err) { 31 | return stream.emit('error', err) 32 | } 33 | if('undefined' !== typeof piece) 34 | stream.queue(piece) 35 | } 36 | else 37 | stream.queue(piece) 38 | } 39 | 40 | function next (stream, buffer) { 41 | var pieces = ((soFar != null ? soFar : '') + buffer).split(matcher) 42 | soFar = pieces.pop() 43 | 44 | if (maxLength && soFar.length > maxLength) 45 | stream.emit('error', new Error('maximum buffer reached')) 46 | 47 | for (var i = 0; i < pieces.length; i++) { 48 | var piece = pieces[i] 49 | emit(stream, piece) 50 | } 51 | } 52 | 53 | return through(function (b) { 54 | next(this, decoder.write(b)) 55 | }, 56 | function () { 57 | if(decoder.end) 58 | next(this, decoder.end()) 59 | if(trailing && soFar != null) 60 | emit(this, soFar) 61 | this.queue(null) 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/split/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "split@^1.0.0", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/pgpass" 6 | ] 7 | ], 8 | "_from": "split@>=1.0.0 <2.0.0", 9 | "_id": "split@1.0.0", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/split", 13 | "_npmUser": { 14 | "email": "dominic.tarr@gmail.com", 15 | "name": "dominictarr" 16 | }, 17 | "_npmVersion": "1.4.28", 18 | "_phantomChildren": {}, 19 | "_requested": { 20 | "name": "split", 21 | "raw": "split@^1.0.0", 22 | "rawSpec": "^1.0.0", 23 | "scope": null, 24 | "spec": ">=1.0.0 <2.0.0", 25 | "type": "range" 26 | }, 27 | "_requiredBy": [ 28 | "/pgpass" 29 | ], 30 | "_resolved": "https://registry.npmjs.org/split/-/split-1.0.0.tgz", 31 | "_shasum": "c4395ce683abcd254bc28fe1dabb6e5c27dcffae", 32 | "_shrinkwrap": null, 33 | "_spec": "split@^1.0.0", 34 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/pgpass", 35 | "author": { 36 | "email": "dominic.tarr@gmail.com", 37 | "name": "Dominic Tarr", 38 | "url": "http://bit.ly/dominictarr" 39 | }, 40 | "bugs": { 41 | "url": "https://github.com/dominictarr/split/issues" 42 | }, 43 | "dependencies": { 44 | "through": "2" 45 | }, 46 | "description": "split a Text Stream into a Line Stream", 47 | "devDependencies": { 48 | "asynct": "*", 49 | "event-stream": "~3.0.2", 50 | "it-is": "1", 51 | "stream-spec": "~0.2", 52 | "string-to-stream": "~1.0.0", 53 | "ubelt": "~2.9" 54 | }, 55 | "directories": {}, 56 | "dist": { 57 | "shasum": "c4395ce683abcd254bc28fe1dabb6e5c27dcffae", 58 | "tarball": "https://registry.npmjs.org/split/-/split-1.0.0.tgz" 59 | }, 60 | "engines": { 61 | "node": "*" 62 | }, 63 | "gitHead": "08b99aafdd40ec84aa88ac29eb808c70a2ecb549", 64 | "homepage": "http://github.com/dominictarr/split", 65 | "license": "MIT", 66 | "maintainers": [ 67 | { 68 | "email": "dominic.tarr@gmail.com", 69 | "name": "dominictarr" 70 | } 71 | ], 72 | "name": "split", 73 | "optionalDependencies": {}, 74 | "readme": "ERROR: No README data found!", 75 | "repository": { 76 | "type": "git", 77 | "url": "git://github.com/dominictarr/split.git" 78 | }, 79 | "scripts": { 80 | "test": "asynct test/" 81 | }, 82 | "version": "1.0.0" 83 | } 84 | -------------------------------------------------------------------------------- /node_modules/split/readme.markdown: -------------------------------------------------------------------------------- 1 | # Split (matcher) 2 | 3 | [![build status](https://secure.travis-ci.org/dominictarr/split.png)](http://travis-ci.org/dominictarr/split) 4 | 5 | Break up a stream and reassemble it so that each line is a chunk. matcher may be a `String`, or a `RegExp` 6 | 7 | Example, read every line in a file ... 8 | 9 | ``` js 10 | fs.createReadStream(file) 11 | .pipe(split()) 12 | .on('data', function (line) { 13 | //each chunk now is a seperate line! 14 | }) 15 | 16 | ``` 17 | 18 | `split` takes the same arguments as `string.split` except it defaults to '/\r?\n/' instead of ',', and the optional `limit` paremeter is ignored. 19 | [String#split](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/split) 20 | 21 | `split` takes an optional options object on it's third argument. 22 | 23 | ``` js 24 | split(matcher, mapper, options) 25 | ``` 26 | 27 | Valid options: 28 | 29 | * maxLength - The maximum buffer length without seeing a newline or `matcher`, 30 | if a single line exceeds this, the split stream will emit an error. 31 | 32 | ``` js 33 | split(JSON.parse, null, { maxLength: 2}) 34 | ``` 35 | 36 | * trailing - By default the last buffer not delimited by a newline or `matcher` will be emitted. To prevent this set `options.trailing` to `false`. 37 | 38 | ``` js 39 | split(JSON.parse, null, { trailing: false }) 40 | ``` 41 | 42 | ## keep matched splitter 43 | 44 | As with `Array#split`, if you split by a regular expression with a matching group, 45 | the matches will be retained in the collection. 46 | 47 | ``` 48 | stdin 49 | .pipe(split(/(\r?\n)/)) 50 | ... //lines + separators. 51 | ``` 52 | 53 | 54 | # NDJ - Newline Delimited Json 55 | 56 | `split` accepts a function which transforms each line. 57 | 58 | ``` js 59 | fs.createReadStream(file) 60 | .pipe(split(JSON.parse)) 61 | .on('data', function (obj) { 62 | //each chunk now is a a js object 63 | }) 64 | .on('error', function (err) { 65 | //syntax errors will land here 66 | //note, this ends the stream. 67 | }) 68 | ``` 69 | 70 | # License 71 | 72 | MIT 73 | -------------------------------------------------------------------------------- /node_modules/split/test/options.asynct.js: -------------------------------------------------------------------------------- 1 | var it = require('it-is').style('colour') 2 | , split = require('..') 3 | 4 | exports ['maximum buffer limit'] = function (test) { 5 | var s = split(JSON.parse, null, { 6 | maxLength: 2 7 | }) 8 | , caughtError = false 9 | , rows = [] 10 | 11 | s.on('error', function (err) { 12 | caughtError = true 13 | }) 14 | 15 | s.on('data', function (row) { rows.push(row) }) 16 | 17 | s.write('{"a":1}\n{"') 18 | s.write('{ "') 19 | it(caughtError).equal(true) 20 | 21 | s.end() 22 | test.done() 23 | } 24 | 25 | exports ['ignore trailing buffers'] = function (test) { 26 | var s = split(JSON.parse, null, { 27 | trailing: false 28 | }) 29 | , caughtError = false 30 | , rows = [] 31 | 32 | s.on('error', function (err) { 33 | caughtError = true 34 | }) 35 | 36 | s.on('data', function (row) { rows.push(row) }) 37 | 38 | s.write('{"a":1}\n{"') 39 | s.write('{ "') 40 | s.end() 41 | 42 | it(caughtError).equal(false) 43 | it(rows).deepEqual([ { a: 1 } ]) 44 | 45 | test.done() 46 | } 47 | -------------------------------------------------------------------------------- /node_modules/split/test/partitioned_unicode.js: -------------------------------------------------------------------------------- 1 | var it = require('it-is').style('colour') 2 | , split = require('..') 3 | 4 | exports ['split data with partitioned unicode character'] = function (test) { 5 | var s = split(/,/g) 6 | , caughtError = false 7 | , rows = [] 8 | 9 | s.on('error', function (err) { 10 | caughtError = true 11 | }) 12 | 13 | s.on('data', function (row) { rows.push(row) }) 14 | 15 | var x = 'テスト試験今日とても,よい天気で' 16 | unicodeData = new Buffer(x); 17 | 18 | // partition of 日 19 | piece1 = unicodeData.slice(0, 20); 20 | piece2 = unicodeData.slice(20, unicodeData.length); 21 | 22 | s.write(piece1); 23 | s.write(piece2); 24 | 25 | s.end() 26 | 27 | it(caughtError).equal(false) 28 | 29 | it(rows).deepEqual(['テスト試験今日とても', 'よい天気で']); 30 | 31 | it(rows).deepEqual(x.split(',')) 32 | 33 | test.done() 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/split/test/try_catch.asynct.js: -------------------------------------------------------------------------------- 1 | var it = require('it-is').style('colour') 2 | , split = require('..') 3 | 4 | exports ['emit mapper exceptions as error events'] = function (test) { 5 | var s = split(JSON.parse) 6 | , caughtError = false 7 | , rows = [] 8 | 9 | s.on('error', function (err) { 10 | caughtError = true 11 | }) 12 | 13 | s.on('data', function (row) { rows.push(row) }) 14 | 15 | s.write('{"a":1}\n{"') 16 | it(caughtError).equal(false) 17 | it(rows).deepEqual([ { a: 1 } ]) 18 | 19 | s.write('b":2}\n{"c":}\n') 20 | it(caughtError).equal(true) 21 | it(rows).deepEqual([ { a: 1 }, { b: 2 } ]) 22 | 23 | s.end() 24 | test.done() 25 | } 26 | 27 | exports ['mapper error events on trailing chunks'] = function (test) { 28 | var s = split(JSON.parse) 29 | , caughtError = false 30 | , rows = [] 31 | 32 | s.on('error', function (err) { 33 | caughtError = true 34 | }) 35 | 36 | s.on('data', function (row) { rows.push(row) }) 37 | 38 | s.write('{"a":1}\n{"') 39 | it(caughtError).equal(false) 40 | it(rows).deepEqual([ { a: 1 } ]) 41 | 42 | s.write('b":2}\n{"c":}') 43 | it(caughtError).equal(false) 44 | it(rows).deepEqual([ { a: 1 }, { b: 2 } ]) 45 | 46 | s.end() 47 | it(caughtError).equal(true) 48 | it(rows).deepEqual([ { a: 1 }, { b: 2 } ]) 49 | 50 | test.done() 51 | } 52 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4.1" 4 | - "4.0" 5 | - "0.12" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Cornerstone Systems NW 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/browser-tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha Tests 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | Rakefile 3 | docs/ 4 | raw/ 5 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | notifications: 5 | email: false 6 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/CNAME: -------------------------------------------------------------------------------- 1 | underscorejs.org 2 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute to Underscore.js 2 | 3 | * Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. 4 | 5 | * Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/). 6 | 7 | * Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). 8 | 9 | * In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. 10 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/README.md: -------------------------------------------------------------------------------- 1 | __ 2 | /\ \ __ 3 | __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ 4 | /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ 5 | \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ 6 | \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ 7 | \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ 8 | \ \____/ 9 | \/___/ 10 | 11 | Underscore.js is a utility-belt library for JavaScript that provides 12 | support for the usual functional suspects (each, map, reduce, filter...) 13 | without extending any core JavaScript objects. 14 | 15 | For Docs, License, Tests, and pre-packed downloads, see: 16 | http://underscorejs.org 17 | 18 | Many thanks to our contributors: 19 | https://github.com/documentcloud/underscore/contributors 20 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmanjunath/node-redshift/fe0bf8f753d7edc7e8748c4c7de0f099ba56c6f1/node_modules/sql-bricks/node_modules/underscore/favicon.ico -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./underscore'); 2 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/node_modules/underscore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "underscore", 3 | "description": "JavaScript's functional programming helper library.", 4 | "homepage": "http://underscorejs.org", 5 | "keywords": [ 6 | "util", 7 | "functional", 8 | "server", 9 | "client", 10 | "browser" 11 | ], 12 | "author": { 13 | "name": "Jeremy Ashkenas", 14 | "email": "jeremy@documentcloud.org" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git://github.com/documentcloud/underscore.git" 19 | }, 20 | "main": "underscore.js", 21 | "version": "1.4.4", 22 | "devDependencies": { 23 | "phantomjs": "0.2.2" 24 | }, 25 | "scripts": { 26 | "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" 27 | }, 28 | "_id": "underscore@1.4.4", 29 | "dist": { 30 | "shasum": "61a6a32010622afa07963bf325203cf12239d604", 31 | "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" 32 | }, 33 | "_npmVersion": "1.1.63", 34 | "_npmUser": { 35 | "name": "jashkenas", 36 | "email": "jashkenas@gmail.com" 37 | }, 38 | "maintainers": [ 39 | { 40 | "name": "jashkenas", 41 | "email": "jashkenas@gmail.com" 42 | } 43 | ], 44 | "directories": {}, 45 | "_shasum": "61a6a32010622afa07963bf325203cf12239d604", 46 | "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", 47 | "_from": "underscore@>=1.4.0 <1.5.0", 48 | "bugs": { 49 | "url": "https://github.com/documentcloud/underscore/issues" 50 | }, 51 | "readme": "ERROR: No README data found!" 52 | } 53 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sql-bricks", 3 | "version": "1.2.3", 4 | "author": { 5 | "name": "Peter Rust", 6 | "email": "peter@cornerstonenw.com" 7 | }, 8 | "description": "Transparent, Schemaless SQL Generation", 9 | "homepage": "http://csnw.github.io/sql-bricks", 10 | "bugs": { 11 | "url": "https://github.com/CSNW/sql-bricks/issues" 12 | }, 13 | "scripts": { 14 | "prepublish": "node tests/gen-tests.js", 15 | "test": "mocha tests/tests.js tests/doctests.js && mocha tests/tests.js tests/doctests.js --empty-extension" 16 | }, 17 | "main": "sql-bricks.js", 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/CSNW/sql-bricks.git" 21 | }, 22 | "keywords": [ 23 | "sql", 24 | "generation", 25 | "generate", 26 | "query", 27 | "pg", 28 | "postgres", 29 | "sqlite", 30 | "builder", 31 | "select", 32 | "insert", 33 | "update", 34 | "delete" 35 | ], 36 | "engines": { 37 | "node": "*" 38 | }, 39 | "dependencies": { 40 | "underscore": "1.4.x" 41 | }, 42 | "devDependencies": { 43 | "mocha": "1.13.x" 44 | }, 45 | "license": "MIT", 46 | "testling": { 47 | "html": "browser-tests.html", 48 | "browsers": [ 49 | "chrome/29.0", 50 | "iexplore/8.0", 51 | "iexplore/9.0", 52 | "iexplore/10.0", 53 | "firefox/4.0", 54 | "firefox/6.0", 55 | "firefox/24.0", 56 | "safari/6.0", 57 | "iphone/6.0", 58 | "ipad/6.0", 59 | "android-browser/4.2" 60 | ] 61 | }, 62 | "gitHead": "284a9a54a9f991064600fbdd0666cca6012952d1", 63 | "_id": "sql-bricks@1.2.3", 64 | "_shasum": "cc485d6730cf4654cdd53e23feb9aaad334b9c56", 65 | "_from": "sql-bricks@*", 66 | "_npmVersion": "2.8.3", 67 | "_nodeVersion": "0.10.38", 68 | "_npmUser": { 69 | "name": "prust", 70 | "email": "peter@cornerstonenw.com" 71 | }, 72 | "dist": { 73 | "shasum": "cc485d6730cf4654cdd53e23feb9aaad334b9c56", 74 | "tarball": "http://registry.npmjs.org/sql-bricks/-/sql-bricks-1.2.3.tgz" 75 | }, 76 | "maintainers": [ 77 | { 78 | "name": "prust", 79 | "email": "peter@cornerstonenw.com" 80 | } 81 | ], 82 | "directories": {}, 83 | "_resolved": "https://registry.npmjs.org/sql-bricks/-/sql-bricks-1.2.3.tgz" 84 | } 85 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/tests/doctests.tmpl: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | var is_common_js = typeof exports != 'undefined'; 4 | var _ = is_common_js ? require('underscore') : window._; 5 | var sql = is_common_js ? require('../sql-bricks.js') : window.SqlBricks; 6 | 7 | if (is_common_js) { 8 | var args = process.argv; 9 | if (args[args.length - 1] == '--empty-extension') { 10 | console.log('doctests configured with an empty extension'); 11 | sql = sql._extension(); 12 | } 13 | } 14 | 15 | var assert; 16 | if (is_common_js) { 17 | assert = require('assert'); 18 | } 19 | else { 20 | assert = { 21 | 'equal': function(actual, expected) { 22 | if (actual != expected) throw new Error(JSON.stringify(actual) + ' == ' + JSON.stringify(expected)); 23 | }, 24 | 'deepEqual': function(actual, expected) { 25 | if (!_.isEqual(actual, expected)) throw new Error(JSON.stringify(actual) + ' == ' + JSON.stringify(expected)); 26 | } 27 | }; 28 | } 29 | 30 | var select = sql.select, insertInto = sql.insertInto, insert = sql.insert, 31 | update = sql.update, del = sql.delete, replace = sql.replace; 32 | var and = sql.and, or = sql.or, like = sql.like, not = sql.not, $in = sql.in, 33 | isNull = sql.isNull, isNotNull = sql.isNotNull, equal = sql.equal, 34 | lt = sql.lt, lte = sql.lte, gt = sql.gt, gte = sql.gte, between = sql.between, 35 | exists = sql.exists, eqAny = sql.eqAny; 36 | 37 | describe('SQL Bricks', function() { 38 | describe('documentation examples', function() { 39 | 40 | 41 | {{tests}} 42 | 43 | 44 | }); 45 | }); 46 | 47 | function check(actual, expected) { 48 | if (_.isObject(actual)) 49 | assert.equal(actual.toString(), expected); 50 | else 51 | assert.deepEqual(actual, expected); 52 | } 53 | 54 | })(); 55 | -------------------------------------------------------------------------------- /node_modules/sql-bricks/tests/gen-tests.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var _ = require('underscore'); 3 | 4 | var comment = '// '; 5 | var readme = fs.readFileSync(__dirname + '/../index.html', 'utf8'); 6 | var contents = ''; 7 | readme.match(/
[^<]+<\/pre>/g).forEach(function(ex) {
 8 |   ex = ex.slice('
'.length, -'
'.length); 9 | var lines = _.compact(ex.split('\n')); 10 | lines.forEach(function(line, ix) { 11 | line = line.trim(); 12 | var next_line = (lines[ix + 1] || '').trim(); 13 | 14 | if (isComment(line) && !isComment(next_line)) { 15 | var expected = getExpected(lines, ix); 16 | var code = wrap(lines.slice(0, ix)); 17 | var last_line = desc = code[code.length - 1].replace(/\r/g, ''); 18 | if (last_line.slice(-1) == ';') 19 | last_line = last_line.slice(0, -1); 20 | 21 | if (expected[0] != '{') 22 | expected = '"' + expected.replace(/"/g, '\\"') + '"'; 23 | expected = expected.replace(/</g, '<'); 24 | if (last_line[0] == ' ') { 25 | last_line = code[code.length - 2] + last_line; 26 | code[code.length - 2] = ''; 27 | } 28 | 29 | code[code.length - 1] = 'check(' + last_line + ', ' + expected + ');'; 30 | contents += 'it("' + desc.replace(/"/g, '\\"').trim() + '", function() {'; 31 | contents += code.join('\n') + '\n'; 32 | contents += '});\n\n'; 33 | } 34 | }); 35 | }); 36 | var tmpl = fs.readFileSync(__dirname + '/doctests.tmpl', 'utf8'); 37 | fs.writeFileSync(__dirname + '/doctests.js', tmpl.replace('{{tests}}', contents)); 38 | 39 | function wrap(lines) { 40 | var last_line = lines[lines.length - 1]; 41 | var match = /var (\w+) =/.exec(last_line); 42 | if (match) 43 | lines.push(match[1] + ';'); 44 | lines = _.compact(lines); 45 | lines = _.reject(lines, isComment); 46 | return lines; 47 | } 48 | function isComment(str) { 49 | return str.slice(0, comment.length) == comment; 50 | } 51 | function trimComment(str) { 52 | return str.slice(comment.length); 53 | } 54 | function getExpected(lines, ix) { 55 | var comments = []; 56 | while (isComment(lines[ix])) { 57 | comments.push(trimComment(lines[ix])); 58 | ix--; 59 | } 60 | comments.reverse(); 61 | comments = _.invoke(comments, 'trim'); 62 | return comments.join(' '); 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/through/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | - "0.10" 6 | -------------------------------------------------------------------------------- /node_modules/through/LICENSE.APACHE2: -------------------------------------------------------------------------------- 1 | Apache License, Version 2.0 2 | 3 | Copyright (c) 2011 Dominic Tarr 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | -------------------------------------------------------------------------------- /node_modules/through/LICENSE.MIT: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 Dominic Tarr 4 | 5 | Permission is hereby granted, free of charge, 6 | to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to 8 | deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, 10 | merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom 12 | the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice 16 | shall be included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /node_modules/through/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "through@2", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/split" 6 | ] 7 | ], 8 | "_from": "through@>=2.0.0 <3.0.0", 9 | "_id": "through@2.3.8", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/through", 13 | "_nodeVersion": "2.3.1", 14 | "_npmUser": { 15 | "email": "dominic.tarr@gmail.com", 16 | "name": "dominictarr" 17 | }, 18 | "_npmVersion": "2.12.0", 19 | "_phantomChildren": {}, 20 | "_requested": { 21 | "name": "through", 22 | "raw": "through@2", 23 | "rawSpec": "2", 24 | "scope": null, 25 | "spec": ">=2.0.0 <3.0.0", 26 | "type": "range" 27 | }, 28 | "_requiredBy": [ 29 | "/split" 30 | ], 31 | "_resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 32 | "_shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", 33 | "_shrinkwrap": null, 34 | "_spec": "through@2", 35 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/split", 36 | "author": { 37 | "email": "dominic.tarr@gmail.com", 38 | "name": "Dominic Tarr", 39 | "url": "dominictarr.com" 40 | }, 41 | "bugs": { 42 | "url": "https://github.com/dominictarr/through/issues" 43 | }, 44 | "dependencies": {}, 45 | "description": "simplified stream construction", 46 | "devDependencies": { 47 | "from": "~0.1.3", 48 | "stream-spec": "~0.3.5", 49 | "tape": "~2.3.2" 50 | }, 51 | "directories": {}, 52 | "dist": { 53 | "shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", 54 | "tarball": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" 55 | }, 56 | "gitHead": "2c5a6f9a0cc54da759b6e10964f2081c358e49dc", 57 | "homepage": "https://github.com/dominictarr/through", 58 | "keywords": [ 59 | "stream", 60 | "streams", 61 | "user-streams", 62 | "pipe" 63 | ], 64 | "license": "MIT", 65 | "main": "index.js", 66 | "maintainers": [ 67 | { 68 | "email": "dominic.tarr@gmail.com", 69 | "name": "dominictarr" 70 | } 71 | ], 72 | "name": "through", 73 | "optionalDependencies": {}, 74 | "readme": "ERROR: No README data found!", 75 | "repository": { 76 | "type": "git", 77 | "url": "git+https://github.com/dominictarr/through.git" 78 | }, 79 | "scripts": { 80 | "test": "set -e; for t in test/*.js; do node $t; done" 81 | }, 82 | "testling": { 83 | "browsers": [ 84 | "ie/8..latest", 85 | "ff/15..latest", 86 | "chrome/20..latest", 87 | "safari/5.1..latest" 88 | ], 89 | "files": "test/*.js" 90 | }, 91 | "version": "2.3.8" 92 | } 93 | -------------------------------------------------------------------------------- /node_modules/through/readme.markdown: -------------------------------------------------------------------------------- 1 | #through 2 | 3 | [![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through) 4 | [![testling badge](https://ci.testling.com/dominictarr/through.png)](https://ci.testling.com/dominictarr/through) 5 | 6 | Easy way to create a `Stream` that is both `readable` and `writable`. 7 | 8 | * Pass in optional `write` and `end` methods. 9 | * `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`. 10 | * Use `this.pause()` and `this.resume()` to manage flow. 11 | * Check `this.paused` to see current flow state. (`write` always returns `!this.paused`). 12 | 13 | This function is the basis for most of the synchronous streams in 14 | [event-stream](http://github.com/dominictarr/event-stream). 15 | 16 | ``` js 17 | var through = require('through') 18 | 19 | through(function write(data) { 20 | this.queue(data) //data *must* not be null 21 | }, 22 | function end () { //optional 23 | this.queue(null) 24 | }) 25 | ``` 26 | 27 | Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`, 28 | and this.emit('end') 29 | 30 | ``` js 31 | var through = require('through') 32 | 33 | through(function write(data) { 34 | this.emit('data', data) 35 | //this.pause() 36 | }, 37 | function end () { //optional 38 | this.emit('end') 39 | }) 40 | ``` 41 | 42 | ## Extended Options 43 | 44 | You will probably not need these 99% of the time. 45 | 46 | ### autoDestroy=false 47 | 48 | By default, `through` emits close when the writable 49 | and readable side of the stream has ended. 50 | If that is not desired, set `autoDestroy=false`. 51 | 52 | ``` js 53 | var through = require('through') 54 | 55 | //like this 56 | var ts = through(write, end, {autoDestroy: false}) 57 | //or like this 58 | var ts = through(write, end) 59 | ts.autoDestroy = false 60 | ``` 61 | 62 | ## License 63 | 64 | MIT / Apache2 65 | -------------------------------------------------------------------------------- /node_modules/through/test/async.js: -------------------------------------------------------------------------------- 1 | var from = require('from') 2 | var through = require('../') 3 | 4 | var tape = require('tape') 5 | 6 | tape('simple async example', function (t) { 7 | 8 | var n = 0, expected = [1,2,3,4,5], actual = [] 9 | from(expected) 10 | .pipe(through(function(data) { 11 | this.pause() 12 | n ++ 13 | setTimeout(function(){ 14 | console.log('pushing data', data) 15 | this.push(data) 16 | this.resume() 17 | }.bind(this), 300) 18 | })).pipe(through(function(data) { 19 | console.log('pushing data second time', data); 20 | this.push(data) 21 | })).on('data', function (d) { 22 | actual.push(d) 23 | }).on('end', function() { 24 | t.deepEqual(actual, expected) 25 | t.end() 26 | }) 27 | 28 | }) 29 | -------------------------------------------------------------------------------- /node_modules/through/test/auto-destroy.js: -------------------------------------------------------------------------------- 1 | var test = require('tape') 2 | var through = require('../') 3 | 4 | // must emit end before close. 5 | 6 | test('end before close', function (assert) { 7 | var ts = through() 8 | ts.autoDestroy = false 9 | var ended = false, closed = false 10 | 11 | ts.on('end', function () { 12 | assert.ok(!closed) 13 | ended = true 14 | }) 15 | ts.on('close', function () { 16 | assert.ok(ended) 17 | closed = true 18 | }) 19 | 20 | ts.write(1) 21 | ts.write(2) 22 | ts.write(3) 23 | ts.end() 24 | assert.ok(ended) 25 | assert.notOk(closed) 26 | ts.destroy() 27 | assert.ok(closed) 28 | assert.end() 29 | }) 30 | 31 | -------------------------------------------------------------------------------- /node_modules/through/test/buffering.js: -------------------------------------------------------------------------------- 1 | var test = require('tape') 2 | var through = require('../') 3 | 4 | // must emit end before close. 5 | 6 | test('buffering', function(assert) { 7 | var ts = through(function (data) { 8 | this.queue(data) 9 | }, function () { 10 | this.queue(null) 11 | }) 12 | 13 | var ended = false, actual = [] 14 | 15 | ts.on('data', actual.push.bind(actual)) 16 | ts.on('end', function () { 17 | ended = true 18 | }) 19 | 20 | ts.write(1) 21 | ts.write(2) 22 | ts.write(3) 23 | assert.deepEqual(actual, [1, 2, 3]) 24 | ts.pause() 25 | ts.write(4) 26 | ts.write(5) 27 | ts.write(6) 28 | assert.deepEqual(actual, [1, 2, 3]) 29 | ts.resume() 30 | assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]) 31 | ts.pause() 32 | ts.end() 33 | assert.ok(!ended) 34 | ts.resume() 35 | assert.ok(ended) 36 | assert.end() 37 | }) 38 | 39 | test('buffering has data in queue, when ends', function (assert) { 40 | 41 | /* 42 | * If stream ends while paused with data in the queue, 43 | * stream should still emit end after all data is written 44 | * on resume. 45 | */ 46 | 47 | var ts = through(function (data) { 48 | this.queue(data) 49 | }, function () { 50 | this.queue(null) 51 | }) 52 | 53 | var ended = false, actual = [] 54 | 55 | ts.on('data', actual.push.bind(actual)) 56 | ts.on('end', function () { 57 | ended = true 58 | }) 59 | 60 | ts.pause() 61 | ts.write(1) 62 | ts.write(2) 63 | ts.write(3) 64 | ts.end() 65 | assert.deepEqual(actual, [], 'no data written yet, still paused') 66 | assert.ok(!ended, 'end not emitted yet, still paused') 67 | ts.resume() 68 | assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered') 69 | assert.ok(ended, 'end should be emitted once all data was delivered') 70 | assert.end(); 71 | }) 72 | -------------------------------------------------------------------------------- /node_modules/through/test/end.js: -------------------------------------------------------------------------------- 1 | var test = require('tape') 2 | var through = require('../') 3 | 4 | // must emit end before close. 5 | 6 | test('end before close', function (assert) { 7 | var ts = through() 8 | var ended = false, closed = false 9 | 10 | ts.on('end', function () { 11 | assert.ok(!closed) 12 | ended = true 13 | }) 14 | ts.on('close', function () { 15 | assert.ok(ended) 16 | closed = true 17 | }) 18 | 19 | ts.write(1) 20 | ts.write(2) 21 | ts.write(3) 22 | ts.end() 23 | assert.ok(ended) 24 | assert.ok(closed) 25 | assert.end() 26 | }) 27 | 28 | test('end only once', function (t) { 29 | 30 | var ts = through() 31 | var ended = false, closed = false 32 | 33 | ts.on('end', function () { 34 | t.equal(ended, false) 35 | ended = true 36 | }) 37 | 38 | ts.queue(null) 39 | ts.queue(null) 40 | ts.queue(null) 41 | 42 | ts.resume() 43 | 44 | t.end() 45 | }) 46 | -------------------------------------------------------------------------------- /node_modules/xtend/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "maxdepth": 4, 3 | "maxstatements": 200, 4 | "maxcomplexity": 12, 5 | "maxlen": 80, 6 | "maxparams": 5, 7 | 8 | "curly": true, 9 | "eqeqeq": true, 10 | "immed": true, 11 | "latedef": false, 12 | "noarg": true, 13 | "noempty": true, 14 | "nonew": true, 15 | "undef": true, 16 | "unused": "vars", 17 | "trailing": true, 18 | 19 | "quotmark": true, 20 | "expr": true, 21 | "asi": true, 22 | 23 | "browser": false, 24 | "esnext": true, 25 | "devel": false, 26 | "node": false, 27 | "nonstandard": false, 28 | 29 | "predef": ["require", "module", "__dirname", "__filename"] 30 | } 31 | -------------------------------------------------------------------------------- /node_modules/xtend/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/xtend/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2014 Raynos. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/xtend/Makefile: -------------------------------------------------------------------------------- 1 | browser: 2 | node ./support/compile 3 | 4 | .PHONY: browser -------------------------------------------------------------------------------- /node_modules/xtend/README.md: -------------------------------------------------------------------------------- 1 | # xtend 2 | 3 | [![browser support][3]][4] 4 | 5 | [![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) 6 | 7 | Extend like a boss 8 | 9 | xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. 10 | 11 | ## Examples 12 | 13 | ```js 14 | var extend = require("xtend") 15 | 16 | // extend returns a new object. Does not mutate arguments 17 | var combination = extend({ 18 | a: "a", 19 | b: 'c' 20 | }, { 21 | b: "b" 22 | }) 23 | // { a: "a", b: "b" } 24 | ``` 25 | 26 | ## Stability status: Locked 27 | 28 | ## MIT Licenced 29 | 30 | 31 | [3]: http://ci.testling.com/Raynos/xtend.png 32 | [4]: http://ci.testling.com/Raynos/xtend 33 | -------------------------------------------------------------------------------- /node_modules/xtend/immutable.js: -------------------------------------------------------------------------------- 1 | module.exports = extend 2 | 3 | var hasOwnProperty = Object.prototype.hasOwnProperty; 4 | 5 | function extend() { 6 | var target = {} 7 | 8 | for (var i = 0; i < arguments.length; i++) { 9 | var source = arguments[i] 10 | 11 | for (var key in source) { 12 | if (hasOwnProperty.call(source, key)) { 13 | target[key] = source[key] 14 | } 15 | } 16 | } 17 | 18 | return target 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/xtend/mutable.js: -------------------------------------------------------------------------------- 1 | module.exports = extend 2 | 3 | var hasOwnProperty = Object.prototype.hasOwnProperty; 4 | 5 | function extend(target) { 6 | for (var i = 1; i < arguments.length; i++) { 7 | var source = arguments[i] 8 | 9 | for (var key in source) { 10 | if (hasOwnProperty.call(source, key)) { 11 | target[key] = source[key] 12 | } 13 | } 14 | } 15 | 16 | return target 17 | } 18 | -------------------------------------------------------------------------------- /node_modules/xtend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "xtend@^4.0.0", 5 | "/Users/dmanjunath/Documents/node-redshift/node_modules/postgres-interval" 6 | ] 7 | ], 8 | "_from": "xtend@>=4.0.0 <5.0.0", 9 | "_id": "xtend@4.0.1", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/xtend", 13 | "_nodeVersion": "0.10.32", 14 | "_npmUser": { 15 | "email": "raynos2@gmail.com", 16 | "name": "raynos" 17 | }, 18 | "_npmVersion": "2.14.1", 19 | "_phantomChildren": {}, 20 | "_requested": { 21 | "name": "xtend", 22 | "raw": "xtend@^4.0.0", 23 | "rawSpec": "^4.0.0", 24 | "scope": null, 25 | "spec": ">=4.0.0 <5.0.0", 26 | "type": "range" 27 | }, 28 | "_requiredBy": [ 29 | "/postgres-interval" 30 | ], 31 | "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", 32 | "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", 33 | "_shrinkwrap": null, 34 | "_spec": "xtend@^4.0.0", 35 | "_where": "/Users/dmanjunath/Documents/node-redshift/node_modules/postgres-interval", 36 | "author": { 37 | "email": "raynos2@gmail.com", 38 | "name": "Raynos" 39 | }, 40 | "bugs": { 41 | "email": "raynos2@gmail.com", 42 | "url": "https://github.com/Raynos/xtend/issues" 43 | }, 44 | "contributors": [ 45 | { 46 | "name": "Jake Verbaten" 47 | }, 48 | { 49 | "name": "Matt Esch" 50 | } 51 | ], 52 | "dependencies": {}, 53 | "description": "extend like a boss", 54 | "devDependencies": { 55 | "tape": "~1.1.0" 56 | }, 57 | "directories": {}, 58 | "dist": { 59 | "shasum": "a5c6d532be656e23db820efb943a1f04998d63af", 60 | "tarball": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" 61 | }, 62 | "engines": { 63 | "node": ">=0.4" 64 | }, 65 | "gitHead": "23dc302a89756da89c1897bc732a752317e35390", 66 | "homepage": "https://github.com/Raynos/xtend", 67 | "keywords": [ 68 | "extend", 69 | "merge", 70 | "options", 71 | "opts", 72 | "object", 73 | "array" 74 | ], 75 | "license": "MIT", 76 | "main": "immutable", 77 | "maintainers": [ 78 | { 79 | "email": "raynos2@gmail.com", 80 | "name": "raynos" 81 | } 82 | ], 83 | "name": "xtend", 84 | "optionalDependencies": {}, 85 | "readme": "ERROR: No README data found!", 86 | "repository": { 87 | "type": "git", 88 | "url": "git://github.com/Raynos/xtend.git" 89 | }, 90 | "scripts": { 91 | "test": "node test" 92 | }, 93 | "testling": { 94 | "browsers": [ 95 | "ie/7..latest", 96 | "firefox/16..latest", 97 | "firefox/nightly", 98 | "chrome/22..latest", 99 | "chrome/canary", 100 | "opera/12..latest", 101 | "opera/next", 102 | "safari/5.1..latest", 103 | "ipad/6.0..latest", 104 | "iphone/6.0..latest" 105 | ], 106 | "files": "test.js" 107 | }, 108 | "version": "4.0.1" 109 | } 110 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-redshift", 3 | "version": "0.1.5", 4 | "description": "A simple collection of tools to help you get started with Amazon Redshift from node.js", 5 | "main": "index.js", 6 | "dependencies": { 7 | "bluebird": "^3.5.0", 8 | "commander": "^2.9.0", 9 | "migrate": "^0.2.2", 10 | "pg": "^6.1.2", 11 | "sql-bricks": "^1.2.3" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/dmanjunath/node-redshift" 16 | }, 17 | "devDependencies": {}, 18 | "scripts": { 19 | "test": "echo \"Error: no test specified\" && exit 1" 20 | }, 21 | "keywords": [ 22 | "redshift", 23 | "aws", 24 | "node redshift", 25 | "aws redshfit" 26 | ], 27 | "bin": { 28 | "node-redshift": "./bin/node-redshift" 29 | }, 30 | "author": "Dheeraj Manjunath @dmanjunath", 31 | "license": "MIT" 32 | } 33 | --------------------------------------------------------------------------------