diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5f926b1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+config/stupidworkaround.js
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..bdb8ae7
--- /dev/null
+++ b/app.js
@@ -0,0 +1,48 @@
+const express = require("express");
+const app = express();
+
+const bodyParser = require("body-parser");
+const cookieParser = require("cookie-parser");
+const cookieSession = require("cookie-session");
+const exphbs = require("express-handlebars");
+const index = require("./routers/index");
+const usersRouter = require("./routers/users");
+
+//bodyParser
+app.use(bodyParser.urlencoded({ extended: true }));
+
+app.use(cookieParser());
+
+//Sessions
+app.use(
+ cookieSession({
+ name: "session",
+ // keys: ["I LOVE CATS"]
+ secret: "I LOVE CATS"
+ })
+);
+
+//views
+const hbs = exphbs.create({
+ partialsDir: "views/",
+ defaultLayout: "main"
+});
+app.engine("handlebars", hbs.engine);
+app.set("view engine", "handlebars");
+
+//signup route
+app.use("/", index);
+app.use("/users", usersRouter);
+
+//run the server
+var port = process.env.PORT || process.argv[2] || 3000;
+var host = "localhost";
+
+var args;
+process.env.NODE_ENV === "production" ? (args = [port]) : (args = [port, host]);
+
+args.push(() => {
+ console.log(`Listening: http://${host}:${port}`);
+});
+
+app.listen.apply(app, args);
diff --git a/config/config.js b/config/config.js
new file mode 100644
index 0000000..6d03926
--- /dev/null
+++ b/config/config.js
@@ -0,0 +1,25 @@
+let user = require("./stupidworkaround");
+
+module.exports = {
+ development: {
+ username: user.username,
+ password: user.password,
+ database: "okodin_development",
+ host: "127.0.0.1",
+ dialect: "postgres"
+ },
+ test: {
+ username: user.name,
+ password: user.password,
+ database: "okodin_test",
+ host: "127.0.0.1",
+ dialect: "postgres"
+ },
+ production: {
+ username: "root",
+ password: null,
+ database: "okodin_production",
+ host: "127.0.0.1",
+ dialect: "postgres"
+ }
+};
diff --git a/config/stupidworkaround.js b/config/stupidworkaround.js
new file mode 100644
index 0000000..b9fd949
--- /dev/null
+++ b/config/stupidworkaround.js
@@ -0,0 +1,4 @@
+module.exports = {
+ name: "stephanie",
+ password: "MyKirigiri0"
+};
diff --git a/data_modeling.txt b/data_modeling.txt
new file mode 100644
index 0000000..796694b
--- /dev/null
+++ b/data_modeling.txt
@@ -0,0 +1,30 @@
+User
+ id
+ username
+ email
+ profile_id
+
+Profile
+ id
+ about
+ talents
+ favorite_things
+ why
+ user_id
+ age
+ location_id
+ gender
+ relationship_status
+ education
+ kids
+ height
+ occupation
+
+Location
+ id
+ name
+ coordinate
+
+ sequelize model:create --name Location --attributes 'name:string coordinate:integer'
+
+ sequelize model:create --name Profile --attributes 'about:text talents:text favorite_things:text why:text user_id:integer age:integer location_id:integer gender:string relationship_status:string education:string kids:integer height:integer occupation:string'
diff --git a/migrations/20170807170345-create-user.js b/migrations/20170807170345-create-user.js
new file mode 100644
index 0000000..671c08c
--- /dev/null
+++ b/migrations/20170807170345-create-user.js
@@ -0,0 +1,37 @@
+"use strict";
+module.exports = {
+ up: function(queryInterface, Sequelize) {
+ return queryInterface.createTable("Users", {
+ id: {
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: Sequelize.INTEGER
+ },
+ username: {
+ type: Sequelize.STRING,
+ allowNull: false
+ },
+ email: {
+ type: Sequelize.STRING,
+ allowNull: false
+ },
+ profile_id: {
+ type: Sequelize.INTEGER
+ },
+ createdAt: {
+ allowNull: false,
+ type: Sequelize.DATE,
+ defaultValue: Sequelize.fn("NOW")
+ },
+ updatedAt: {
+ allowNull: false,
+ type: Sequelize.DATE,
+ defaultValue: Sequelize.fn("NOW")
+ }
+ });
+ },
+ down: function(queryInterface, Sequelize) {
+ return queryInterface.dropTable("Users");
+ }
+};
diff --git a/migrations/20170807172148-create-profile.js b/migrations/20170807172148-create-profile.js
new file mode 100644
index 0000000..2a6b1f4
--- /dev/null
+++ b/migrations/20170807172148-create-profile.js
@@ -0,0 +1,65 @@
+"use strict";
+module.exports = {
+ up: function(queryInterface, Sequelize) {
+ return queryInterface.createTable("Profiles", {
+ id: {
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: Sequelize.INTEGER
+ },
+ about: {
+ type: Sequelize.TEXT
+ },
+ talents: {
+ type: Sequelize.TEXT
+ },
+ favorite_things: {
+ type: Sequelize.TEXT
+ },
+ why: {
+ type: Sequelize.TEXT
+ },
+ user_id: {
+ type: Sequelize.INTEGER
+ },
+ age: {
+ type: Sequelize.INTEGER
+ },
+ location_id: {
+ type: Sequelize.INTEGER
+ },
+ gender: {
+ type: Sequelize.STRING
+ },
+ relationship_status: {
+ type: Sequelize.STRING
+ },
+ education: {
+ type: Sequelize.STRING
+ },
+ kids: {
+ type: Sequelize.INTEGER
+ },
+ height: {
+ type: Sequelize.INTEGER
+ },
+ occupation: {
+ type: Sequelize.STRING
+ },
+ createdAt: {
+ allowNull: false,
+ type: Sequelize.DATE,
+ defaultValue: Sequelize.fn("NOW")
+ },
+ updatedAt: {
+ allowNull: false,
+ type: Sequelize.DATE,
+ defaultValue: Sequelize.fn("NOW")
+ }
+ });
+ },
+ down: function(queryInterface, Sequelize) {
+ return queryInterface.dropTable("Profiles");
+ }
+};
diff --git a/migrations/20170807172323-create-location.js b/migrations/20170807172323-create-location.js
new file mode 100644
index 0000000..148fe72
--- /dev/null
+++ b/migrations/20170807172323-create-location.js
@@ -0,0 +1,32 @@
+"use strict";
+module.exports = {
+ up: function(queryInterface, Sequelize) {
+ return queryInterface.createTable("Locations", {
+ id: {
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: Sequelize.INTEGER
+ },
+ name: {
+ type: Sequelize.STRING
+ },
+ coordinate: {
+ type: Sequelize.INTEGER
+ },
+ createdAt: {
+ allowNull: false,
+ type: Sequelize.DATE,
+ defaultValue: Sequelize.fn("NOW")
+ },
+ updatedAt: {
+ allowNull: false,
+ type: Sequelize.DATE,
+ defaultValue: Sequelize.fn("NOW")
+ }
+ });
+ },
+ down: function(queryInterface, Sequelize) {
+ return queryInterface.dropTable("Locations");
+ }
+};
diff --git a/models/index.js b/models/index.js
new file mode 100644
index 0000000..a0633ca
--- /dev/null
+++ b/models/index.js
@@ -0,0 +1,43 @@
+"use strict";
+
+var fs = require("fs");
+var path = require("path");
+var Sequelize = require("sequelize");
+var basename = path.basename(module.filename);
+var env = process.env.NODE_ENV || "development";
+var config = require(__dirname + "/../config/config.js")[env];
+var db = {};
+
+if (config.use_env_variable) {
+ var sequelize = new Sequelize(process.env[config.use_env_variable]);
+} else {
+ var sequelize = new Sequelize(
+ config.database,
+ config.username,
+ config.password,
+ config
+ );
+}
+
+fs
+ .readdirSync(__dirname)
+ .filter(function(file) {
+ return (
+ file.indexOf(".") !== 0 && file !== basename && file.slice(-3) === ".js"
+ );
+ })
+ .forEach(function(file) {
+ var model = sequelize["import"](path.join(__dirname, file));
+ db[model.name] = model;
+ });
+
+Object.keys(db).forEach(function(modelName) {
+ if (db[modelName].associate) {
+ db[modelName].associate(db);
+ }
+});
+
+db.sequelize = sequelize;
+db.Sequelize = Sequelize;
+
+module.exports = db;
diff --git a/models/location.js b/models/location.js
new file mode 100644
index 0000000..fc55438
--- /dev/null
+++ b/models/location.js
@@ -0,0 +1,14 @@
+'use strict';
+module.exports = function(sequelize, DataTypes) {
+ var Location = sequelize.define('Location', {
+ name: DataTypes.STRING,
+ coordinate: DataTypes.INTEGER
+ }, {
+ classMethods: {
+ associate: function(models) {
+ // associations can be defined here
+ }
+ }
+ });
+ return Location;
+};
\ No newline at end of file
diff --git a/models/profile.js b/models/profile.js
new file mode 100644
index 0000000..41e5864
--- /dev/null
+++ b/models/profile.js
@@ -0,0 +1,43 @@
+"use strict";
+module.exports = function(sequelize, DataTypes) {
+ var Profile = sequelize.define(
+ "Profile",
+ {
+ about: DataTypes.TEXT,
+ talents: DataTypes.TEXT,
+ favorite_things: DataTypes.TEXT,
+ why: DataTypes.TEXT,
+ user_id: DataTypes.INTEGER,
+ age: {
+ type: DataTypes.INTEGER,
+ validate: {
+ isInt: {
+ msg: "Age must be an integer"
+ }
+ }
+ },
+ location_id: DataTypes.INTEGER,
+ gender: DataTypes.STRING,
+ relationship_status: DataTypes.STRING,
+ education: DataTypes.STRING,
+ kids: DataTypes.INTEGER,
+ height: {
+ type: DataTypes.INTEGER,
+ validate: {
+ isInt: {
+ msg: "Height must be an integer"
+ }
+ }
+ },
+ occupation: DataTypes.STRING
+ },
+ {
+ classMethods: {
+ associate: function(models) {
+ // associations can be defined here
+ }
+ }
+ }
+ );
+ return Profile;
+};
diff --git a/models/user.js b/models/user.js
new file mode 100644
index 0000000..37a35e8
--- /dev/null
+++ b/models/user.js
@@ -0,0 +1,29 @@
+"use strict";
+module.exports = function(sequelize, DataTypes) {
+ var User = sequelize.define("User", {
+ username: {
+ type: DataTypes.STRING,
+
+ validate: {
+ notEmpty: {
+ msg: "Username cannot be empty"
+ }
+ }
+ },
+ email: {
+ type: DataTypes.STRING,
+
+ validate: {
+ notEmpty: {
+ msg: "Username cannot be empty"
+ },
+ isEmail: {
+ msg: "Invalid email."
+ }
+ }
+ },
+
+ profile_id: DataTypes.INTEGER
+ });
+ return User;
+};
diff --git a/node_modules/.bin/css-beautify b/node_modules/.bin/css-beautify
new file mode 120000
index 0000000..d9b8ee2
--- /dev/null
+++ b/node_modules/.bin/css-beautify
@@ -0,0 +1 @@
+../js-beautify/js/bin/css-beautify.js
\ No newline at end of file
diff --git a/node_modules/.bin/editorconfig b/node_modules/.bin/editorconfig
new file mode 120000
index 0000000..a151e0b
--- /dev/null
+++ b/node_modules/.bin/editorconfig
@@ -0,0 +1 @@
+../editorconfig/bin/editorconfig
\ No newline at end of file
diff --git a/node_modules/.bin/env-cmd b/node_modules/.bin/env-cmd
new file mode 120000
index 0000000..83241be
--- /dev/null
+++ b/node_modules/.bin/env-cmd
@@ -0,0 +1 @@
+../env-cmd/bin/env-cmd.js
\ No newline at end of file
diff --git a/node_modules/.bin/gulp b/node_modules/.bin/gulp
new file mode 120000
index 0000000..5de7332
--- /dev/null
+++ b/node_modules/.bin/gulp
@@ -0,0 +1 @@
+../gulp/bin/gulp.js
\ No newline at end of file
diff --git a/node_modules/.bin/handlebars b/node_modules/.bin/handlebars
new file mode 120000
index 0000000..fb7d090
--- /dev/null
+++ b/node_modules/.bin/handlebars
@@ -0,0 +1 @@
+../handlebars/bin/handlebars
\ No newline at end of file
diff --git a/node_modules/.bin/html-beautify b/node_modules/.bin/html-beautify
new file mode 120000
index 0000000..c17c69c
--- /dev/null
+++ b/node_modules/.bin/html-beautify
@@ -0,0 +1 @@
+../js-beautify/js/bin/html-beautify.js
\ No newline at end of file
diff --git a/node_modules/.bin/js-beautify b/node_modules/.bin/js-beautify
new file mode 120000
index 0000000..548ddf4
--- /dev/null
+++ b/node_modules/.bin/js-beautify
@@ -0,0 +1 @@
+../js-beautify/js/bin/js-beautify.js
\ No newline at end of file
diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime
new file mode 120000
index 0000000..fbb7ee0
--- /dev/null
+++ b/node_modules/.bin/mime
@@ -0,0 +1 @@
+../mime/cli.js
\ No newline at end of file
diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp
new file mode 120000
index 0000000..017896c
--- /dev/null
+++ b/node_modules/.bin/mkdirp
@@ -0,0 +1 @@
+../mkdirp/bin/cmd.js
\ No newline at end of file
diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt
new file mode 120000
index 0000000..6b6566e
--- /dev/null
+++ b/node_modules/.bin/nopt
@@ -0,0 +1 @@
+../nopt/bin/nopt.js
\ No newline at end of file
diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver
new file mode 120000
index 0000000..317eb29
--- /dev/null
+++ b/node_modules/.bin/semver
@@ -0,0 +1 @@
+../semver/bin/semver
\ No newline at end of file
diff --git a/node_modules/.bin/sequelize b/node_modules/.bin/sequelize
new file mode 120000
index 0000000..c7e502b
--- /dev/null
+++ b/node_modules/.bin/sequelize
@@ -0,0 +1 @@
+../sequelize-cli/bin/sequelize
\ No newline at end of file
diff --git a/node_modules/.bin/strip-bom b/node_modules/.bin/strip-bom
new file mode 120000
index 0000000..ba65fdf
--- /dev/null
+++ b/node_modules/.bin/strip-bom
@@ -0,0 +1 @@
+../strip-bom/cli.js
\ No newline at end of file
diff --git a/node_modules/.bin/uglifyjs b/node_modules/.bin/uglifyjs
new file mode 120000
index 0000000..fef3468
--- /dev/null
+++ b/node_modules/.bin/uglifyjs
@@ -0,0 +1 @@
+../uglify-js/bin/uglifyjs
\ No newline at end of file
diff --git a/node_modules/.bin/user-home b/node_modules/.bin/user-home
new file mode 120000
index 0000000..d72d76b
--- /dev/null
+++ b/node_modules/.bin/user-home
@@ -0,0 +1 @@
+../user-home/cli.js
\ No newline at end of file
diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid
new file mode 120000
index 0000000..b3e45bc
--- /dev/null
+++ b/node_modules/.bin/uuid
@@ -0,0 +1 @@
+../uuid/bin/uuid
\ No newline at end of file
diff --git a/node_modules/.bin/which b/node_modules/.bin/which
new file mode 120000
index 0000000..f62471c
--- /dev/null
+++ b/node_modules/.bin/which
@@ -0,0 +1 @@
+../which/bin/which
\ No newline at end of file
diff --git a/node_modules/@types/geojson/LICENSE b/node_modules/@types/geojson/LICENSE
new file mode 100644
index 0000000..2107107
--- /dev/null
+++ b/node_modules/@types/geojson/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/node_modules/@types/geojson/README.md b/node_modules/@types/geojson/README.md
new file mode 100644
index 0000000..1f9a39c
--- /dev/null
+++ b/node_modules/@types/geojson/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/geojson`
+
+# Summary
+This package contains type definitions for GeoJSON Format Specification Revision (http://geojson.org/).
+
+# Details
+Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson
+
+Additional Details
+ * Last updated: Mon, 17 Apr 2017 17:55:17 GMT
+ * Dependencies: none
+ * Global values: GeoJSON
+
+# Credits
+These definitions were written by Jacob Bruun .
diff --git a/node_modules/@types/geojson/index.d.ts b/node_modules/@types/geojson/index.d.ts
new file mode 100644
index 0000000..9902b97
--- /dev/null
+++ b/node_modules/@types/geojson/index.d.ts
@@ -0,0 +1,121 @@
+// Type definitions for GeoJSON Format Specification Revision 1.0
+// Project: http://geojson.org/
+// Definitions by: Jacob Bruun
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+export as namespace GeoJSON;
+
+/***
+* http://geojson.org/geojson-spec.html#geojson-objects
+*/
+export interface GeoJsonObject {
+ type: string;
+ bbox?: number[];
+ crs?: CoordinateReferenceSystem;
+}
+
+/***
+* http://geojson.org/geojson-spec.html#positions
+*/
+export type Position = number[];
+
+/***
+* http://geojson.org/geojson-spec.html#geometry-objects
+*/
+export interface DirectGeometryObject extends GeoJsonObject {
+ coordinates: Position[][][] | Position[][] | Position[] | Position;
+}
+/**
+ * GeometryObject supports geometry collection as well
+ */
+export type GeometryObject = DirectGeometryObject | GeometryCollection;
+
+/***
+* http://geojson.org/geojson-spec.html#point
+*/
+export interface Point extends DirectGeometryObject {
+ type: 'Point';
+ coordinates: Position;
+}
+
+/***
+* http://geojson.org/geojson-spec.html#multipoint
+*/
+export interface MultiPoint extends DirectGeometryObject {
+ type: 'MultiPoint';
+ coordinates: Position[];
+}
+
+/***
+* http://geojson.org/geojson-spec.html#linestring
+*/
+export interface LineString extends DirectGeometryObject {
+ type: 'LineString';
+ coordinates: Position[];
+}
+
+/***
+* http://geojson.org/geojson-spec.html#multilinestring
+*/
+export interface MultiLineString extends DirectGeometryObject {
+ type: 'MultiLineString';
+ coordinates: Position[][];
+}
+
+/***
+* http://geojson.org/geojson-spec.html#polygon
+*/
+export interface Polygon extends DirectGeometryObject {
+ type: 'Polygon';
+ coordinates: Position[][];
+}
+
+/***
+* http://geojson.org/geojson-spec.html#multipolygon
+*/
+export interface MultiPolygon extends DirectGeometryObject {
+ type: 'MultiPolygon';
+ coordinates: Position[][][];
+}
+
+/***
+* http://geojson.org/geojson-spec.html#geometry-collection
+*/
+export interface GeometryCollection extends GeoJsonObject {
+ type: 'GeometryCollection';
+ geometries: GeometryObject[];
+}
+
+/***
+* http://geojson.org/geojson-spec.html#feature-objects
+*/
+export interface Feature extends GeoJsonObject {
+ type: 'Feature';
+ geometry: T;
+ properties: {} | null;
+ id?: string;
+}
+
+/***
+* http://geojson.org/geojson-spec.html#feature-collection-objects
+*/
+export interface FeatureCollection extends GeoJsonObject {
+ type: 'FeatureCollection';
+ features: Array>;
+}
+
+/***
+* http://geojson.org/geojson-spec.html#coordinate-reference-system-objects
+*/
+export interface CoordinateReferenceSystem {
+ type: string;
+ properties: any;
+}
+
+export interface NamedCoordinateReferenceSystem extends CoordinateReferenceSystem {
+ properties: { name: string };
+}
+
+export interface LinkedCoordinateReferenceSystem extends CoordinateReferenceSystem {
+ properties: { href: string; type: string };
+}
diff --git a/node_modules/@types/geojson/package.json b/node_modules/@types/geojson/package.json
new file mode 100644
index 0000000..d82499a
--- /dev/null
+++ b/node_modules/@types/geojson/package.json
@@ -0,0 +1,80 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "@types/geojson@^1.0.0",
+ "scope": "@types",
+ "escapedName": "@types%2fgeojson",
+ "name": "@types/geojson",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/terraformer"
+ ]
+ ],
+ "_from": "@types/geojson@>=1.0.0 <2.0.0",
+ "_id": "@types/geojson@1.0.2",
+ "_inCache": true,
+ "_location": "/@types/geojson",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/geojson-1.0.2.tgz_1492451765652_0.5249417354352772"
+ },
+ "_npmUser": {
+ "name": "types",
+ "email": "ts-npm-types@microsoft.com"
+ },
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "@types/geojson@^1.0.0",
+ "scope": "@types",
+ "escapedName": "@types%2fgeojson",
+ "name": "@types/geojson",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/terraformer"
+ ],
+ "_resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.2.tgz",
+ "_shasum": "b02d10ab028e2928ac592a051aaa4981a1941d03",
+ "_shrinkwrap": null,
+ "_spec": "@types/geojson@^1.0.0",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/terraformer",
+ "contributors": [
+ {
+ "name": "Jacob Bruun",
+ "url": "https://github.com/cobster/"
+ }
+ ],
+ "dependencies": {},
+ "description": "TypeScript definitions for GeoJSON Format Specification Revision",
+ "devDependencies": {},
+ "directories": {},
+ "dist": {
+ "shasum": "b02d10ab028e2928ac592a051aaa4981a1941d03",
+ "tarball": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.2.tgz"
+ },
+ "license": "MIT",
+ "main": "",
+ "maintainers": [
+ {
+ "name": "types",
+ "email": "ts-npm-types@microsoft.com"
+ }
+ ],
+ "name": "@types/geojson",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
+ },
+ "scripts": {},
+ "typeScriptVersion": "2.0",
+ "typesPublisherContentHash": "8af0f83b55578253a8217e74c8a6b4d11cf8aad1b82772cf45162e9ebc4eb776",
+ "version": "1.0.2"
+}
diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE
new file mode 100644
index 0000000..2107107
--- /dev/null
+++ b/node_modules/@types/node/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md
new file mode 100644
index 0000000..ab631a1
--- /dev/null
+++ b/node_modules/@types/node/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/node`
+
+# Summary
+This package contains type definitions for Node.js (http://nodejs.org/).
+
+# Details
+Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v6
+
+Additional Details
+ * Last updated: Sat, 22 Jul 2017 19:03:51 GMT
+ * Dependencies: events, net, stream, child_process, tls, http, readline, crypto
+ * Global values: Buffer, NodeJS, SlowBuffer, ___dirname, ___filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout
+
+# Credits
+These definitions were written by Microsoft TypeScript , DefinitelyTyped , Wilco Bakker .
diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts
new file mode 100644
index 0000000..c85ecf6
--- /dev/null
+++ b/node_modules/@types/node/index.d.ts
@@ -0,0 +1,4214 @@
+// Type definitions for Node.js v6.x
+// Project: http://nodejs.org/
+// Definitions by: Microsoft TypeScript , DefinitelyTyped , Wilco Bakker
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+/************************************************
+* *
+* Node.js v6.x API *
+* *
+************************************************/
+
+// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
+interface Console {
+ Console: typeof NodeJS.Console;
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
+ dir(obj: any, options?: NodeJS.InspectOptions): void;
+ error(message?: any, ...optionalParams: any[]): void;
+ info(message?: any, ...optionalParams: any[]): void;
+ log(message?: any, ...optionalParams: any[]): void;
+ time(label: string): void;
+ timeEnd(label: string): void;
+ trace(message?: any, ...optionalParams: any[]): void;
+ warn(message?: any, ...optionalParams: any[]): void;
+}
+
+interface Error {
+ stack?: string;
+}
+
+interface ErrorConstructor {
+ captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
+ stackTraceLimit: number;
+}
+
+// compat for TypeScript 1.8
+// if you use with --target es3 or --target es5 and use below definitions,
+// use the lib.es6.d.ts that is bundled with TypeScript 1.8.
+interface MapConstructor { }
+interface WeakMapConstructor { }
+interface SetConstructor { }
+interface WeakSetConstructor { }
+
+/************************************************
+* *
+* GLOBAL *
+* *
+************************************************/
+declare var process: NodeJS.Process;
+declare var global: NodeJS.Global;
+declare var console: Console;
+
+declare var __filename: string;
+declare var __dirname: string;
+
+declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
+declare function clearTimeout(timeoutId: NodeJS.Timer): void;
+declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
+declare function clearInterval(intervalId: NodeJS.Timer): void;
+declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
+declare function clearImmediate(immediateId: any): void;
+
+interface NodeRequireFunction {
+ (id: string): any;
+}
+
+interface NodeRequire extends NodeRequireFunction {
+ resolve(id: string): string;
+ cache: any;
+ extensions: any;
+ main: NodeModule | undefined;
+}
+
+declare var require: NodeRequire;
+
+interface NodeModule {
+ exports: any;
+ require: NodeRequireFunction;
+ id: string;
+ filename: string;
+ loaded: boolean;
+ parent: NodeModule | null;
+ children: NodeModule[];
+}
+
+declare var module: NodeModule;
+
+// Same as module.exports
+declare var exports: any;
+declare var SlowBuffer: {
+ new (str: string, encoding?: string): Buffer;
+ new (size: number): Buffer;
+ new (size: Uint8Array): Buffer;
+ new (array: any[]): Buffer;
+ prototype: Buffer;
+ isBuffer(obj: any): boolean;
+ byteLength(string: string, encoding?: string): number;
+ concat(list: Buffer[], totalLength?: number): Buffer;
+};
+
+
+// Buffer class
+type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";
+interface Buffer extends NodeBuffer { }
+
+/**
+ * Raw data is stored in instances of the Buffer class.
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ */
+declare var Buffer: {
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ new (str: string, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ new (size: number): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ new (array: Uint8Array): Buffer;
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ new (arrayBuffer: ArrayBuffer): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ new (array: any[]): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ new (buffer: Buffer): Buffer;
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ from(buffer: Buffer): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ compare(buf1: Buffer, buf2: Buffer): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initalizing
+ */
+ alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ allocUnsafeSlow(size: number): Buffer;
+};
+
+/************************************************
+* *
+* GLOBAL INTERFACES *
+* *
+************************************************/
+declare namespace NodeJS {
+ export interface InspectOptions {
+ showHidden?: boolean;
+ depth?: number | null;
+ colors?: boolean;
+ customInspect?: boolean;
+ showProxy?: boolean;
+ maxArrayLength?: number | null;
+ breakLength?: number;
+ }
+
+ export var Console: {
+ prototype: Console;
+ new(stdout: WritableStream, stderr?: WritableStream): Console;
+ }
+
+ export interface ErrnoException extends Error {
+ errno?: number;
+ code?: string;
+ path?: string;
+ syscall?: string;
+ stack?: string;
+ }
+
+ export class EventEmitter {
+ addListener(event: string | symbol, listener: Function): this;
+ on(event: string | symbol, listener: Function): this;
+ once(event: string | symbol, listener: Function): this;
+ removeListener(event: string | symbol, listener: Function): this;
+ removeAllListeners(event?: string | symbol): this;
+ setMaxListeners(n: number): this;
+ getMaxListeners(): number;
+ listeners(event: string | symbol): Function[];
+ emit(event: string | symbol, ...args: any[]): boolean;
+ listenerCount(type: string | symbol): number;
+ // Added in Node 6...
+ prependListener(event: string | symbol, listener: Function): this;
+ prependOnceListener(event: string | symbol, listener: Function): this;
+ eventNames(): (string | symbol)[];
+ }
+
+ export interface ReadableStream extends EventEmitter {
+ readable: boolean;
+ read(size?: number): string | Buffer;
+ setEncoding(encoding: string | null): void;
+ pause(): this;
+ resume(): this;
+ isPaused(): boolean;
+ pipe(destination: T, options?: { end?: boolean; }): T;
+ unpipe(destination?: T): void;
+ unshift(chunk: string): void;
+ unshift(chunk: Buffer): void;
+ wrap(oldStream: ReadableStream): ReadableStream;
+ }
+
+ export interface WritableStream extends EventEmitter {
+ writable: boolean;
+ write(buffer: Buffer | string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ }
+
+ export interface ReadWriteStream extends ReadableStream, WritableStream {}
+
+ export interface Events extends EventEmitter { }
+
+ export interface Domain extends Events {
+ run(fn: Function): void;
+ add(emitter: Events): void;
+ remove(emitter: Events): void;
+ bind(cb: (err: Error, data: any) => any): any;
+ intercept(cb: (data: any) => any): any;
+ dispose(): void;
+
+ addListener(event: string, listener: Function): this;
+ on(event: string, listener: Function): this;
+ once(event: string, listener: Function): this;
+ removeListener(event: string, listener: Function): this;
+ removeAllListeners(event?: string): this;
+ }
+
+ export interface MemoryUsage {
+ rss: number;
+ heapTotal: number;
+ heapUsed: number;
+ }
+
+ export interface CpuUsage {
+ user: number;
+ system: number;
+ }
+
+ export interface ProcessVersions {
+ http_parser: string;
+ node: string;
+ v8: string;
+ ares: string;
+ uv: string;
+ zlib: string;
+ modules: string;
+ openssl: string;
+ }
+
+ type Platform = 'aix'
+ | 'android'
+ | 'darwin'
+ | 'freebsd'
+ | 'linux'
+ | 'openbsd'
+ | 'sunos'
+ | 'win32';
+
+ export interface Socket extends ReadWriteStream {
+ isTTY?: true;
+ }
+
+ export interface WriteStream extends Socket {
+ columns?: number;
+ rows?: number;
+ }
+ export interface ReadStream extends Socket {
+ isRaw?: boolean;
+ setRawMode?(mode: boolean): void;
+ }
+
+ export interface Process extends EventEmitter {
+ stdout: WriteStream;
+ stderr: WriteStream;
+ stdin: ReadStream;
+ argv: string[];
+ argv0: string;
+ execArgv: string[];
+ execPath: string;
+ abort(): void;
+ chdir(directory: string): void;
+ cwd(): string;
+ emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
+ env: any;
+ exit(code?: number): void;
+ exitCode: number;
+ getgid(): number;
+ setgid(id: number): void;
+ setgid(id: string): void;
+ getuid(): number;
+ setuid(id: number): void;
+ setuid(id: string): void;
+ version: string;
+ versions: ProcessVersions;
+ config: {
+ target_defaults: {
+ cflags: any[];
+ default_configuration: string;
+ defines: string[];
+ include_dirs: string[];
+ libraries: string[];
+ };
+ variables: {
+ clang: number;
+ host_arch: string;
+ node_install_npm: boolean;
+ node_install_waf: boolean;
+ node_prefix: string;
+ node_shared_openssl: boolean;
+ node_shared_v8: boolean;
+ node_shared_zlib: boolean;
+ node_use_dtrace: boolean;
+ node_use_etw: boolean;
+ node_use_openssl: boolean;
+ target_arch: string;
+ v8_no_strict_aliasing: number;
+ v8_use_snapshot: boolean;
+ visibility: string;
+ };
+ };
+ kill(pid: number, signal?: string | number): void;
+ pid: number;
+ title: string;
+ arch: string;
+ platform: Platform;
+ mainModule?: NodeModule;
+ memoryUsage(): MemoryUsage;
+ cpuUsage(previousValue?: CpuUsage): CpuUsage;
+ nextTick(callback: Function, ...args: any[]): void;
+ umask(mask?: number): number;
+ uptime(): number;
+ hrtime(time?: [number, number]): [number, number];
+ domain: Domain;
+
+ // Worker
+ send?(message: any, sendHandle?: any): void;
+ disconnect(): void;
+ connected: boolean;
+ }
+
+ export interface Global {
+ Array: typeof Array;
+ ArrayBuffer: typeof ArrayBuffer;
+ Boolean: typeof Boolean;
+ Buffer: typeof Buffer;
+ DataView: typeof DataView;
+ Date: typeof Date;
+ Error: typeof Error;
+ EvalError: typeof EvalError;
+ Float32Array: typeof Float32Array;
+ Float64Array: typeof Float64Array;
+ Function: typeof Function;
+ GLOBAL: Global;
+ Infinity: typeof Infinity;
+ Int16Array: typeof Int16Array;
+ Int32Array: typeof Int32Array;
+ Int8Array: typeof Int8Array;
+ Intl: typeof Intl;
+ JSON: typeof JSON;
+ Map: MapConstructor;
+ Math: typeof Math;
+ NaN: typeof NaN;
+ Number: typeof Number;
+ Object: typeof Object;
+ Promise: Function;
+ RangeError: typeof RangeError;
+ ReferenceError: typeof ReferenceError;
+ RegExp: typeof RegExp;
+ Set: SetConstructor;
+ String: typeof String;
+ Symbol: Function;
+ SyntaxError: typeof SyntaxError;
+ TypeError: typeof TypeError;
+ URIError: typeof URIError;
+ Uint16Array: typeof Uint16Array;
+ Uint32Array: typeof Uint32Array;
+ Uint8Array: typeof Uint8Array;
+ Uint8ClampedArray: Function;
+ WeakMap: WeakMapConstructor;
+ WeakSet: WeakSetConstructor;
+ clearImmediate: (immediateId: any) => void;
+ clearInterval: (intervalId: NodeJS.Timer) => void;
+ clearTimeout: (timeoutId: NodeJS.Timer) => void;
+ console: typeof console;
+ decodeURI: typeof decodeURI;
+ decodeURIComponent: typeof decodeURIComponent;
+ encodeURI: typeof encodeURI;
+ encodeURIComponent: typeof encodeURIComponent;
+ escape: (str: string) => string;
+ eval: typeof eval;
+ global: Global;
+ isFinite: typeof isFinite;
+ isNaN: typeof isNaN;
+ parseFloat: typeof parseFloat;
+ parseInt: typeof parseInt;
+ process: Process;
+ root: Global;
+ setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any;
+ setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
+ setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
+ undefined: typeof undefined;
+ unescape: (str: string) => string;
+ gc: () => void;
+ v8debug?: any;
+ }
+
+ export interface Timer {
+ ref(): void;
+ unref(): void;
+ }
+}
+
+interface IterableIterator { }
+
+/**
+ * @deprecated
+ */
+interface NodeBuffer extends Uint8Array {
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ entries(): IterableIterator<[number, number]>;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+ keys(): IterableIterator;
+ values(): IterableIterator;
+}
+
+/************************************************
+* *
+* MODULES *
+* *
+************************************************/
+declare module "buffer" {
+ export var INSPECT_MAX_BYTES: number;
+ var BuffType: typeof Buffer;
+ var SlowBuffType: typeof SlowBuffer;
+ export { BuffType as Buffer, SlowBuffType as SlowBuffer };
+}
+
+declare module "querystring" {
+ export interface StringifyOptions {
+ encodeURIComponent?: Function;
+ }
+
+ export interface ParseOptions {
+ maxKeys?: number;
+ decodeURIComponent?: Function;
+ }
+
+ export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string;
+ export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any;
+ export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T;
+ export function escape(str: string): string;
+ export function unescape(str: string): string;
+}
+
+declare module "events" {
+ class internal extends NodeJS.EventEmitter { }
+
+ namespace internal {
+ export class EventEmitter extends internal {
+ static listenerCount(emitter: EventEmitter, event: string | symbol): number; // deprecated
+ static defaultMaxListeners: number;
+
+ addListener(event: string | symbol, listener: Function): this;
+ on(event: string | symbol, listener: Function): this;
+ once(event: string | symbol, listener: Function): this;
+ prependListener(event: string | symbol, listener: Function): this;
+ prependOnceListener(event: string | symbol, listener: Function): this;
+ removeListener(event: string | symbol, listener: Function): this;
+ removeAllListeners(event?: string | symbol): this;
+ setMaxListeners(n: number): this;
+ getMaxListeners(): number;
+ listeners(event: string | symbol): Function[];
+ emit(event: string | symbol, ...args: any[]): boolean;
+ eventNames(): (string | symbol)[];
+ listenerCount(type: string | symbol): number;
+ }
+ }
+
+ export = internal;
+}
+
+declare module "http" {
+ import * as events from "events";
+ import * as net from "net";
+ import * as stream from "stream";
+
+ export interface RequestOptions {
+ protocol?: string;
+ host?: string;
+ hostname?: string;
+ family?: number;
+ port?: number;
+ localAddress?: string;
+ socketPath?: string;
+ method?: string;
+ path?: string;
+ headers?: { [key: string]: any };
+ auth?: string;
+ agent?: Agent | boolean;
+ }
+
+ export interface Server extends net.Server {
+ setTimeout(msecs: number, callback: Function): void;
+ maxHeadersCount: number;
+ timeout: number;
+ listening: boolean;
+ }
+ /**
+ * @deprecated Use IncomingMessage
+ */
+ export interface ServerRequest extends IncomingMessage {
+ connection: net.Socket;
+ }
+ export interface ServerResponse extends stream.Writable {
+ // Extended base methods
+ write(buffer: Buffer): boolean;
+ write(buffer: Buffer, cb?: Function): boolean;
+ write(str: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, fd?: string): boolean;
+
+ writeContinue(): void;
+ writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void;
+ writeHead(statusCode: number, headers?: any): void;
+ statusCode: number;
+ statusMessage: string;
+ headersSent: boolean;
+ setHeader(name: string, value: string | string[]): void;
+ setTimeout(msecs: number, callback: Function): ServerResponse;
+ sendDate: boolean;
+ getHeader(name: string): string;
+ removeHeader(name: string): void;
+ write(chunk: any, encoding?: string): any;
+ addTrailers(headers: any): void;
+ finished: boolean;
+
+ // Extended base methods
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ end(data?: any, encoding?: string): void;
+ }
+ export interface ClientRequest extends stream.Writable {
+ // Extended base methods
+ write(buffer: Buffer): boolean;
+ write(buffer: Buffer, cb?: Function): boolean;
+ write(str: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, fd?: string): boolean;
+
+ write(chunk: any, encoding?: string): void;
+ abort(): void;
+ setTimeout(timeout: number, callback?: Function): void;
+ setNoDelay(noDelay?: boolean): void;
+ setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
+
+ setHeader(name: string, value: string | string[]): void;
+ getHeader(name: string): string;
+ removeHeader(name: string): void;
+ addTrailers(headers: any): void;
+
+ // Extended base methods
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ end(data?: any, encoding?: string): void;
+ }
+ export interface IncomingMessage extends stream.Readable {
+ httpVersion: string;
+ httpVersionMajor: number;
+ httpVersionMinor: number;
+ connection: net.Socket;
+ headers: any;
+ rawHeaders: string[];
+ trailers: any;
+ rawTrailers: any;
+ setTimeout(msecs: number, callback: Function): NodeJS.Timer;
+ /**
+ * Only valid for request obtained from http.Server.
+ */
+ method?: string;
+ /**
+ * Only valid for request obtained from http.Server.
+ */
+ url?: string;
+ /**
+ * Only valid for response obtained from http.ClientRequest.
+ */
+ statusCode?: number;
+ /**
+ * Only valid for response obtained from http.ClientRequest.
+ */
+ statusMessage?: string;
+ socket: net.Socket;
+ destroy(error?: Error): void;
+ }
+ /**
+ * @deprecated Use IncomingMessage
+ */
+ export interface ClientResponse extends IncomingMessage { }
+
+ export interface AgentOptions {
+ /**
+ * Keep sockets around in a pool to be used by other requests in the future. Default = false
+ */
+ keepAlive?: boolean;
+ /**
+ * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
+ * Only relevant if keepAlive is set to true.
+ */
+ keepAliveMsecs?: number;
+ /**
+ * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
+ */
+ maxSockets?: number;
+ /**
+ * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
+ */
+ maxFreeSockets?: number;
+ }
+
+ export class Agent {
+ maxSockets: number;
+ sockets: any;
+ requests: any;
+
+ constructor(opts?: AgentOptions);
+
+ /**
+ * Destroy any sockets that are currently in use by the agent.
+ * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
+ * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
+ * sockets may hang open for quite a long time before the server terminates them.
+ */
+ destroy(): void;
+ }
+
+ export var METHODS: string[];
+
+ export var STATUS_CODES: {
+ [errorCode: number]: string;
+ [errorCode: string]: string;
+ };
+ export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server;
+ export function createClient(port?: number, host?: string): any;
+ export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
+ export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
+ export var globalAgent: Agent;
+}
+
+declare module "cluster" {
+ import * as child from "child_process";
+ import * as events from "events";
+ import * as net from "net";
+
+ // interfaces
+ export interface ClusterSettings {
+ execArgv?: string[]; // default: process.execArgv
+ exec?: string;
+ args?: string[];
+ silent?: boolean;
+ stdio?: any[];
+ uid?: number;
+ gid?: number;
+ }
+
+ export interface ClusterSetupMasterSettings {
+ exec?: string; // default: process.argv[1]
+ args?: string[]; // default: process.argv.slice(2)
+ silent?: boolean; // default: false
+ stdio?: any[];
+ }
+
+ export interface Address {
+ address: string;
+ port: number;
+ addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
+ }
+
+ export class Worker extends events.EventEmitter {
+ id: string;
+ process: child.ChildProcess;
+ suicide: boolean;
+ send(message: any, sendHandle?: any): boolean;
+ kill(signal?: string): void;
+ destroy(signal?: string): void;
+ disconnect(): void;
+ isConnected(): boolean;
+ isDead(): boolean;
+ exitedAfterDisconnect: boolean;
+
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. error
+ * 3. exit
+ * 4. listening
+ * 5. message
+ * 6. online
+ */
+ addListener(event: string, listener: Function): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (code: number, signal: string) => void): this;
+ addListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ addListener(event: "listening", listener: (address: Address) => void): this;
+ addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ addListener(event: "online", listener: () => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "disconnect", listener: () => void): boolean
+ emit(event: "error", listener: (code: number, signal: string) => void): boolean
+ emit(event: "exit", listener: (code: number, signal: string) => void): boolean
+ emit(event: "listening", listener: (address: Address) => void): boolean
+ emit(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): boolean
+ emit(event: "online", listener: () => void): boolean
+
+ on(event: string, listener: Function): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (code: number, signal: string) => void): this;
+ on(event: "exit", listener: (code: number, signal: string) => void): this;
+ on(event: "listening", listener: (address: Address) => void): this;
+ on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ on(event: "online", listener: () => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (code: number, signal: string) => void): this;
+ once(event: "exit", listener: (code: number, signal: string) => void): this;
+ once(event: "listening", listener: (address: Address) => void): this;
+ once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ once(event: "online", listener: () => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (code: number, signal: string) => void): this;
+ prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ prependListener(event: "listening", listener: (address: Address) => void): this;
+ prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ prependListener(event: "online", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (code: number, signal: string) => void): this;
+ prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ prependOnceListener(event: "listening", listener: (address: Address) => void): this;
+ prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ prependOnceListener(event: "online", listener: () => void): this;
+ }
+
+ export interface Cluster extends events.EventEmitter {
+ Worker: Worker;
+ disconnect(callback?: Function): void;
+ fork(env?: any): Worker;
+ isMaster: boolean;
+ isWorker: boolean;
+ // TODO: cluster.schedulingPolicy
+ settings: ClusterSettings;
+ setupMaster(settings?: ClusterSetupMasterSettings): void;
+ worker: Worker;
+ workers: {
+ [index: string]: Worker
+ };
+
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. exit
+ * 3. fork
+ * 4. listening
+ * 5. message
+ * 6. online
+ * 7. setup
+ */
+ addListener(event: string, listener: Function): this;
+ addListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ addListener(event: "fork", listener: (worker: Worker) => void): this;
+ addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ addListener(event: "online", listener: (worker: Worker) => void): this;
+ addListener(event: "setup", listener: (settings: any) => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "disconnect", listener: (worker: Worker) => void): boolean;
+ emit(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): boolean;
+ emit(event: "fork", listener: (worker: Worker) => void): boolean;
+ emit(event: "listening", listener: (worker: Worker, address: Address) => void): boolean;
+ emit(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): boolean;
+ emit(event: "online", listener: (worker: Worker) => void): boolean;
+ emit(event: "setup", listener: (settings: any) => void): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "disconnect", listener: (worker: Worker) => void): this;
+ on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ on(event: "fork", listener: (worker: Worker) => void): this;
+ on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ on(event: "online", listener: (worker: Worker) => void): this;
+ on(event: "setup", listener: (settings: any) => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "disconnect", listener: (worker: Worker) => void): this;
+ once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ once(event: "fork", listener: (worker: Worker) => void): this;
+ once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ once(event: "online", listener: (worker: Worker) => void): this;
+ once(event: "setup", listener: (settings: any) => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ prependListener(event: "online", listener: (worker: Worker) => void): this;
+ prependListener(event: "setup", listener: (settings: any) => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "setup", listener: (settings: any) => void): this;
+
+ }
+
+ export function disconnect(callback?: Function): void;
+ export function fork(env?: any): Worker;
+ export var isMaster: boolean;
+ export var isWorker: boolean;
+ // TODO: cluster.schedulingPolicy
+ export var settings: ClusterSettings;
+ export function setupMaster(settings?: ClusterSetupMasterSettings): void;
+ export var worker: Worker;
+ export var workers: {
+ [index: string]: Worker
+ };
+
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. exit
+ * 3. fork
+ * 4. listening
+ * 5. message
+ * 6. online
+ * 7. setup
+ */
+ export function addListener(event: string, listener: Function): Cluster;
+ export function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ export function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ export function addListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+ export function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ export function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
+ export function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
+ export function addListener(event: "setup", listener: (settings: any) => void): Cluster;
+
+ export function emit(event: string | symbol, ...args: any[]): boolean;
+ export function emit(event: "disconnect", listener: (worker: Worker) => void): boolean;
+ export function emit(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): boolean;
+ export function emit(event: "fork", listener: (worker: Worker) => void): boolean;
+ export function emit(event: "listening", listener: (worker: Worker, address: Address) => void): boolean;
+ export function emit(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): boolean;
+ export function emit(event: "online", listener: (worker: Worker) => void): boolean;
+ export function emit(event: "setup", listener: (settings: any) => void): boolean;
+
+ export function on(event: string, listener: Function): Cluster;
+ export function on(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ export function on(event: "fork", listener: (worker: Worker) => void): Cluster;
+ export function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ export function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
+ export function on(event: "online", listener: (worker: Worker) => void): Cluster;
+ export function on(event: "setup", listener: (settings: any) => void): Cluster;
+
+ export function once(event: string, listener: Function): Cluster;
+ export function once(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ export function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ export function once(event: "fork", listener: (worker: Worker) => void): Cluster;
+ export function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ export function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
+ export function once(event: "online", listener: (worker: Worker) => void): Cluster;
+ export function once(event: "setup", listener: (settings: any) => void): Cluster;
+
+ export function removeListener(event: string, listener: Function): Cluster;
+ export function removeAllListeners(event?: string): Cluster;
+ export function setMaxListeners(n: number): Cluster;
+ export function getMaxListeners(): number;
+ export function listeners(event: string): Function[];
+ export function listenerCount(type: string): number;
+
+ export function prependListener(event: string, listener: Function): Cluster;
+ export function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ export function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ export function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+ export function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ export function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
+ export function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
+ export function prependListener(event: "setup", listener: (settings: any) => void): Cluster;
+
+ export function prependOnceListener(event: string, listener: Function): Cluster;
+ export function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ export function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ export function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+ export function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ export function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
+ export function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
+ export function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster;
+
+ export function eventNames(): string[];
+}
+
+declare module "zlib" {
+ import * as stream from "stream";
+ export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; finishFlush?: number }
+
+ export interface Gzip extends stream.Transform { }
+ export interface Gunzip extends stream.Transform { }
+ export interface Deflate extends stream.Transform { }
+ export interface Inflate extends stream.Transform { }
+ export interface DeflateRaw extends stream.Transform { }
+ export interface InflateRaw extends stream.Transform { }
+ export interface Unzip extends stream.Transform { }
+
+ export function createGzip(options?: ZlibOptions): Gzip;
+ export function createGunzip(options?: ZlibOptions): Gunzip;
+ export function createDeflate(options?: ZlibOptions): Deflate;
+ export function createInflate(options?: ZlibOptions): Inflate;
+ export function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
+ export function createInflateRaw(options?: ZlibOptions): InflateRaw;
+ export function createUnzip(options?: ZlibOptions): Unzip;
+
+ export function deflate(buf: Buffer | string, callback: (error: Error, result: Buffer) => void): void;
+ export function deflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
+ export function deflateRaw(buf: Buffer | string, callback: (error: Error, result: Buffer) => void): void;
+ export function deflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
+ export function gzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;
+ export function gzipSync(buf: Buffer, options?: ZlibOptions): Buffer;
+ export function gunzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;
+ export function gunzipSync(buf: Buffer, options?: ZlibOptions): Buffer;
+ export function inflate(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;
+ export function inflateSync(buf: Buffer, options?: ZlibOptions): Buffer;
+ export function inflateRaw(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;
+ export function inflateRawSync(buf: Buffer, options?: ZlibOptions): Buffer;
+ export function unzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;
+ export function unzipSync(buf: Buffer, options?: ZlibOptions): Buffer;
+
+ // Constants
+ export var Z_NO_FLUSH: number;
+ export var Z_PARTIAL_FLUSH: number;
+ export var Z_SYNC_FLUSH: number;
+ export var Z_FULL_FLUSH: number;
+ export var Z_FINISH: number;
+ export var Z_BLOCK: number;
+ export var Z_TREES: number;
+ export var Z_OK: number;
+ export var Z_STREAM_END: number;
+ export var Z_NEED_DICT: number;
+ export var Z_ERRNO: number;
+ export var Z_STREAM_ERROR: number;
+ export var Z_DATA_ERROR: number;
+ export var Z_MEM_ERROR: number;
+ export var Z_BUF_ERROR: number;
+ export var Z_VERSION_ERROR: number;
+ export var Z_NO_COMPRESSION: number;
+ export var Z_BEST_SPEED: number;
+ export var Z_BEST_COMPRESSION: number;
+ export var Z_DEFAULT_COMPRESSION: number;
+ export var Z_FILTERED: number;
+ export var Z_HUFFMAN_ONLY: number;
+ export var Z_RLE: number;
+ export var Z_FIXED: number;
+ export var Z_DEFAULT_STRATEGY: number;
+ export var Z_BINARY: number;
+ export var Z_TEXT: number;
+ export var Z_ASCII: number;
+ export var Z_UNKNOWN: number;
+ export var Z_DEFLATED: number;
+ export var Z_NULL: number;
+}
+
+declare module "os" {
+ export interface CpuInfo {
+ model: string;
+ speed: number;
+ times: {
+ user: number;
+ nice: number;
+ sys: number;
+ idle: number;
+ irq: number;
+ };
+ }
+
+ export interface NetworkInterfaceInfo {
+ address: string;
+ netmask: string;
+ family: string;
+ mac: string;
+ internal: boolean;
+ }
+
+ export function hostname(): string;
+ export function loadavg(): number[];
+ export function uptime(): number;
+ export function freemem(): number;
+ export function totalmem(): number;
+ export function cpus(): CpuInfo[];
+ export function type(): string;
+ export function release(): string;
+ export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] };
+ export function homedir(): string;
+ export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string }
+ export var constants: {
+ UV_UDP_REUSEADDR: number,
+ signals: {
+ SIGHUP: number;
+ SIGINT: number;
+ SIGQUIT: number;
+ SIGILL: number;
+ SIGTRAP: number;
+ SIGABRT: number;
+ SIGIOT: number;
+ SIGBUS: number;
+ SIGFPE: number;
+ SIGKILL: number;
+ SIGUSR1: number;
+ SIGSEGV: number;
+ SIGUSR2: number;
+ SIGPIPE: number;
+ SIGALRM: number;
+ SIGTERM: number;
+ SIGCHLD: number;
+ SIGSTKFLT: number;
+ SIGCONT: number;
+ SIGSTOP: number;
+ SIGTSTP: number;
+ SIGTTIN: number;
+ SIGTTOU: number;
+ SIGURG: number;
+ SIGXCPU: number;
+ SIGXFSZ: number;
+ SIGVTALRM: number;
+ SIGPROF: number;
+ SIGWINCH: number;
+ SIGIO: number;
+ SIGPOLL: number;
+ SIGPWR: number;
+ SIGSYS: number;
+ SIGUNUSED: number;
+ },
+ errno: {
+ E2BIG: number;
+ EACCES: number;
+ EADDRINUSE: number;
+ EADDRNOTAVAIL: number;
+ EAFNOSUPPORT: number;
+ EAGAIN: number;
+ EALREADY: number;
+ EBADF: number;
+ EBADMSG: number;
+ EBUSY: number;
+ ECANCELED: number;
+ ECHILD: number;
+ ECONNABORTED: number;
+ ECONNREFUSED: number;
+ ECONNRESET: number;
+ EDEADLK: number;
+ EDESTADDRREQ: number;
+ EDOM: number;
+ EDQUOT: number;
+ EEXIST: number;
+ EFAULT: number;
+ EFBIG: number;
+ EHOSTUNREACH: number;
+ EIDRM: number;
+ EILSEQ: number;
+ EINPROGRESS: number;
+ EINTR: number;
+ EINVAL: number;
+ EIO: number;
+ EISCONN: number;
+ EISDIR: number;
+ ELOOP: number;
+ EMFILE: number;
+ EMLINK: number;
+ EMSGSIZE: number;
+ EMULTIHOP: number;
+ ENAMETOOLONG: number;
+ ENETDOWN: number;
+ ENETRESET: number;
+ ENETUNREACH: number;
+ ENFILE: number;
+ ENOBUFS: number;
+ ENODATA: number;
+ ENODEV: number;
+ ENOENT: number;
+ ENOEXEC: number;
+ ENOLCK: number;
+ ENOLINK: number;
+ ENOMEM: number;
+ ENOMSG: number;
+ ENOPROTOOPT: number;
+ ENOSPC: number;
+ ENOSR: number;
+ ENOSTR: number;
+ ENOSYS: number;
+ ENOTCONN: number;
+ ENOTDIR: number;
+ ENOTEMPTY: number;
+ ENOTSOCK: number;
+ ENOTSUP: number;
+ ENOTTY: number;
+ ENXIO: number;
+ EOPNOTSUPP: number;
+ EOVERFLOW: number;
+ EPERM: number;
+ EPIPE: number;
+ EPROTO: number;
+ EPROTONOSUPPORT: number;
+ EPROTOTYPE: number;
+ ERANGE: number;
+ EROFS: number;
+ ESPIPE: number;
+ ESRCH: number;
+ ESTALE: number;
+ ETIME: number;
+ ETIMEDOUT: number;
+ ETXTBSY: number;
+ EWOULDBLOCK: number;
+ EXDEV: number;
+ },
+ };
+ export function arch(): string;
+ export function platform(): NodeJS.Platform;
+ export function tmpdir(): string;
+ export var EOL: string;
+ export function endianness(): "BE" | "LE";
+}
+
+declare module "https" {
+ import * as tls from "tls";
+ import * as events from "events";
+ import * as http from "http";
+
+ export interface ServerOptions {
+ pfx?: any;
+ key?: any;
+ passphrase?: string;
+ cert?: any;
+ ca?: any;
+ crl?: any;
+ ciphers?: string;
+ honorCipherOrder?: boolean;
+ requestCert?: boolean;
+ rejectUnauthorized?: boolean;
+ NPNProtocols?: any;
+ SNICallback?: (servername: string, cb: (err: Error, ctx: tls.SecureContext) => any) => any;
+ }
+
+ export interface RequestOptions extends http.RequestOptions {
+ pfx?: any;
+ key?: any;
+ passphrase?: string;
+ cert?: any;
+ ca?: any;
+ ciphers?: string;
+ rejectUnauthorized?: boolean;
+ secureProtocol?: string;
+ }
+
+ export interface Agent extends http.Agent { }
+
+ export interface AgentOptions extends http.AgentOptions {
+ pfx?: any;
+ key?: any;
+ passphrase?: string;
+ cert?: any;
+ ca?: any;
+ ciphers?: string;
+ rejectUnauthorized?: boolean;
+ secureProtocol?: string;
+ maxCachedSessions?: number;
+ }
+
+ export var Agent: {
+ new (options?: AgentOptions): Agent;
+ };
+ export interface Server extends tls.Server { }
+ export function createServer(options: ServerOptions, requestListener?: Function): Server;
+ export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
+ export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
+ export var globalAgent: Agent;
+}
+
+declare module "punycode" {
+ export function decode(string: string): string;
+ export function encode(string: string): string;
+ export function toUnicode(domain: string): string;
+ export function toASCII(domain: string): string;
+ export var ucs2: ucs2;
+ interface ucs2 {
+ decode(string: string): number[];
+ encode(codePoints: number[]): string;
+ }
+ export var version: any;
+}
+
+declare module "repl" {
+ import * as stream from "stream";
+ import * as readline from "readline";
+
+ export interface ReplOptions {
+ prompt?: string;
+ input?: NodeJS.ReadableStream;
+ output?: NodeJS.WritableStream;
+ terminal?: boolean;
+ eval?: Function;
+ useColors?: boolean;
+ useGlobal?: boolean;
+ ignoreUndefined?: boolean;
+ writer?: Function;
+ completer?: Function;
+ replMode?: any;
+ breakEvalOnSigint?: any;
+ }
+
+ export interface REPLServer extends readline.ReadLine {
+ defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void;
+ displayPrompt(preserveCursor?: boolean): void;
+
+ context: any;
+
+ /**
+ * events.EventEmitter
+ * 1. exit
+ * 2. reset
+ **/
+
+ addListener(event: string, listener: Function): this;
+ addListener(event: "exit", listener: () => void): this;
+ addListener(event: "reset", listener: Function): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "exit"): boolean;
+ emit(event: "reset", context: any): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "exit", listener: () => void): this;
+ on(event: "reset", listener: Function): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "exit", listener: () => void): this;
+ once(event: "reset", listener: Function): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "exit", listener: () => void): this;
+ prependListener(event: "reset", listener: Function): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "exit", listener: () => void): this;
+ prependOnceListener(event: "reset", listener: Function): this;
+ }
+
+ export function start(options?: string | ReplOptions): REPLServer;
+}
+
+declare module "readline" {
+ import * as events from "events";
+ import * as stream from "stream";
+
+ export interface Key {
+ sequence?: string;
+ name?: string;
+ ctrl?: boolean;
+ meta?: boolean;
+ shift?: boolean;
+ }
+
+ export interface ReadLine extends events.EventEmitter {
+ setPrompt(prompt: string): void;
+ prompt(preserveCursor?: boolean): void;
+ question(query: string, callback: (answer: string) => void): void;
+ pause(): this;
+ resume(): this;
+ close(): void;
+ write(data: string | Buffer, key?: Key): void;
+
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. line
+ * 3. pause
+ * 4. resume
+ * 5. SIGCONT
+ * 6. SIGINT
+ * 7. SIGTSTP
+ **/
+
+ addListener(event: string, listener: Function): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "line", listener: (input: any) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: "SIGCONT", listener: () => void): this;
+ addListener(event: "SIGINT", listener: () => void): this;
+ addListener(event: "SIGTSTP", listener: () => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "line", input: any): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: "SIGCONT"): boolean;
+ emit(event: "SIGINT"): boolean;
+ emit(event: "SIGTSTP"): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "line", listener: (input: any) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: "SIGCONT", listener: () => void): this;
+ on(event: "SIGINT", listener: () => void): this;
+ on(event: "SIGTSTP", listener: () => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "line", listener: (input: any) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: "SIGCONT", listener: () => void): this;
+ once(event: "SIGINT", listener: () => void): this;
+ once(event: "SIGTSTP", listener: () => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "line", listener: (input: any) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: "SIGCONT", listener: () => void): this;
+ prependListener(event: "SIGINT", listener: () => void): this;
+ prependListener(event: "SIGTSTP", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "line", listener: (input: any) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: "SIGCONT", listener: () => void): this;
+ prependOnceListener(event: "SIGINT", listener: () => void): this;
+ prependOnceListener(event: "SIGTSTP", listener: () => void): this;
+ }
+
+ export interface Completer {
+ (line: string): CompleterResult;
+ (line: string, callback: (err: any, result: CompleterResult) => void): any;
+ }
+
+ export type CompleterResult = [string[], string];
+
+ export interface ReadLineOptions {
+ input: NodeJS.ReadableStream;
+ output?: NodeJS.WritableStream;
+ completer?: Completer;
+ terminal?: boolean;
+ historySize?: number;
+ }
+
+ export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer, terminal?: boolean): ReadLine;
+ export function createInterface(options: ReadLineOptions): ReadLine;
+
+ export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void;
+ export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;
+ export function clearLine(stream: NodeJS.WritableStream, dir: number): void;
+ export function clearScreenDown(stream: NodeJS.WritableStream): void;
+}
+
+declare module "vm" {
+ export interface Context { }
+ export interface ScriptOptions {
+ filename?: string;
+ lineOffset?: number;
+ columnOffset?: number;
+ displayErrors?: boolean;
+ timeout?: number;
+ cachedData?: Buffer;
+ produceCachedData?: boolean;
+ }
+ export interface RunningScriptOptions {
+ filename?: string;
+ lineOffset?: number;
+ columnOffset?: number;
+ displayErrors?: boolean;
+ timeout?: number;
+ }
+ export class Script {
+ constructor(code: string, options?: ScriptOptions);
+ runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
+ runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
+ runInThisContext(options?: RunningScriptOptions): any;
+ }
+ export function createContext(sandbox?: Context): Context;
+ export function isContext(sandbox: Context): boolean;
+ export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any;
+ export function runInDebugContext(code: string): any;
+ export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any;
+ export function runInThisContext(code: string, options?: RunningScriptOptions): any;
+}
+
+declare module "child_process" {
+ import * as events from "events";
+ import * as stream from "stream";
+ import * as net from "net";
+
+ export interface ChildProcess extends events.EventEmitter {
+ stdin: stream.Writable;
+ stdout: stream.Readable;
+ stderr: stream.Readable;
+ stdio: [stream.Writable, stream.Readable, stream.Readable];
+ pid: number;
+ kill(signal?: string): void;
+ send(message: any, sendHandle?: any): boolean;
+ connected: boolean;
+ disconnect(): void;
+ unref(): void;
+ ref(): void;
+
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. disconnect
+ * 3. error
+ * 4. exit
+ * 5. message
+ **/
+
+ addListener(event: string, listener: Function): this;
+ addListener(event: "close", listener: (code: number, signal: string) => void): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close", code: number, signal: string): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "exit", code: number, signal: string): boolean;
+ emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "close", listener: (code: number, signal: string) => void): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "exit", listener: (code: number, signal: string) => void): this;
+ on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "close", listener: (code: number, signal: string) => void): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "exit", listener: (code: number, signal: string) => void): this;
+ once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "close", listener: (code: number, signal: string) => void): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
+ }
+
+ export interface SpawnOptions {
+ cwd?: string;
+ env?: any;
+ stdio?: any;
+ detached?: boolean;
+ uid?: number;
+ gid?: number;
+ shell?: boolean | string;
+ }
+ export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
+
+ export interface ExecOptions {
+ cwd?: string;
+ env?: any;
+ shell?: string;
+ timeout?: number;
+ maxBuffer?: number;
+ killSignal?: string;
+ uid?: number;
+ gid?: number;
+ }
+ export interface ExecOptionsWithStringEncoding extends ExecOptions {
+ encoding: BufferEncoding;
+ }
+ export interface ExecOptionsWithBufferEncoding extends ExecOptions {
+ encoding: string; // specify `null`.
+ }
+ export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+ export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+ // usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {});
+ export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
+ export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+
+ export interface ExecFileOptions {
+ cwd?: string;
+ env?: any;
+ timeout?: number;
+ maxBuffer?: number;
+ killSignal?: string;
+ uid?: number;
+ gid?: number;
+ }
+ export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
+ encoding: BufferEncoding;
+ }
+ export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
+ encoding: string; // specify `null`.
+ }
+ export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+ export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+ // usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {});
+ export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
+ export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+ export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+ export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+ // usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {});
+ export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
+ export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;
+
+ export interface ForkOptions {
+ cwd?: string;
+ env?: any;
+ execPath?: string;
+ execArgv?: string[];
+ silent?: boolean;
+ uid?: number;
+ gid?: number;
+ }
+ export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess;
+
+ export interface SpawnSyncOptions {
+ cwd?: string;
+ input?: string | Buffer;
+ stdio?: any;
+ env?: any;
+ uid?: number;
+ gid?: number;
+ timeout?: number;
+ killSignal?: string;
+ maxBuffer?: number;
+ encoding?: string;
+ shell?: boolean | string;
+ }
+ export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
+ encoding: BufferEncoding;
+ }
+ export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
+ encoding: string; // specify `null`.
+ }
+ export interface SpawnSyncReturns {
+ pid: number;
+ output: string[];
+ stdout: T;
+ stderr: T;
+ status: number;
+ signal: string;
+ error: Error;
+ }
+ export function spawnSync(command: string): SpawnSyncReturns;
+ export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns;
+ export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns;
+ export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns;
+ export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns;
+ export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns;
+ export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns;
+
+ export interface ExecSyncOptions {
+ cwd?: string;
+ input?: string | Buffer;
+ stdio?: any;
+ env?: any;
+ shell?: string;
+ uid?: number;
+ gid?: number;
+ timeout?: number;
+ killSignal?: string;
+ maxBuffer?: number;
+ encoding?: string;
+ }
+ export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
+ encoding: BufferEncoding;
+ }
+ export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
+ encoding: string; // specify `null`.
+ }
+ export function execSync(command: string): Buffer;
+ export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
+ export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
+ export function execSync(command: string, options?: ExecSyncOptions): Buffer;
+
+ export interface ExecFileSyncOptions {
+ cwd?: string;
+ input?: string | Buffer;
+ stdio?: any;
+ env?: any;
+ uid?: number;
+ gid?: number;
+ timeout?: number;
+ killSignal?: string;
+ maxBuffer?: number;
+ encoding?: string;
+ }
+ export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
+ encoding: BufferEncoding;
+ }
+ export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
+ encoding: string; // specify `null`.
+ }
+ export function execFileSync(command: string): Buffer;
+ export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
+ export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+ export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
+ export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string;
+ export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+ export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer;
+}
+
+declare module "url" {
+ export interface Url {
+ href?: string;
+ protocol?: string;
+ auth?: string;
+ hostname?: string;
+ port?: string;
+ host?: string;
+ pathname?: string;
+ search?: string;
+ query?: string | any;
+ slashes?: boolean;
+ hash?: string;
+ path?: string;
+ }
+
+ export interface UrlObject {
+ protocol?: string;
+ slashes?: boolean;
+ auth?: string;
+ host?: string;
+ hostname?: string;
+ port?: string | number;
+ pathname?: string;
+ search?: string;
+ query?: { [key: string]: any; };
+ hash?: string;
+ }
+
+ export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url;
+ export function format(urlObject: UrlObject): string;
+ export function resolve(from: string, to: string): string;
+}
+
+declare module "dns" {
+ // Supported getaddrinfo flags.
+ export const ADDRCONFIG: number;
+ export const V4MAPPED: number;
+
+ export interface LookupOptions {
+ family?: number;
+ hints?: number;
+ all?: boolean;
+ }
+
+ export interface LookupOneOptions extends LookupOptions {
+ all?: false;
+ }
+
+ export interface LookupAllOptions extends LookupOptions {
+ all: true;
+ }
+
+ export interface LookupAddress {
+ address: string;
+ family: number;
+ }
+
+ export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
+ export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
+ export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException, addresses: LookupAddress[]) => void): void;
+ export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
+ export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
+
+ export interface MxRecord {
+ priority: number;
+ exchange: string;
+ }
+
+ export interface NaptrRecord {
+ flags: string;
+ service: string;
+ regexp: string;
+ replacement: string;
+ order: number;
+ preference: number;
+ }
+
+ export interface SoaRecord {
+ nsname: string;
+ hostmaster: string;
+ serial: number;
+ refresh: number;
+ retry: number;
+ expire: number;
+ minttl: number;
+ }
+
+ export interface SrvRecord {
+ priority: number;
+ weight: number;
+ port: number;
+ name: string;
+ }
+
+ export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
+ export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
+ export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void;
+ export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void;
+ export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void;
+ export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void;
+
+ export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
+ export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
+ export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
+ export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void;
+ export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void;
+ export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void;
+
+ export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void;
+ export function setServers(servers: string[]): void;
+
+ //Error codes
+ export var NODATA: string;
+ export var FORMERR: string;
+ export var SERVFAIL: string;
+ export var NOTFOUND: string;
+ export var NOTIMP: string;
+ export var REFUSED: string;
+ export var BADQUERY: string;
+ export var BADNAME: string;
+ export var BADFAMILY: string;
+ export var BADRESP: string;
+ export var CONNREFUSED: string;
+ export var TIMEOUT: string;
+ export var EOF: string;
+ export var FILE: string;
+ export var NOMEM: string;
+ export var DESTRUCTION: string;
+ export var BADSTR: string;
+ export var BADFLAGS: string;
+ export var NONAME: string;
+ export var BADHINTS: string;
+ export var NOTINITIALIZED: string;
+ export var LOADIPHLPAPI: string;
+ export var ADDRGETNETWORKPARAMS: string;
+ export var CANCELLED: string;
+}
+
+declare module "net" {
+ import * as stream from "stream";
+ import * as events from "events";
+
+ export interface Socket extends stream.Duplex {
+ // Extended base methods
+ write(buffer: Buffer): boolean;
+ write(buffer: Buffer, cb?: Function): boolean;
+ write(str: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, fd?: string): boolean;
+
+ connect(port: number, host?: string, connectionListener?: Function): void;
+ connect(path: string, connectionListener?: Function): void;
+ bufferSize: number;
+ setEncoding(encoding?: string): void;
+ write(data: any, encoding?: string, callback?: Function): void;
+ destroy(): void;
+ setTimeout(timeout: number, callback?: Function): void;
+ setNoDelay(noDelay?: boolean): void;
+ setKeepAlive(enable?: boolean, initialDelay?: number): void;
+ address(): { port: number; family: string; address: string; };
+ unref(): void;
+ ref(): void;
+
+ remoteAddress: string;
+ remoteFamily: string;
+ remotePort: number;
+ localAddress: string;
+ localPort: number;
+ bytesRead: number;
+ bytesWritten: number;
+ connecting: boolean;
+ destroyed: boolean;
+
+ // Extended base methods
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ end(data?: any, encoding?: string): void;
+
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connect
+ * 3. data
+ * 4. drain
+ * 5. end
+ * 6. error
+ * 7. lookup
+ * 8. timeout
+ */
+ addListener(event: string, listener: Function): this;
+ addListener(event: "close", listener: (had_error: boolean) => void): this;
+ addListener(event: "connect", listener: () => void): this;
+ addListener(event: "data", listener: (data: Buffer) => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close", had_error: boolean): boolean;
+ emit(event: "connect"): boolean;
+ emit(event: "data", data: Buffer): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
+ emit(event: "timeout"): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "close", listener: (had_error: boolean) => void): this;
+ on(event: "connect", listener: () => void): this;
+ on(event: "data", listener: (data: Buffer) => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+ on(event: "timeout", listener: () => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "close", listener: (had_error: boolean) => void): this;
+ once(event: "connect", listener: () => void): this;
+ once(event: "data", listener: (data: Buffer) => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+ once(event: "timeout", listener: () => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "close", listener: (had_error: boolean) => void): this;
+ prependListener(event: "connect", listener: () => void): this;
+ prependListener(event: "data", listener: (data: Buffer) => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "close", listener: (had_error: boolean) => void): this;
+ prependOnceListener(event: "connect", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ }
+
+ export var Socket: {
+ new (options?: { fd?: number; allowHalfOpen?: boolean; readable?: boolean; writable?: boolean; }): Socket;
+ };
+
+ export interface ListenOptions {
+ port?: number;
+ host?: string;
+ backlog?: number;
+ path?: string;
+ exclusive?: boolean;
+ }
+
+ export interface Server extends events.EventEmitter {
+ listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server;
+ listen(port: number, hostname?: string, listeningListener?: Function): Server;
+ listen(port: number, backlog?: number, listeningListener?: Function): Server;
+ listen(port: number, listeningListener?: Function): Server;
+ listen(path: string, backlog?: number, listeningListener?: Function): Server;
+ listen(path: string, listeningListener?: Function): Server;
+ listen(options: ListenOptions, listeningListener?: Function): Server;
+ listen(handle: any, backlog?: number, listeningListener?: Function): Server;
+ listen(handle: any, listeningListener?: Function): Server;
+ close(callback?: Function): Server;
+ address(): { port: number; family: string; address: string; };
+ getConnections(cb: (error: Error, count: number) => void): void;
+ ref(): Server;
+ unref(): Server;
+ maxConnections: number;
+ connections: number;
+
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connection
+ * 3. error
+ * 4. listening
+ */
+ addListener(event: string, listener: Function): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connection", listener: (socket: Socket) => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connection", socket: Socket): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connection", listener: (socket: Socket) => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connection", listener: (socket: Socket) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ }
+ export function createServer(connectionListener?: (socket: Socket) => void): Server;
+ export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) => void): Server;
+ export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
+ export function connect(port: number, host?: string, connectionListener?: Function): Socket;
+ export function connect(path: string, connectionListener?: Function): Socket;
+ export function createConnection(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
+ export function createConnection(port: number, host?: string, connectionListener?: Function): Socket;
+ export function createConnection(path: string, connectionListener?: Function): Socket;
+ export function isIP(input: string): number;
+ export function isIPv4(input: string): boolean;
+ export function isIPv6(input: string): boolean;
+}
+
+declare module "dgram" {
+ import * as events from "events";
+
+ interface RemoteInfo {
+ address: string;
+ family: string;
+ port: number;
+ }
+
+ interface AddressInfo {
+ address: string;
+ family: string;
+ port: number;
+ }
+
+ interface BindOptions {
+ port: number;
+ address?: string;
+ exclusive?: boolean;
+ }
+
+ interface SocketOptions {
+ type: "udp4" | "udp6";
+ reuseAddr?: boolean;
+ }
+
+ export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+ export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+
+ export interface Socket extends events.EventEmitter {
+ send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
+ send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
+ bind(port?: number, address?: string, callback?: () => void): void;
+ bind(options: BindOptions, callback?: Function): void;
+ close(callback?: any): void;
+ address(): AddressInfo;
+ setBroadcast(flag: boolean): void;
+ setTTL(ttl: number): void;
+ setMulticastTTL(ttl: number): void;
+ setMulticastLoopback(flag: boolean): void;
+ addMembership(multicastAddress: string, multicastInterface?: string): void;
+ dropMembership(multicastAddress: string, multicastInterface?: string): void;
+ ref(): this;
+ unref(): this;
+
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. error
+ * 3. listening
+ * 4. message
+ **/
+ addListener(event: string, listener: Function): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(event: "message", msg: Buffer, rinfo: AddressInfo): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
+ }
+}
+
+declare module "fs" {
+ import * as stream from "stream";
+ import * as events from "events";
+
+ interface Stats {
+ isFile(): boolean;
+ isDirectory(): boolean;
+ isBlockDevice(): boolean;
+ isCharacterDevice(): boolean;
+ isSymbolicLink(): boolean;
+ isFIFO(): boolean;
+ isSocket(): boolean;
+ dev: number;
+ ino: number;
+ mode: number;
+ nlink: number;
+ uid: number;
+ gid: number;
+ rdev: number;
+ size: number;
+ blksize: number;
+ blocks: number;
+ atime: Date;
+ mtime: Date;
+ ctime: Date;
+ birthtime: Date;
+ }
+
+ interface FSWatcher extends events.EventEmitter {
+ close(): void;
+
+ /**
+ * events.EventEmitter
+ * 1. change
+ * 2. error
+ */
+ addListener(event: string, listener: Function): this;
+ addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ addListener(event: "error", listener: (code: number, signal: string) => void): this;
+
+ on(event: string, listener: Function): this;
+ on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ on(event: "error", listener: (code: number, signal: string) => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ once(event: "error", listener: (code: number, signal: string) => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ prependListener(event: "error", listener: (code: number, signal: string) => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ prependOnceListener(event: "error", listener: (code: number, signal: string) => void): this;
+ }
+
+ export interface ReadStream extends stream.Readable {
+ close(): void;
+ destroy(): void;
+ bytesRead: number;
+ path: string | Buffer;
+
+ /**
+ * events.EventEmitter
+ * 1. open
+ * 2. close
+ */
+ addListener(event: string, listener: Function): this;
+ addListener(event: "open", listener: (fd: number) => void): this;
+ addListener(event: "close", listener: () => void): this;
+
+ on(event: string, listener: Function): this;
+ on(event: "open", listener: (fd: number) => void): this;
+ on(event: "close", listener: () => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "open", listener: (fd: number) => void): this;
+ once(event: "close", listener: () => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "open", listener: (fd: number) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ }
+
+ export interface WriteStream extends stream.Writable {
+ close(): void;
+ bytesWritten: number;
+ path: string | Buffer;
+
+ /**
+ * events.EventEmitter
+ * 1. open
+ * 2. close
+ */
+ addListener(event: string, listener: Function): this;
+ addListener(event: "open", listener: (fd: number) => void): this;
+ addListener(event: "close", listener: () => void): this;
+
+ on(event: string, listener: Function): this;
+ on(event: "open", listener: (fd: number) => void): this;
+ on(event: "close", listener: () => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "open", listener: (fd: number) => void): this;
+ once(event: "close", listener: () => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "open", listener: (fd: number) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ }
+
+ /**
+ * Asynchronous rename.
+ * @param oldPath
+ * @param newPath
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /**
+ * Synchronous rename
+ * @param oldPath
+ * @param newPath
+ */
+ export function renameSync(oldPath: string, newPath: string): void;
+ export function truncate(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function truncate(path: string | Buffer, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function truncateSync(path: string | Buffer, len?: number): void;
+ export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function ftruncateSync(fd: number, len?: number): void;
+ export function chown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function chownSync(path: string | Buffer, uid: number, gid: number): void;
+ export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fchownSync(fd: number, uid: number, gid: number): void;
+ export function lchown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function lchownSync(path: string | Buffer, uid: number, gid: number): void;
+ export function chmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function chmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function chmodSync(path: string | Buffer, mode: number): void;
+ export function chmodSync(path: string | Buffer, mode: string): void;
+ export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fchmodSync(fd: number, mode: number): void;
+ export function fchmodSync(fd: number, mode: string): void;
+ export function lchmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function lchmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function lchmodSync(path: string | Buffer, mode: number): void;
+ export function lchmodSync(path: string | Buffer, mode: string): void;
+ export function stat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
+ export function lstat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
+ export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
+ export function statSync(path: string | Buffer): Stats;
+ export function lstatSync(path: string | Buffer): Stats;
+ export function fstatSync(fd: number): Stats;
+ export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function linkSync(srcpath: string | Buffer, dstpath: string | Buffer): void;
+ export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function symlinkSync(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): void;
+ export function readlink(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void;
+ export function readlinkSync(path: string | Buffer): string;
+ export function realpath(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
+ export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
+ export function realpathSync(path: string | Buffer, cache?: { [path: string]: string }): string;
+ /**
+ * Asynchronous unlink - deletes the file specified in {path}
+ *
+ * @param path
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function unlink(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /**
+ * Synchronous unlink - deletes the file specified in {path}
+ *
+ * @param path
+ */
+ export function unlinkSync(path: string | Buffer): void;
+ /**
+ * Asynchronous rmdir - removes the directory specified in {path}
+ *
+ * @param path
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function rmdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /**
+ * Synchronous rmdir - removes the directory specified in {path}
+ *
+ * @param path
+ */
+ export function rmdirSync(path: string | Buffer): void;
+ /**
+ * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /**
+ * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdir(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /**
+ * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdir(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /**
+ * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdirSync(path: string | Buffer, mode?: number): void;
+ /**
+ * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdirSync(path: string | Buffer, mode?: string): void;
+ /**
+ * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ *
+ * @param prefix
+ * @param callback The created folder path is passed as a string to the callback's second parameter.
+ */
+ export function mkdtemp(prefix: string, callback?: (err: NodeJS.ErrnoException, folder: string) => void): void;
+ /**
+ * Synchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ *
+ * @param prefix
+ * @returns Returns the created folder path.
+ */
+ export function mkdtempSync(prefix: string): string;
+ export function readdir(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void;
+ export function readdirSync(path: string | Buffer): string[];
+ export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function closeSync(fd: number): void;
+ export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
+ export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
+ export function openSync(path: string | Buffer, flags: string | number, mode?: number): number;
+ export function utimes(path: string | Buffer, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function utimesSync(path: string | Buffer, atime: number, mtime: number): void;
+ export function utimesSync(path: string | Buffer, atime: Date, mtime: Date): void;
+ export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function futimesSync(fd: number, atime: number, mtime: number): void;
+ export function futimesSync(fd: number, atime: Date, mtime: Date): void;
+ export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fsyncSync(fd: number): void;
+ export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
+ export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
+ export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
+ export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
+ export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
+ export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): number;
+ export function writeSync(fd: number, data: any, position?: number | null, enconding?: string): number;
+ export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
+ export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): number;
+ /**
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param encoding
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, encoding: null, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
+ export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
+ export function readFile(filename: string, encoding: string | null, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void;
+ /**
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, options: { encoding: null; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
+ export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
+ export function readFile(filename: string, options: { encoding: string | null; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void;
+ /**
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
+ /**
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
+ /**
+ * Synchronous readFile - Synchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param encoding
+ */
+ export function readFileSync(filename: string, encoding: null): Buffer;
+ export function readFileSync(filename: string, encoding: string): string;
+ export function readFileSync(filename: string, encoding: string | null): string | Buffer;
+ /**
+ * Synchronous readFile - Synchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
+ */
+ export function readFileSync(filename: string, options: { encoding: null; flag?: string; }): Buffer;
+ export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
+ export function readFileSync(filename: string, options: { encoding: string | null; flag?: string; }): string | Buffer;
+ /**
+ * Synchronous readFile - Synchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
+ */
+ export function readFileSync(filename: string, options?: { flag?: string; }): Buffer;
+ export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function writeFile(filename: string, data: any, encoding: string, callback: (err: NodeJS.ErrnoException) => void): void;
+ export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function writeFileSync(filename: string, data: any, encoding: string): void;
+ export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
+ export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
+ export function appendFile(filename: string, data: any, encoding: string, callback: (err: NodeJS.ErrnoException) => void): void;
+ export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function appendFileSync(filename: string, data: any, encoding: string): void;
+ export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
+ export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
+ export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;
+ export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;
+ export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;
+ export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;
+ export function watch(filename: string, encoding: string, listener?: (event: string, filename: string | Buffer) => any): FSWatcher;
+ export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string | Buffer) => any): FSWatcher;
+ export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void;
+ export function existsSync(path: string | Buffer): boolean;
+
+ export namespace constants {
+ // File Access Constants
+
+ /** Constant for fs.access(). File is visible to the calling process. */
+ export const F_OK: number;
+
+ /** Constant for fs.access(). File can be read by the calling process. */
+ export const R_OK: number;
+
+ /** Constant for fs.access(). File can be written by the calling process. */
+ export const W_OK: number;
+
+ /** Constant for fs.access(). File can be executed by the calling process. */
+ export const X_OK: number;
+
+ // File Open Constants
+
+ /** Constant for fs.open(). Flag indicating to open a file for read-only access. */
+ export const O_RDONLY: number;
+
+ /** Constant for fs.open(). Flag indicating to open a file for write-only access. */
+ export const O_WRONLY: number;
+
+ /** Constant for fs.open(). Flag indicating to open a file for read-write access. */
+ export const O_RDWR: number;
+
+ /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */
+ export const O_CREAT: number;
+
+ /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */
+ export const O_EXCL: number;
+
+ /** Constant for fs.open(). Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one). */
+ export const O_NOCTTY: number;
+
+ /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */
+ export const O_TRUNC: number;
+
+ /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */
+ export const O_APPEND: number;
+
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */
+ export const O_DIRECTORY: number;
+
+ /** Constant for fs.open(). Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file. This flag is available on Linux operating systems only. */
+ export const O_NOATIME: number;
+
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */
+ export const O_NOFOLLOW: number;
+
+ /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */
+ export const O_SYNC: number;
+
+ /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */
+ export const O_SYMLINK: number;
+
+ /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */
+ export const O_DIRECT: number;
+
+ /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */
+ export const O_NONBLOCK: number;
+
+ // File Type Constants
+
+ /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */
+ export const S_IFMT: number;
+
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */
+ export const S_IFREG: number;
+
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */
+ export const S_IFDIR: number;
+
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */
+ export const S_IFCHR: number;
+
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */
+ export const S_IFBLK: number;
+
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */
+ export const S_IFIFO: number;
+
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */
+ export const S_IFLNK: number;
+
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */
+ export const S_IFSOCK: number;
+
+ // File Mode Constants
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */
+ export const S_IRWXU: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */
+ export const S_IRUSR: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */
+ export const S_IWUSR: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */
+ export const S_IXUSR: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */
+ export const S_IRWXG: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */
+ export const S_IRGRP: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */
+ export const S_IWGRP: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */
+ export const S_IXGRP: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */
+ export const S_IRWXO: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */
+ export const S_IROTH: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */
+ export const S_IWOTH: number;
+
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */
+ export const S_IXOTH: number;
+ }
+
+ /** Tests a user's permissions for the file specified by path. */
+ export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
+ export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
+ /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */
+ export function accessSync(path: string | Buffer, mode?: number): void;
+ export function createReadStream(path: string | Buffer, options?: {
+ flags?: string;
+ encoding?: string;
+ fd?: number;
+ mode?: number;
+ autoClose?: boolean;
+ start?: number;
+ end?: number;
+ }): ReadStream;
+ export function createWriteStream(path: string | Buffer, options?: {
+ flags?: string;
+ encoding?: string;
+ fd?: number;
+ mode?: number;
+ autoClose?: boolean;
+ start?: number;
+ }): WriteStream;
+ export function fdatasync(fd: number, callback: Function): void;
+ export function fdatasyncSync(fd: number): void;
+}
+
+declare module "path" {
+
+ /**
+ * A parsed path object generated by path.parse() or consumed by path.format().
+ */
+ export interface ParsedPath {
+ /**
+ * The root of the path such as '/' or 'c:\'
+ */
+ root: string;
+ /**
+ * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+ */
+ dir: string;
+ /**
+ * The file name including extension (if any) such as 'index.html'
+ */
+ base: string;
+ /**
+ * The file extension (if any) such as '.html'
+ */
+ ext: string;
+ /**
+ * The file name without extension (if any) such as 'index'
+ */
+ name: string;
+ }
+
+ /**
+ * Normalize a string path, reducing '..' and '.' parts.
+ * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
+ *
+ * @param p string path to normalize.
+ */
+ export function normalize(p: string): string;
+ /**
+ * Join all arguments together and normalize the resulting path.
+ * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
+ *
+ * @param paths paths to join.
+ */
+ export function join(...paths: string[]): string;
+ /**
+ * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
+ *
+ * Starting from leftmost {from} paramter, resolves {to} to an absolute path.
+ *
+ * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
+ *
+ * @param pathSegments string paths to join. Non-string arguments are ignored.
+ */
+ export function resolve(...pathSegments: any[]): string;
+ /**
+ * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
+ *
+ * @param path path to test.
+ */
+ export function isAbsolute(path: string): boolean;
+ /**
+ * Solve the relative path from {from} to {to}.
+ * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
+ *
+ * @param from
+ * @param to
+ */
+ export function relative(from: string, to: string): string;
+ /**
+ * Return the directory name of a path. Similar to the Unix dirname command.
+ *
+ * @param p the path to evaluate.
+ */
+ export function dirname(p: string): string;
+ /**
+ * Return the last portion of a path. Similar to the Unix basename command.
+ * Often used to extract the file name from a fully qualified path.
+ *
+ * @param p the path to evaluate.
+ * @param ext optionally, an extension to remove from the result.
+ */
+ export function basename(p: string, ext?: string): string;
+ /**
+ * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
+ * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
+ *
+ * @param p the path to evaluate.
+ */
+ export function extname(p: string): string;
+ /**
+ * The platform-specific file separator. '\\' or '/'.
+ */
+ export var sep: string;
+ /**
+ * The platform-specific file delimiter. ';' or ':'.
+ */
+ export var delimiter: string;
+ /**
+ * Returns an object from a path string - the opposite of format().
+ *
+ * @param pathString path to evaluate.
+ */
+ export function parse(pathString: string): ParsedPath;
+ /**
+ * Returns a path string from an object - the opposite of parse().
+ *
+ * @param pathString path to evaluate.
+ */
+ export function format(pathObject: ParsedPath): string;
+
+ export module posix {
+ export function normalize(p: string): string;
+ export function join(...paths: any[]): string;
+ export function resolve(...pathSegments: any[]): string;
+ export function isAbsolute(p: string): boolean;
+ export function relative(from: string, to: string): string;
+ export function dirname(p: string): string;
+ export function basename(p: string, ext?: string): string;
+ export function extname(p: string): string;
+ export var sep: string;
+ export var delimiter: string;
+ export function parse(p: string): ParsedPath;
+ export function format(pP: ParsedPath): string;
+ }
+
+ export module win32 {
+ export function normalize(p: string): string;
+ export function join(...paths: any[]): string;
+ export function resolve(...pathSegments: any[]): string;
+ export function isAbsolute(p: string): boolean;
+ export function relative(from: string, to: string): string;
+ export function dirname(p: string): string;
+ export function basename(p: string, ext?: string): string;
+ export function extname(p: string): string;
+ export var sep: string;
+ export var delimiter: string;
+ export function parse(p: string): ParsedPath;
+ export function format(pP: ParsedPath): string;
+ }
+}
+
+declare module "string_decoder" {
+ export interface NodeStringDecoder {
+ write(buffer: Buffer): string;
+ end(buffer?: Buffer): string;
+ }
+ export var StringDecoder: {
+ new (encoding?: string): NodeStringDecoder;
+ };
+}
+
+declare module "tls" {
+ import * as crypto from "crypto";
+ import * as net from "net";
+ import * as stream from "stream";
+
+ var CLIENT_RENEG_LIMIT: number;
+ var CLIENT_RENEG_WINDOW: number;
+
+ export interface Certificate {
+ /**
+ * Country code.
+ */
+ C: string;
+ /**
+ * Street.
+ */
+ ST: string;
+ /**
+ * Locality.
+ */
+ L: string;
+ /**
+ * Organization.
+ */
+ O: string;
+ /**
+ * Organizational unit.
+ */
+ OU: string;
+ /**
+ * Common name.
+ */
+ CN: string;
+ }
+
+ export interface CipherNameAndProtocol {
+ /**
+ * The cipher name.
+ */
+ name: string;
+ /**
+ * SSL/TLS protocol version.
+ */
+ version: string;
+ }
+
+ export class TLSSocket extends net.Socket {
+ /**
+ * Construct a new tls.TLSSocket object from an existing TCP socket.
+ */
+ constructor(socket:net.Socket, options?: {
+ /**
+ * An optional TLS context object from tls.createSecureContext()
+ */
+ secureContext?: SecureContext,
+ /**
+ * If true the TLS socket will be instantiated in server-mode.
+ * Defaults to false.
+ */
+ isServer?: boolean,
+ /**
+ * An optional net.Server instance.
+ */
+ server?: net.Server,
+ /**
+ * If true the server will request a certificate from clients that
+ * connect and attempt to verify that certificate. Defaults to
+ * false.
+ */
+ requestCert?: boolean,
+ /**
+ * If true the server will reject any connection which is not
+ * authorized with the list of supplied CAs. This option only has an
+ * effect if requestCert is true. Defaults to false.
+ */
+ rejectUnauthorized?: boolean,
+ /**
+ * An array of strings or a Buffer naming possible NPN protocols.
+ * (Protocols should be ordered by their priority.)
+ */
+ NPNProtocols?: string[] | Buffer,
+ /**
+ * An array of strings or a Buffer naming possible ALPN protocols.
+ * (Protocols should be ordered by their priority.) When the server
+ * receives both NPN and ALPN extensions from the client, ALPN takes
+ * precedence over NPN and the server does not send an NPN extension
+ * to the client.
+ */
+ ALPNProtocols?: string[] | Buffer,
+ /**
+ * SNICallback(servername, cb) A function that will be
+ * called if the client supports SNI TLS extension. Two arguments
+ * will be passed when called: servername and cb. SNICallback should
+ * invoke cb(null, ctx), where ctx is a SecureContext instance.
+ * (tls.createSecureContext(...) can be used to get a proper
+ * SecureContext.) If SNICallback wasn't provided the default callback
+ * with high-level API will be used (see below).
+ */
+ SNICallback?: Function,
+ /**
+ * An optional Buffer instance containing a TLS session.
+ */
+ session?: Buffer,
+ /**
+ * If true, specifies that the OCSP status request extension will be
+ * added to the client hello and an 'OCSPResponse' event will be
+ * emitted on the socket before establishing a secure communication
+ */
+ requestOCSP?: boolean
+ });
+ /**
+ * Returns the bound address, the address family name and port of the underlying socket as reported by
+ * the operating system.
+ * @returns {any} - An object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' }.
+ */
+ address(): { port: number; family: string; address: string };
+ /**
+ * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.
+ */
+ authorized: boolean;
+ /**
+ * The reason why the peer's certificate has not been verified.
+ * This property becomes available only when tlsSocket.authorized === false.
+ */
+ authorizationError: Error;
+ /**
+ * Static boolean value, always true.
+ * May be used to distinguish TLS sockets from regular ones.
+ */
+ encrypted: boolean;
+ /**
+ * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.
+ * @returns {CipherNameAndProtocol} - Returns an object representing the cipher name
+ * and the SSL/TLS protocol version of the current connection.
+ */
+ getCipher(): CipherNameAndProtocol;
+ /**
+ * Returns an object representing the peer's certificate.
+ * The returned object has some properties corresponding to the field of the certificate.
+ * If detailed argument is true the full chain with issuer property will be returned,
+ * if false only the top certificate without issuer property.
+ * If the peer does not provide a certificate, it returns null or an empty object.
+ * @param {boolean} detailed - If true; the full chain with issuer property will be returned.
+ * @returns {any} - An object representing the peer's certificate.
+ */
+ getPeerCertificate(detailed?: boolean): {
+ subject: Certificate;
+ issuerInfo: Certificate;
+ issuer: Certificate;
+ raw: any;
+ valid_from: string;
+ valid_to: string;
+ fingerprint: string;
+ serialNumber: string;
+ };
+ /**
+ * Could be used to speed up handshake establishment when reconnecting to the server.
+ * @returns {any} - ASN.1 encoded TLS session or undefined if none was negotiated.
+ */
+ getSession(): any;
+ /**
+ * NOTE: Works only with client TLS sockets.
+ * Useful only for debugging, for session reuse provide session option to tls.connect().
+ * @returns {any} - TLS session ticket or undefined if none was negotiated.
+ */
+ getTLSTicket(): any;
+ /**
+ * The string representation of the local IP address.
+ */
+ localAddress: string;
+ /**
+ * The numeric representation of the local port.
+ */
+ localPort: number;
+ /**
+ * The string representation of the remote IP address.
+ * For example, '74.125.127.100' or '2001:4860:a005::68'.
+ */
+ remoteAddress: string;
+ /**
+ * The string representation of the remote IP family. 'IPv4' or 'IPv6'.
+ */
+ remoteFamily: string;
+ /**
+ * The numeric representation of the remote port. For example, 443.
+ */
+ remotePort: number;
+ /**
+ * Initiate TLS renegotiation process.
+ *
+ * NOTE: Can be used to request peer's certificate after the secure connection has been established.
+ * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout.
+ * @param {TlsOptions} options - The options may contain the following fields: rejectUnauthorized,
+ * requestCert (See tls.createServer() for details).
+ * @param {Function} callback - callback(err) will be executed with null as err, once the renegotiation
+ * is successfully completed.
+ */
+ renegotiate(options: TlsOptions, callback: (err: Error) => any): any;
+ /**
+ * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
+ * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
+ * the TLS layer until the entire fragment is received and its integrity is verified;
+ * large fragments can span multiple roundtrips, and their processing can be delayed due to packet
+ * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead,
+ * which may decrease overall server throughput.
+ * @param {number} size - TLS fragment size (default and maximum value is: 16384, minimum is: 512).
+ * @returns {boolean} - Returns true on success, false otherwise.
+ */
+ setMaxSendFragment(size: number): boolean;
+
+ /**
+ * events.EventEmitter
+ * 1. OCSPResponse
+ * 2. secureConnect
+ **/
+ addListener(event: string, listener: Function): this;
+ addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ addListener(event: "secureConnect", listener: () => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "OCSPResponse", response: Buffer): boolean;
+ emit(event: "secureConnect"): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ on(event: "secureConnect", listener: () => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ once(event: "secureConnect", listener: () => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ prependListener(event: "secureConnect", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ prependOnceListener(event: "secureConnect", listener: () => void): this;
+ }
+
+ export interface TlsOptions {
+ host?: string;
+ port?: number;
+ pfx?: string | Buffer[];
+ key?: string | string[] | Buffer | any[];
+ passphrase?: string;
+ cert?: string | string[] | Buffer | Buffer[];
+ ca?: string | string[] | Buffer | Buffer[];
+ crl?: string | string[];
+ ciphers?: string;
+ honorCipherOrder?: boolean;
+ requestCert?: boolean;
+ rejectUnauthorized?: boolean;
+ NPNProtocols?: string[] | Buffer;
+ SNICallback?: (servername: string, cb: (err: Error, ctx: SecureContext) => any) => any;
+ ecdhCurve?: string;
+ dhparam?: string | Buffer;
+ handshakeTimeout?: number;
+ ALPNProtocols?: string[] | Buffer;
+ sessionTimeout?: number;
+ ticketKeys?: any;
+ sessionIdContext?: string;
+ secureProtocol?: string;
+ }
+
+ export interface ConnectionOptions {
+ host?: string;
+ port?: number;
+ socket?: net.Socket;
+ pfx?: string | Buffer
+ key?: string | string[] | Buffer | Buffer[];
+ passphrase?: string;
+ cert?: string | string[] | Buffer | Buffer[];
+ ca?: string | Buffer | (string | Buffer)[];
+ rejectUnauthorized?: boolean;
+ NPNProtocols?: (string | Buffer)[];
+ servername?: string;
+ path?: string;
+ ALPNProtocols?: (string | Buffer)[];
+ checkServerIdentity?: (servername: string, cert: string | Buffer | (string | Buffer)[]) => any;
+ secureProtocol?: string;
+ secureContext?: Object;
+ session?: Buffer;
+ minDHSize?: number;
+ }
+
+ export interface Server extends net.Server {
+ close(callback?: Function): Server;
+ address(): { port: number; family: string; address: string; };
+ addContext(hostName: string, credentials: {
+ key: string;
+ cert: string;
+ ca: string;
+ }): void;
+ maxConnections: number;
+ connections: number;
+
+ /**
+ * events.EventEmitter
+ * 1. tlsClientError
+ * 2. newSession
+ * 3. OCSPRequest
+ * 4. resumeSession
+ * 5. secureConnection
+ **/
+ addListener(event: string, listener: Function): this;
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
+ addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
+ addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
+ addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
+ emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean;
+ emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: Function): boolean;
+ emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean;
+ emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
+ on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
+ on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
+ on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
+ once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
+ once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
+ once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
+ prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
+ prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
+ prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
+ prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
+ prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
+ prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ }
+
+ export interface ClearTextStream extends stream.Duplex {
+ authorized: boolean;
+ authorizationError: Error;
+ getPeerCertificate(): any;
+ getCipher: {
+ name: string;
+ version: string;
+ };
+ address: {
+ port: number;
+ family: string;
+ address: string;
+ };
+ remoteAddress: string;
+ remotePort: number;
+ }
+
+ export interface SecurePair {
+ encrypted: any;
+ cleartext: any;
+ }
+
+ export interface SecureContextOptions {
+ pfx?: string | Buffer;
+ key?: string | Buffer;
+ passphrase?: string;
+ cert?: string | Buffer;
+ ca?: string | Buffer;
+ crl?: string | string[]
+ ciphers?: string;
+ honorCipherOrder?: boolean;
+ }
+
+ export interface SecureContext {
+ context: any;
+ }
+
+ export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
+ export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket;
+ export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+ export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+ export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
+ export function createSecureContext(details: SecureContextOptions): SecureContext;
+}
+
+declare module "crypto" {
+ export interface Certificate {
+ exportChallenge(spkac: string | Buffer): Buffer;
+ exportPublicKey(spkac: string | Buffer): Buffer;
+ verifySpkac(spkac: Buffer): boolean;
+ }
+ export var Certificate: {
+ new (): Certificate;
+ (): Certificate;
+ }
+
+ export var fips: boolean;
+
+ export interface CredentialDetails {
+ pfx: string;
+ key: string;
+ passphrase: string;
+ cert: string;
+ ca: string | string[];
+ crl: string | string[];
+ ciphers: string;
+ }
+ export interface Credentials { context?: any; }
+ export function createCredentials(details: CredentialDetails): Credentials;
+ export function createHash(algorithm: string): Hash;
+ export function createHmac(algorithm: string, key: string | Buffer): Hmac;
+
+ type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
+ type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
+ type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary";
+ type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
+ type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
+
+ export interface Hash extends NodeJS.ReadWriteStream {
+ update(data: string | Buffer): Hash;
+ update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Hash;
+ digest(): Buffer;
+ digest(encoding: HexBase64Latin1Encoding): string;
+ }
+ export interface Hmac extends NodeJS.ReadWriteStream {
+ update(data: string | Buffer): Hmac;
+ update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
+ digest(): Buffer;
+ digest(encoding: HexBase64Latin1Encoding): string;
+ }
+ export function createCipher(algorithm: string, password: any): Cipher;
+ export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
+ export interface Cipher extends NodeJS.ReadWriteStream {
+ update(data: Buffer): Buffer;
+ update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
+ update(data: Buffer, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
+ update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
+ final(): Buffer;
+ final(output_encoding: string): string;
+ setAutoPadding(auto_padding?: boolean): void;
+ getAuthTag(): Buffer;
+ setAAD(buffer: Buffer): void;
+ }
+ export function createDecipher(algorithm: string, password: any): Decipher;
+ export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
+ export interface Decipher extends NodeJS.ReadWriteStream {
+ update(data: Buffer): Buffer;
+ update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
+ update(data: Buffer, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
+ update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
+ final(): Buffer;
+ final(output_encoding: string): string;
+ setAutoPadding(auto_padding?: boolean): void;
+ setAuthTag(tag: Buffer): void;
+ setAAD(buffer: Buffer): void;
+ }
+ export function createSign(algorithm: string): Signer;
+ export interface Signer extends NodeJS.WritableStream {
+ update(data: string | Buffer): Signer;
+ update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Signer;
+ sign(private_key: string | { key: string; passphrase: string }): Buffer;
+ sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;
+ }
+ export function createVerify(algorith: string): Verify;
+ export interface Verify extends NodeJS.WritableStream {
+ update(data: string | Buffer): Verify;
+ update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Verify;
+ verify(object: string, signature: Buffer): boolean;
+ verify(object: string, signature: string, signature_format: HexBase64Latin1Encoding): boolean;
+ }
+ export function createDiffieHellman(prime_length: number, generator?: number): DiffieHellman;
+ export function createDiffieHellman(prime: Buffer): DiffieHellman;
+ export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
+ export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer): DiffieHellman;
+ export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
+ export interface DiffieHellman {
+ generateKeys(): Buffer;
+ generateKeys(encoding: HexBase64Latin1Encoding): string;
+ computeSecret(other_public_key: Buffer): Buffer;
+ computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
+ computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
+ getPrime(): Buffer;
+ getPrime(encoding: HexBase64Latin1Encoding): string;
+ getGenerator(): Buffer;
+ getGenerator(encoding: HexBase64Latin1Encoding): string;
+ getPublicKey(): Buffer;
+ getPublicKey(encoding: HexBase64Latin1Encoding): string;
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: HexBase64Latin1Encoding): string;
+ setPublicKey(public_key: Buffer): void;
+ setPublicKey(public_key: string, encoding: string): void;
+ setPrivateKey(private_key: Buffer): void;
+ setPrivateKey(private_key: string, encoding: string): void;
+ verifyError: number;
+ }
+ export function getDiffieHellman(group_name: string): DiffieHellman;
+ export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;
+ export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer;
+ export function randomBytes(size: number): Buffer;
+ export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
+ export function pseudoRandomBytes(size: number): Buffer;
+ export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
+ export interface RsaPublicKey {
+ key: string;
+ padding?: number;
+ }
+ export interface RsaPrivateKey {
+ key: string;
+ passphrase?: string,
+ padding?: number;
+ }
+ export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer
+ export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer
+ export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer
+ export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer
+ export function getCiphers(): string[];
+ export function getCurves(): string[];
+ export function getHashes(): string[];
+ export interface ECDH {
+ generateKeys(): Buffer;
+ generateKeys(encoding: HexBase64Latin1Encoding): string;
+ generateKeys(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string;
+ computeSecret(other_public_key: Buffer): Buffer;
+ computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
+ computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: HexBase64Latin1Encoding): string;
+ getPublicKey(): Buffer;
+ getPublicKey(encoding: HexBase64Latin1Encoding): string;
+ getPublicKey(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string;
+ setPrivateKey(private_key: Buffer): void;
+ setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
+ }
+ export function createECDH(curve_name: string): ECDH;
+ export function timingSafeEqual(a: Buffer, b: Buffer): boolean;
+ export var DEFAULT_ENCODING: string;
+}
+
+declare module "stream" {
+ import * as events from "events";
+
+ class internal extends events.EventEmitter {
+ pipe(destination: T, options?: { end?: boolean; }): T;
+ }
+
+ namespace internal {
+
+ export class Stream extends internal { }
+
+ export interface ReadableOptions {
+ highWaterMark?: number;
+ encoding?: string;
+ objectMode?: boolean;
+ read?: (this: Readable, size?: number) => any;
+ }
+
+ export class Readable extends Stream implements NodeJS.ReadableStream {
+ readable: boolean;
+ constructor(opts?: ReadableOptions);
+ _read(size: number): void;
+ read(size?: number): any;
+ setEncoding(encoding: string): void;
+ pause(): this;
+ resume(): this;
+ isPaused(): boolean;
+ pipe(destination: T, options?: { end?: boolean; }): T;
+ unpipe(destination?: T): void;
+ unshift(chunk: any): void;
+ wrap(oldStream: NodeJS.ReadableStream): Readable;
+ push(chunk: any, encoding?: string): boolean;
+
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. data
+ * 3. end
+ * 4. readable
+ * 5. error
+ **/
+ addListener(event: string, listener: Function): this;
+ addListener(event: string, listener: Function): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: Buffer | string): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "readable"): boolean;
+ emit(event: "error", err: Error): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+
+ removeListener(event: string, listener: Function): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ removeListener(event: "end", listener: () => void): this;
+ removeListener(event: "readable", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ }
+
+ export interface WritableOptions {
+ highWaterMark?: number;
+ decodeStrings?: boolean;
+ objectMode?: boolean;
+ write?: (chunk: string | Buffer, encoding: string, callback: Function) => any;
+ writev?: (chunks: { chunk: string | Buffer, encoding: string }[], callback: Function) => any;
+ }
+
+ export class Writable extends Stream implements NodeJS.WritableStream {
+ writable: boolean;
+ constructor(opts?: WritableOptions);
+ _write(chunk: any, encoding: string, callback: Function): void;
+ write(chunk: any, cb?: Function): boolean;
+ write(chunk: any, encoding?: string, cb?: Function): boolean;
+ setDefaultEncoding(encoding: string): this;
+ end(): void;
+ end(chunk: any, cb?: Function): void;
+ end(chunk: any, encoding?: string, cb?: Function): void;
+
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. drain
+ * 3. error
+ * 4. finish
+ * 5. pipe
+ * 6. unpipe
+ **/
+ addListener(event: string, listener: Function): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "drain", chunk: Buffer | string): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "pipe", src: Readable): boolean;
+ emit(event: "unpipe", src: Readable): boolean;
+
+ on(event: string, listener: Function): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pipe", listener: (src: Readable) => void): this;
+ on(event: "unpipe", listener: (src: Readable) => void): this;
+
+ once(event: string, listener: Function): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pipe", listener: (src: Readable) => void): this;
+ once(event: "unpipe", listener: (src: Readable) => void): this;
+
+ prependListener(event: string, listener: Function): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
+
+ prependOnceListener(event: string, listener: Function): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
+
+ removeListener(event: string, listener: Function): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "drain", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "finish", listener: () => void): this;
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
+ }
+
+ export interface DuplexOptions extends ReadableOptions, WritableOptions {
+ allowHalfOpen?: boolean;
+ readableObjectMode?: boolean;
+ writableObjectMode?: boolean;
+ }
+
+ // Note: Duplex extends both Readable and Writable.
+ export class Duplex extends Readable implements Writable {
+ writable: boolean;
+ constructor(opts?: DuplexOptions);
+ _write(chunk: any, encoding: string, callback: Function): void;
+ write(chunk: any, cb?: Function): boolean;
+ write(chunk: any, encoding?: string, cb?: Function): boolean;
+ setDefaultEncoding(encoding: string): this;
+ end(): void;
+ end(chunk: any, cb?: Function): void;
+ end(chunk: any, encoding?: string, cb?: Function): void;
+ }
+
+ export interface TransformOptions extends DuplexOptions {
+ transform?: (chunk: string | Buffer, encoding: string, callback: Function) => any;
+ flush?: (callback: Function) => any;
+ }
+
+ export class Transform extends Duplex {
+ constructor(opts?: TransformOptions);
+ _transform(chunk: any, encoding: string, callback: Function): void;
+ }
+
+ export class PassThrough extends Transform { }
+ }
+
+ export = internal;
+}
+
+declare module "util" {
+ export interface InspectOptions extends NodeJS.InspectOptions {}
+ export function format(format: any, ...param: any[]): string;
+ export function debug(string: string): void;
+ export function error(...param: any[]): void;
+ export function puts(...param: any[]): void;
+ export function print(...param: any[]): void;
+ export function log(string: string): void;
+ export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
+ export function inspect(object: any, options: InspectOptions): string;
+ export function isArray(object: any): boolean;
+ export function isRegExp(object: any): boolean;
+ export function isDate(object: any): boolean;
+ export function isError(object: any): boolean;
+ export function inherits(constructor: any, superConstructor: any): void;
+ export function debuglog(key: string): (msg: string, ...param: any[]) => void;
+ export function isBoolean(object: any): boolean;
+ export function isBuffer(object: any): boolean;
+ export function isFunction(object: any): boolean;
+ export function isNull(object: any): boolean;
+ export function isNullOrUndefined(object: any): boolean;
+ export function isNumber(object: any): boolean;
+ export function isObject(object: any): boolean;
+ export function isPrimitive(object: any): boolean;
+ export function isString(object: any): boolean;
+ export function isSymbol(object: any): boolean;
+ export function isUndefined(object: any): boolean;
+ export function deprecate(fn: Function, message: string): Function;
+}
+
+declare module "assert" {
+ function internal(value: any, message?: string): void;
+ namespace internal {
+ export class AssertionError implements Error {
+ name: string;
+ message: string;
+ actual: any;
+ expected: any;
+ operator: string;
+ generatedMessage: boolean;
+
+ constructor(options?: {
+ message?: string; actual?: any; expected?: any;
+ operator?: string; stackStartFunction?: Function
+ });
+ }
+
+ export function fail(actual: any, expected: any, message?: string, operator?: string): void;
+ export function ok(value: any, message?: string): void;
+ export function equal(actual: any, expected: any, message?: string): void;
+ export function notEqual(actual: any, expected: any, message?: string): void;
+ export function deepEqual(actual: any, expected: any, message?: string): void;
+ export function notDeepEqual(acutal: any, expected: any, message?: string): void;
+ export function strictEqual(actual: any, expected: any, message?: string): void;
+ export function notStrictEqual(actual: any, expected: any, message?: string): void;
+ export function deepStrictEqual(actual: any, expected: any, message?: string): void;
+ export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
+
+ export function throws(block: Function, message?: string): void;
+ export function throws(block: Function, error: Function, message?: string): void;
+ export function throws(block: Function, error: RegExp, message?: string): void;
+ export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
+
+ export function doesNotThrow(block: Function, message?: string): void;
+ export function doesNotThrow(block: Function, error: Function, message?: string): void;
+ export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
+ export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
+
+ export function ifError(value: any): void;
+ }
+
+ export = internal;
+}
+
+declare module "tty" {
+ import * as net from "net";
+
+ export function isatty(fd: number): boolean;
+ export interface ReadStream extends net.Socket {
+ isRaw: boolean;
+ setRawMode(mode: boolean): void;
+ isTTY: boolean;
+ }
+ export interface WriteStream extends net.Socket {
+ columns: number;
+ rows: number;
+ isTTY: boolean;
+ }
+}
+
+declare module "domain" {
+ import * as events from "events";
+
+ export class Domain extends events.EventEmitter implements NodeJS.Domain {
+ run(fn: Function): void;
+ add(emitter: events.EventEmitter): void;
+ remove(emitter: events.EventEmitter): void;
+ bind(cb: (err: Error, data: any) => any): any;
+ intercept(cb: (data: any) => any): any;
+ dispose(): void;
+ members: any[];
+ enter(): void;
+ exit(): void;
+ }
+
+ export function create(): Domain;
+}
+
+declare module "constants" {
+ export var E2BIG: number;
+ export var EACCES: number;
+ export var EADDRINUSE: number;
+ export var EADDRNOTAVAIL: number;
+ export var EAFNOSUPPORT: number;
+ export var EAGAIN: number;
+ export var EALREADY: number;
+ export var EBADF: number;
+ export var EBADMSG: number;
+ export var EBUSY: number;
+ export var ECANCELED: number;
+ export var ECHILD: number;
+ export var ECONNABORTED: number;
+ export var ECONNREFUSED: number;
+ export var ECONNRESET: number;
+ export var EDEADLK: number;
+ export var EDESTADDRREQ: number;
+ export var EDOM: number;
+ export var EEXIST: number;
+ export var EFAULT: number;
+ export var EFBIG: number;
+ export var EHOSTUNREACH: number;
+ export var EIDRM: number;
+ export var EILSEQ: number;
+ export var EINPROGRESS: number;
+ export var EINTR: number;
+ export var EINVAL: number;
+ export var EIO: number;
+ export var EISCONN: number;
+ export var EISDIR: number;
+ export var ELOOP: number;
+ export var EMFILE: number;
+ export var EMLINK: number;
+ export var EMSGSIZE: number;
+ export var ENAMETOOLONG: number;
+ export var ENETDOWN: number;
+ export var ENETRESET: number;
+ export var ENETUNREACH: number;
+ export var ENFILE: number;
+ export var ENOBUFS: number;
+ export var ENODATA: number;
+ export var ENODEV: number;
+ export var ENOENT: number;
+ export var ENOEXEC: number;
+ export var ENOLCK: number;
+ export var ENOLINK: number;
+ export var ENOMEM: number;
+ export var ENOMSG: number;
+ export var ENOPROTOOPT: number;
+ export var ENOSPC: number;
+ export var ENOSR: number;
+ export var ENOSTR: number;
+ export var ENOSYS: number;
+ export var ENOTCONN: number;
+ export var ENOTDIR: number;
+ export var ENOTEMPTY: number;
+ export var ENOTSOCK: number;
+ export var ENOTSUP: number;
+ export var ENOTTY: number;
+ export var ENXIO: number;
+ export var EOPNOTSUPP: number;
+ export var EOVERFLOW: number;
+ export var EPERM: number;
+ export var EPIPE: number;
+ export var EPROTO: number;
+ export var EPROTONOSUPPORT: number;
+ export var EPROTOTYPE: number;
+ export var ERANGE: number;
+ export var EROFS: number;
+ export var ESPIPE: number;
+ export var ESRCH: number;
+ export var ETIME: number;
+ export var ETIMEDOUT: number;
+ export var ETXTBSY: number;
+ export var EWOULDBLOCK: number;
+ export var EXDEV: number;
+ export var WSAEINTR: number;
+ export var WSAEBADF: number;
+ export var WSAEACCES: number;
+ export var WSAEFAULT: number;
+ export var WSAEINVAL: number;
+ export var WSAEMFILE: number;
+ export var WSAEWOULDBLOCK: number;
+ export var WSAEINPROGRESS: number;
+ export var WSAEALREADY: number;
+ export var WSAENOTSOCK: number;
+ export var WSAEDESTADDRREQ: number;
+ export var WSAEMSGSIZE: number;
+ export var WSAEPROTOTYPE: number;
+ export var WSAENOPROTOOPT: number;
+ export var WSAEPROTONOSUPPORT: number;
+ export var WSAESOCKTNOSUPPORT: number;
+ export var WSAEOPNOTSUPP: number;
+ export var WSAEPFNOSUPPORT: number;
+ export var WSAEAFNOSUPPORT: number;
+ export var WSAEADDRINUSE: number;
+ export var WSAEADDRNOTAVAIL: number;
+ export var WSAENETDOWN: number;
+ export var WSAENETUNREACH: number;
+ export var WSAENETRESET: number;
+ export var WSAECONNABORTED: number;
+ export var WSAECONNRESET: number;
+ export var WSAENOBUFS: number;
+ export var WSAEISCONN: number;
+ export var WSAENOTCONN: number;
+ export var WSAESHUTDOWN: number;
+ export var WSAETOOMANYREFS: number;
+ export var WSAETIMEDOUT: number;
+ export var WSAECONNREFUSED: number;
+ export var WSAELOOP: number;
+ export var WSAENAMETOOLONG: number;
+ export var WSAEHOSTDOWN: number;
+ export var WSAEHOSTUNREACH: number;
+ export var WSAENOTEMPTY: number;
+ export var WSAEPROCLIM: number;
+ export var WSAEUSERS: number;
+ export var WSAEDQUOT: number;
+ export var WSAESTALE: number;
+ export var WSAEREMOTE: number;
+ export var WSASYSNOTREADY: number;
+ export var WSAVERNOTSUPPORTED: number;
+ export var WSANOTINITIALISED: number;
+ export var WSAEDISCON: number;
+ export var WSAENOMORE: number;
+ export var WSAECANCELLED: number;
+ export var WSAEINVALIDPROCTABLE: number;
+ export var WSAEINVALIDPROVIDER: number;
+ export var WSAEPROVIDERFAILEDINIT: number;
+ export var WSASYSCALLFAILURE: number;
+ export var WSASERVICE_NOT_FOUND: number;
+ export var WSATYPE_NOT_FOUND: number;
+ export var WSA_E_NO_MORE: number;
+ export var WSA_E_CANCELLED: number;
+ export var WSAEREFUSED: number;
+ export var SIGHUP: number;
+ export var SIGINT: number;
+ export var SIGILL: number;
+ export var SIGABRT: number;
+ export var SIGFPE: number;
+ export var SIGKILL: number;
+ export var SIGSEGV: number;
+ export var SIGTERM: number;
+ export var SIGBREAK: number;
+ export var SIGWINCH: number;
+ export var SSL_OP_ALL: number;
+ export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
+ export var SSL_OP_CIPHER_SERVER_PREFERENCE: number;
+ export var SSL_OP_CISCO_ANYCONNECT: number;
+ export var SSL_OP_COOKIE_EXCHANGE: number;
+ export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
+ export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
+ export var SSL_OP_EPHEMERAL_RSA: number;
+ export var SSL_OP_LEGACY_SERVER_CONNECT: number;
+ export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
+ export var SSL_OP_MICROSOFT_SESS_ID_BUG: number;
+ export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
+ export var SSL_OP_NETSCAPE_CA_DN_BUG: number;
+ export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
+ export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
+ export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
+ export var SSL_OP_NO_COMPRESSION: number;
+ export var SSL_OP_NO_QUERY_MTU: number;
+ export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
+ export var SSL_OP_NO_SSLv2: number;
+ export var SSL_OP_NO_SSLv3: number;
+ export var SSL_OP_NO_TICKET: number;
+ export var SSL_OP_NO_TLSv1: number;
+ export var SSL_OP_NO_TLSv1_1: number;
+ export var SSL_OP_NO_TLSv1_2: number;
+ export var SSL_OP_PKCS1_CHECK_1: number;
+ export var SSL_OP_PKCS1_CHECK_2: number;
+ export var SSL_OP_SINGLE_DH_USE: number;
+ export var SSL_OP_SINGLE_ECDH_USE: number;
+ export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
+ export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
+ export var SSL_OP_TLS_BLOCK_PADDING_BUG: number;
+ export var SSL_OP_TLS_D5_BUG: number;
+ export var SSL_OP_TLS_ROLLBACK_BUG: number;
+ export var ENGINE_METHOD_DSA: number;
+ export var ENGINE_METHOD_DH: number;
+ export var ENGINE_METHOD_RAND: number;
+ export var ENGINE_METHOD_ECDH: number;
+ export var ENGINE_METHOD_ECDSA: number;
+ export var ENGINE_METHOD_CIPHERS: number;
+ export var ENGINE_METHOD_DIGESTS: number;
+ export var ENGINE_METHOD_STORE: number;
+ export var ENGINE_METHOD_PKEY_METHS: number;
+ export var ENGINE_METHOD_PKEY_ASN1_METHS: number;
+ export var ENGINE_METHOD_ALL: number;
+ export var ENGINE_METHOD_NONE: number;
+ export var DH_CHECK_P_NOT_SAFE_PRIME: number;
+ export var DH_CHECK_P_NOT_PRIME: number;
+ export var DH_UNABLE_TO_CHECK_GENERATOR: number;
+ export var DH_NOT_SUITABLE_GENERATOR: number;
+ export var NPN_ENABLED: number;
+ export var RSA_PKCS1_PADDING: number;
+ export var RSA_SSLV23_PADDING: number;
+ export var RSA_NO_PADDING: number;
+ export var RSA_PKCS1_OAEP_PADDING: number;
+ export var RSA_X931_PADDING: number;
+ export var RSA_PKCS1_PSS_PADDING: number;
+ export var POINT_CONVERSION_COMPRESSED: number;
+ export var POINT_CONVERSION_UNCOMPRESSED: number;
+ export var POINT_CONVERSION_HYBRID: number;
+ export var O_RDONLY: number;
+ export var O_WRONLY: number;
+ export var O_RDWR: number;
+ export var S_IFMT: number;
+ export var S_IFREG: number;
+ export var S_IFDIR: number;
+ export var S_IFCHR: number;
+ export var S_IFBLK: number;
+ export var S_IFIFO: number;
+ export var S_IFSOCK: number;
+ export var S_IRWXU: number;
+ export var S_IRUSR: number;
+ export var S_IWUSR: number;
+ export var S_IXUSR: number;
+ export var S_IRWXG: number;
+ export var S_IRGRP: number;
+ export var S_IWGRP: number;
+ export var S_IXGRP: number;
+ export var S_IRWXO: number;
+ export var S_IROTH: number;
+ export var S_IWOTH: number;
+ export var S_IXOTH: number;
+ export var S_IFLNK: number;
+ export var O_CREAT: number;
+ export var O_EXCL: number;
+ export var O_NOCTTY: number;
+ export var O_DIRECTORY: number;
+ export var O_NOATIME: number;
+ export var O_NOFOLLOW: number;
+ export var O_SYNC: number;
+ export var O_SYMLINK: number;
+ export var O_DIRECT: number;
+ export var O_NONBLOCK: number;
+ export var O_TRUNC: number;
+ export var O_APPEND: number;
+ export var F_OK: number;
+ export var R_OK: number;
+ export var W_OK: number;
+ export var X_OK: number;
+ export var UV_UDP_REUSEADDR: number;
+ export var SIGQUIT: number;
+ export var SIGTRAP: number;
+ export var SIGIOT: number;
+ export var SIGBUS: number;
+ export var SIGUSR1: number;
+ export var SIGUSR2: number;
+ export var SIGPIPE: number;
+ export var SIGALRM: number;
+ export var SIGCHLD: number;
+ export var SIGSTKFLT: number;
+ export var SIGCONT: number;
+ export var SIGSTOP: number;
+ export var SIGTSTP: number;
+ export var SIGTTIN: number;
+ export var SIGTTOU: number;
+ export var SIGURG: number;
+ export var SIGXCPU: number;
+ export var SIGXFSZ: number;
+ export var SIGVTALRM: number;
+ export var SIGPROF: number;
+ export var SIGIO: number;
+ export var SIGPOLL: number;
+ export var SIGPWR: number;
+ export var SIGSYS: number;
+ export var SIGUNUSED: number;
+ export var defaultCoreCipherList: string;
+ export var defaultCipherList: string;
+ export var ENGINE_METHOD_RSA: number;
+ export var ALPN_ENABLED: number;
+}
+
+declare module "process" {
+ export = process;
+}
+
+declare module "v8" {
+ interface HeapSpaceInfo {
+ space_name: string;
+ space_size: number;
+ space_used_size: number;
+ space_available_size: number;
+ physical_space_size: number;
+ }
+
+ const enum DoesZapCodeSpaceFlag {
+ Disabled = 0,
+ Enabled = 1
+ }
+
+ interface HeapInfo {
+ total_heap_size: number;
+ total_heap_size_executable: number;
+ total_physical_size: number;
+ total_available_size: number;
+ used_heap_size: number;
+ heap_size_limit: number;
+ malloced_memory: number;
+ peak_malloced_memory: number;
+ does_zap_garbage: DoesZapCodeSpaceFlag;
+ }
+
+ export function getHeapStatistics(): HeapInfo;
+ export function getHeapSpaceStatistics(): HeapSpaceInfo[];
+ export function setFlagsFromString(flags: string): void;
+}
+
+declare module "timers" {
+ export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
+ export function clearTimeout(timeoutId: NodeJS.Timer): void;
+ export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
+ export function clearInterval(intervalId: NodeJS.Timer): void;
+ export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
+ export function clearImmediate(immediateId: any): void;
+}
+
+declare module "console" {
+ export = console;
+}
+
+/**
+ * _debugger module is not documented.
+ * Source code is at https://github.com/nodejs/node/blob/master/lib/_debugger.js
+ */
+declare module "_debugger" {
+ export interface Packet {
+ raw: string;
+ headers: string[];
+ body: Message;
+ }
+
+ export interface Message {
+ seq: number;
+ type: string;
+ }
+
+ export interface RequestInfo {
+ command: string;
+ arguments: any;
+ }
+
+ export interface Request extends Message, RequestInfo {
+ }
+
+ export interface Event extends Message {
+ event: string;
+ body?: any;
+ }
+
+ export interface Response extends Message {
+ request_seq: number;
+ success: boolean;
+ /** Contains error message if success === false. */
+ message?: string;
+ /** Contains message body if success === true. */
+ body?: any;
+ }
+
+ export interface BreakpointMessageBody {
+ type: string;
+ target: number;
+ line: number;
+ }
+
+ export class Protocol {
+ res: Packet;
+ state: string;
+ execute(data: string): void;
+ serialize(rq: Request): string;
+ onResponse: (pkt: Packet) => void;
+ }
+
+ export var NO_FRAME: number;
+ export var port: number;
+
+ export interface ScriptDesc {
+ name: string;
+ id: number;
+ isNative?: boolean;
+ handle?: number;
+ type: string;
+ lineOffset?: number;
+ columnOffset?: number;
+ lineCount?: number;
+ }
+
+ export interface Breakpoint {
+ id: number;
+ scriptId: number;
+ script: ScriptDesc;
+ line: number;
+ condition?: string;
+ scriptReq?: string;
+ }
+
+ export interface RequestHandler {
+ (err: boolean, body: Message, res: Packet): void;
+ request_seq?: number;
+ }
+
+ export interface ResponseBodyHandler {
+ (err: boolean, body?: any): void;
+ request_seq?: number;
+ }
+
+ export interface ExceptionInfo {
+ text: string;
+ }
+
+ export interface BreakResponse {
+ script?: ScriptDesc;
+ exception?: ExceptionInfo;
+ sourceLine: number;
+ sourceLineText: string;
+ sourceColumn: number;
+ }
+
+ export function SourceInfo(body: BreakResponse): string;
+
+ export interface ClientInstance extends NodeJS.EventEmitter {
+ protocol: Protocol;
+ scripts: ScriptDesc[];
+ handles: ScriptDesc[];
+ breakpoints: Breakpoint[];
+ currentSourceLine: number;
+ currentSourceColumn: number;
+ currentSourceLineText: string;
+ currentFrame: number;
+ currentScript: string;
+
+ connect(port: number, host: string): void;
+ req(req: any, cb: RequestHandler): void;
+ reqFrameEval(code: string, frame: number, cb: RequestHandler): void;
+ mirrorObject(obj: any, depth: number, cb: ResponseBodyHandler): void;
+ setBreakpoint(rq: BreakpointMessageBody, cb: RequestHandler): void;
+ clearBreakpoint(rq: Request, cb: RequestHandler): void;
+ listbreakpoints(cb: RequestHandler): void;
+ reqSource(from: number, to: number, cb: RequestHandler): void;
+ reqScripts(cb: any): void;
+ reqContinue(cb: RequestHandler): void;
+ }
+
+ export var Client : {
+ new (): ClientInstance
+ }
+}
diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json
new file mode 100644
index 0000000..a9b386c
--- /dev/null
+++ b/node_modules/@types/node/package.json
@@ -0,0 +1,89 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "@types/node@^6.0.48",
+ "scope": "@types",
+ "escapedName": "@types%2fnode",
+ "name": "@types/node",
+ "rawSpec": "^6.0.48",
+ "spec": ">=6.0.48 <7.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/wkx"
+ ]
+ ],
+ "_from": "@types/node@>=6.0.48 <7.0.0",
+ "_id": "@types/node@6.0.85",
+ "_inCache": true,
+ "_location": "/@types/node",
+ "_npmOperationalInternal": {
+ "host": "s3://npm-registry-packages",
+ "tmp": "tmp/node-6.0.85.tgz_1500750477933_0.8869799603708088"
+ },
+ "_npmUser": {
+ "name": "types",
+ "email": "ts-npm-types@microsoft.com"
+ },
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "@types/node@^6.0.48",
+ "scope": "@types",
+ "escapedName": "@types%2fnode",
+ "name": "@types/node",
+ "rawSpec": "^6.0.48",
+ "spec": ">=6.0.48 <7.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/wkx"
+ ],
+ "_resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.85.tgz",
+ "_shasum": "ec02bfe54a61044f2be44f13b389c6a0e8ee05ae",
+ "_shrinkwrap": null,
+ "_spec": "@types/node@^6.0.48",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/wkx",
+ "contributors": [
+ {
+ "name": "Microsoft TypeScript",
+ "url": "http://typescriptlang.org"
+ },
+ {
+ "name": "DefinitelyTyped",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped"
+ },
+ {
+ "name": "Wilco Bakker",
+ "url": "https://github.com/WilcoBakker"
+ }
+ ],
+ "dependencies": {},
+ "description": "TypeScript definitions for Node.js",
+ "devDependencies": {},
+ "directories": {},
+ "dist": {
+ "integrity": "sha512-6qLZpfQFO/g5Ns2e7RsW6brk0Q6Xzwiw7kVVU/XiQNOiJXSojhX76GP457PBYIsNMH2WfcGgcnZB4awFDHrwpA==",
+ "shasum": "ec02bfe54a61044f2be44f13b389c6a0e8ee05ae",
+ "tarball": "https://registry.npmjs.org/@types/node/-/node-6.0.85.tgz"
+ },
+ "license": "MIT",
+ "main": "",
+ "maintainers": [
+ {
+ "name": "types",
+ "email": "ts-npm-types@microsoft.com"
+ }
+ ],
+ "name": "@types/node",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
+ },
+ "scripts": {},
+ "typeScriptVersion": "2.0",
+ "typesPublisherContentHash": "c477b6628bce63c106b28fd29d8a648ea8e0362d62e0a101545e805eba92f3c2",
+ "version": "6.0.85"
+}
diff --git a/node_modules/abbrev/LICENSE b/node_modules/abbrev/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/node_modules/abbrev/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/abbrev/README.md b/node_modules/abbrev/README.md
new file mode 100644
index 0000000..99746fe
--- /dev/null
+++ b/node_modules/abbrev/README.md
@@ -0,0 +1,23 @@
+# abbrev-js
+
+Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
+
+Usage:
+
+ var abbrev = require("abbrev");
+ abbrev("foo", "fool", "folding", "flop");
+
+ // returns:
+ { fl: 'flop'
+ , flo: 'flop'
+ , flop: 'flop'
+ , fol: 'folding'
+ , fold: 'folding'
+ , foldi: 'folding'
+ , foldin: 'folding'
+ , folding: 'folding'
+ , foo: 'foo'
+ , fool: 'fool'
+ }
+
+This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
diff --git a/node_modules/abbrev/abbrev.js b/node_modules/abbrev/abbrev.js
new file mode 100644
index 0000000..7b1dc5d
--- /dev/null
+++ b/node_modules/abbrev/abbrev.js
@@ -0,0 +1,61 @@
+module.exports = exports = abbrev.abbrev = abbrev
+
+abbrev.monkeyPatch = monkeyPatch
+
+function monkeyPatch () {
+ Object.defineProperty(Array.prototype, 'abbrev', {
+ value: function () { return abbrev(this) },
+ enumerable: false, configurable: true, writable: true
+ })
+
+ Object.defineProperty(Object.prototype, 'abbrev', {
+ value: function () { return abbrev(Object.keys(this)) },
+ enumerable: false, configurable: true, writable: true
+ })
+}
+
+function abbrev (list) {
+ if (arguments.length !== 1 || !Array.isArray(list)) {
+ list = Array.prototype.slice.call(arguments, 0)
+ }
+ for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
+ args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
+ }
+
+ // sort them lexicographically, so that they're next to their nearest kin
+ args = args.sort(lexSort)
+
+ // walk through each, seeing how much it has in common with the next and previous
+ var abbrevs = {}
+ , prev = ""
+ for (var i = 0, l = args.length ; i < l ; i ++) {
+ var current = args[i]
+ , next = args[i + 1] || ""
+ , nextMatches = true
+ , prevMatches = true
+ if (current === next) continue
+ for (var j = 0, cl = current.length ; j < cl ; j ++) {
+ var curChar = current.charAt(j)
+ nextMatches = nextMatches && curChar === next.charAt(j)
+ prevMatches = prevMatches && curChar === prev.charAt(j)
+ if (!nextMatches && !prevMatches) {
+ j ++
+ break
+ }
+ }
+ prev = current
+ if (j === cl) {
+ abbrevs[current] = current
+ continue
+ }
+ for (var a = current.substr(0, j) ; j <= cl ; j ++) {
+ abbrevs[a] = current
+ a += current.charAt(j)
+ }
+ }
+ return abbrevs
+}
+
+function lexSort (a, b) {
+ return a === b ? 0 : a > b ? 1 : -1
+}
diff --git a/node_modules/abbrev/package.json b/node_modules/abbrev/package.json
new file mode 100644
index 0000000..a065ca3
--- /dev/null
+++ b/node_modules/abbrev/package.json
@@ -0,0 +1,92 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "abbrev@1",
+ "scope": null,
+ "escapedName": "abbrev",
+ "name": "abbrev",
+ "rawSpec": "1",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/nopt"
+ ]
+ ],
+ "_from": "abbrev@>=1.0.0 <2.0.0",
+ "_id": "abbrev@1.1.0",
+ "_inCache": true,
+ "_location": "/abbrev",
+ "_nodeVersion": "8.0.0-pre",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/abbrev-1.1.0.tgz_1487054000015_0.9229173036292195"
+ },
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "_npmVersion": "4.3.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "abbrev@1",
+ "scope": null,
+ "escapedName": "abbrev",
+ "name": "abbrev",
+ "rawSpec": "1",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/nopt"
+ ],
+ "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz",
+ "_shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f",
+ "_shrinkwrap": null,
+ "_spec": "abbrev@1",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/nopt",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me"
+ },
+ "bugs": {
+ "url": "https://github.com/isaacs/abbrev-js/issues"
+ },
+ "dependencies": {},
+ "description": "Like ruby's abbrev module, but in js",
+ "devDependencies": {
+ "tap": "^10.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f",
+ "tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz"
+ },
+ "files": [
+ "abbrev.js"
+ ],
+ "gitHead": "7136d4d95449dc44115d4f78b80ec907724f64e0",
+ "homepage": "https://github.com/isaacs/abbrev-js#readme",
+ "license": "ISC",
+ "main": "abbrev.js",
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "name": "abbrev",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
+ },
+ "scripts": {
+ "postpublish": "git push origin --all; git push origin --tags",
+ "postversion": "npm publish",
+ "preversion": "npm test",
+ "test": "tap test.js --100"
+ },
+ "version": "1.1.0"
+}
diff --git a/node_modules/accepts/HISTORY.md b/node_modules/accepts/HISTORY.md
new file mode 100644
index 0000000..0477ed7
--- /dev/null
+++ b/node_modules/accepts/HISTORY.md
@@ -0,0 +1,212 @@
+1.3.3 / 2016-05-02
+==================
+
+ * deps: mime-types@~2.1.11
+ - deps: mime-db@~1.23.0
+ * deps: negotiator@0.6.1
+ - perf: improve `Accept` parsing speed
+ - perf: improve `Accept-Charset` parsing speed
+ - perf: improve `Accept-Encoding` parsing speed
+ - perf: improve `Accept-Language` parsing speed
+
+1.3.2 / 2016-03-08
+==================
+
+ * deps: mime-types@~2.1.10
+ - Fix extension of `application/dash+xml`
+ - Update primary extension for `audio/mp4`
+ - deps: mime-db@~1.22.0
+
+1.3.1 / 2016-01-19
+==================
+
+ * deps: mime-types@~2.1.9
+ - deps: mime-db@~1.21.0
+
+1.3.0 / 2015-09-29
+==================
+
+ * deps: mime-types@~2.1.7
+ - deps: mime-db@~1.19.0
+ * deps: negotiator@0.6.0
+ - Fix including type extensions in parameters in `Accept` parsing
+ - Fix parsing `Accept` parameters with quoted equals
+ - Fix parsing `Accept` parameters with quoted semicolons
+ - Lazy-load modules from main entry point
+ - perf: delay type concatenation until needed
+ - perf: enable strict mode
+ - perf: hoist regular expressions
+ - perf: remove closures getting spec properties
+ - perf: remove a closure from media type parsing
+ - perf: remove property delete from media type parsing
+
+1.2.13 / 2015-09-06
+===================
+
+ * deps: mime-types@~2.1.6
+ - deps: mime-db@~1.18.0
+
+1.2.12 / 2015-07-30
+===================
+
+ * deps: mime-types@~2.1.4
+ - deps: mime-db@~1.16.0
+
+1.2.11 / 2015-07-16
+===================
+
+ * deps: mime-types@~2.1.3
+ - deps: mime-db@~1.15.0
+
+1.2.10 / 2015-07-01
+===================
+
+ * deps: mime-types@~2.1.2
+ - deps: mime-db@~1.14.0
+
+1.2.9 / 2015-06-08
+==================
+
+ * deps: mime-types@~2.1.1
+ - perf: fix deopt during mapping
+
+1.2.8 / 2015-06-07
+==================
+
+ * deps: mime-types@~2.1.0
+ - deps: mime-db@~1.13.0
+ * perf: avoid argument reassignment & argument slice
+ * perf: avoid negotiator recursive construction
+ * perf: enable strict mode
+ * perf: remove unnecessary bitwise operator
+
+1.2.7 / 2015-05-10
+==================
+
+ * deps: negotiator@0.5.3
+ - Fix media type parameter matching to be case-insensitive
+
+1.2.6 / 2015-05-07
+==================
+
+ * deps: mime-types@~2.0.11
+ - deps: mime-db@~1.9.1
+ * deps: negotiator@0.5.2
+ - Fix comparing media types with quoted values
+ - Fix splitting media types with quoted commas
+
+1.2.5 / 2015-03-13
+==================
+
+ * deps: mime-types@~2.0.10
+ - deps: mime-db@~1.8.0
+
+1.2.4 / 2015-02-14
+==================
+
+ * Support Node.js 0.6
+ * deps: mime-types@~2.0.9
+ - deps: mime-db@~1.7.0
+ * deps: negotiator@0.5.1
+ - Fix preference sorting to be stable for long acceptable lists
+
+1.2.3 / 2015-01-31
+==================
+
+ * deps: mime-types@~2.0.8
+ - deps: mime-db@~1.6.0
+
+1.2.2 / 2014-12-30
+==================
+
+ * deps: mime-types@~2.0.7
+ - deps: mime-db@~1.5.0
+
+1.2.1 / 2014-12-30
+==================
+
+ * deps: mime-types@~2.0.5
+ - deps: mime-db@~1.3.1
+
+1.2.0 / 2014-12-19
+==================
+
+ * deps: negotiator@0.5.0
+ - Fix list return order when large accepted list
+ - Fix missing identity encoding when q=0 exists
+ - Remove dynamic building of Negotiator class
+
+1.1.4 / 2014-12-10
+==================
+
+ * deps: mime-types@~2.0.4
+ - deps: mime-db@~1.3.0
+
+1.1.3 / 2014-11-09
+==================
+
+ * deps: mime-types@~2.0.3
+ - deps: mime-db@~1.2.0
+
+1.1.2 / 2014-10-14
+==================
+
+ * deps: negotiator@0.4.9
+ - Fix error when media type has invalid parameter
+
+1.1.1 / 2014-09-28
+==================
+
+ * deps: mime-types@~2.0.2
+ - deps: mime-db@~1.1.0
+ * deps: negotiator@0.4.8
+ - Fix all negotiations to be case-insensitive
+ - Stable sort preferences of same quality according to client order
+
+1.1.0 / 2014-09-02
+==================
+
+ * update `mime-types`
+
+1.0.7 / 2014-07-04
+==================
+
+ * Fix wrong type returned from `type` when match after unknown extension
+
+1.0.6 / 2014-06-24
+==================
+
+ * deps: negotiator@0.4.7
+
+1.0.5 / 2014-06-20
+==================
+
+ * fix crash when unknown extension given
+
+1.0.4 / 2014-06-19
+==================
+
+ * use `mime-types`
+
+1.0.3 / 2014-06-11
+==================
+
+ * deps: negotiator@0.4.6
+ - Order by specificity when quality is the same
+
+1.0.2 / 2014-05-29
+==================
+
+ * Fix interpretation when header not in request
+ * deps: pin negotiator@0.4.5
+
+1.0.1 / 2014-01-18
+==================
+
+ * Identity encoding isn't always acceptable
+ * deps: negotiator@~0.4.0
+
+1.0.0 / 2013-12-27
+==================
+
+ * Genesis
diff --git a/node_modules/accepts/LICENSE b/node_modules/accepts/LICENSE
new file mode 100644
index 0000000..0616607
--- /dev/null
+++ b/node_modules/accepts/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/accepts/README.md b/node_modules/accepts/README.md
new file mode 100644
index 0000000..ae36676
--- /dev/null
+++ b/node_modules/accepts/README.md
@@ -0,0 +1,135 @@
+# accepts
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
+
+In addition to negotiator, it allows:
+
+- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`.
+- Allows type shorthands such as `json`.
+- Returns `false` when no types match
+- Treats non-existent headers as `*`
+
+## Installation
+
+```sh
+npm install accepts
+```
+
+## API
+
+```js
+var accepts = require('accepts')
+```
+
+### accepts(req)
+
+Create a new `Accepts` object for the given `req`.
+
+#### .charset(charsets)
+
+Return the first accepted charset. If nothing in `charsets` is accepted,
+then `false` is returned.
+
+#### .charsets()
+
+Return the charsets that the request accepts, in the order of the client's
+preference (most preferred first).
+
+#### .encoding(encodings)
+
+Return the first accepted encoding. If nothing in `encodings` is accepted,
+then `false` is returned.
+
+#### .encodings()
+
+Return the encodings that the request accepts, in the order of the client's
+preference (most preferred first).
+
+#### .language(languages)
+
+Return the first accepted language. If nothing in `languages` is accepted,
+then `false` is returned.
+
+#### .languages()
+
+Return the languages that the request accepts, in the order of the client's
+preference (most preferred first).
+
+#### .type(types)
+
+Return the first accepted type (and it is returned as the same text as what
+appears in the `types` array). If nothing in `types` is accepted, then `false`
+is returned.
+
+The `types` array can contain full MIME types or file extensions. Any value
+that is not a full MIME types is passed to `require('mime-types').lookup`.
+
+#### .types()
+
+Return the types that the request accepts, in the order of the client's
+preference (most preferred first).
+
+## Examples
+
+### Simple type negotiation
+
+This simple example shows how to use `accepts` to return a different typed
+respond body based on what the client wants to accept. The server lists it's
+preferences in order and will get back the best match between the client and
+server.
+
+```js
+var accepts = require('accepts')
+var http = require('http')
+
+function app(req, res) {
+ var accept = accepts(req)
+
+ // the order of this list is significant; should be server preferred order
+ switch(accept.type(['json', 'html'])) {
+ case 'json':
+ res.setHeader('Content-Type', 'application/json')
+ res.write('{"hello":"world!"}')
+ break
+ case 'html':
+ res.setHeader('Content-Type', 'text/html')
+ res.write('hello, world!')
+ break
+ default:
+ // the fallback is text/plain, so no need to specify it above
+ res.setHeader('Content-Type', 'text/plain')
+ res.write('hello, world!')
+ break
+ }
+
+ res.end()
+}
+
+http.createServer(app).listen(3000)
+```
+
+You can test this out with the cURL program:
+```sh
+curl -I -H'Accept: text/html' http://localhost:3000/
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/accepts.svg
+[npm-url]: https://npmjs.org/package/accepts
+[node-version-image]: https://img.shields.io/node/v/accepts.svg
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg
+[travis-url]: https://travis-ci.org/jshttp/accepts
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/accepts
+[downloads-image]: https://img.shields.io/npm/dm/accepts.svg
+[downloads-url]: https://npmjs.org/package/accepts
diff --git a/node_modules/accepts/index.js b/node_modules/accepts/index.js
new file mode 100644
index 0000000..e80192a
--- /dev/null
+++ b/node_modules/accepts/index.js
@@ -0,0 +1,231 @@
+/*!
+ * accepts
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var Negotiator = require('negotiator')
+var mime = require('mime-types')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = Accepts
+
+/**
+ * Create a new Accepts object for the given req.
+ *
+ * @param {object} req
+ * @public
+ */
+
+function Accepts(req) {
+ if (!(this instanceof Accepts))
+ return new Accepts(req)
+
+ this.headers = req.headers
+ this.negotiator = new Negotiator(req)
+}
+
+/**
+ * Check if the given `type(s)` is acceptable, returning
+ * the best match when true, otherwise `undefined`, in which
+ * case you should respond with 406 "Not Acceptable".
+ *
+ * The `type` value may be a single mime type string
+ * such as "application/json", the extension name
+ * such as "json" or an array `["json", "html", "text/plain"]`. When a list
+ * or array is given the _best_ match, if any is returned.
+ *
+ * Examples:
+ *
+ * // Accept: text/html
+ * this.types('html');
+ * // => "html"
+ *
+ * // Accept: text/*, application/json
+ * this.types('html');
+ * // => "html"
+ * this.types('text/html');
+ * // => "text/html"
+ * this.types('json', 'text');
+ * // => "json"
+ * this.types('application/json');
+ * // => "application/json"
+ *
+ * // Accept: text/*, application/json
+ * this.types('image/png');
+ * this.types('png');
+ * // => undefined
+ *
+ * // Accept: text/*;q=.5, application/json
+ * this.types(['html', 'json']);
+ * this.types('html', 'json');
+ * // => "json"
+ *
+ * @param {String|Array} types...
+ * @return {String|Array|Boolean}
+ * @public
+ */
+
+Accepts.prototype.type =
+Accepts.prototype.types = function (types_) {
+ var types = types_
+
+ // support flattened arguments
+ if (types && !Array.isArray(types)) {
+ types = new Array(arguments.length)
+ for (var i = 0; i < types.length; i++) {
+ types[i] = arguments[i]
+ }
+ }
+
+ // no types, return all requested types
+ if (!types || types.length === 0) {
+ return this.negotiator.mediaTypes()
+ }
+
+ if (!this.headers.accept) return types[0];
+ var mimes = types.map(extToMime);
+ var accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
+ var first = accepts[0];
+ if (!first) return false;
+ return types[mimes.indexOf(first)];
+}
+
+/**
+ * Return accepted encodings or best fit based on `encodings`.
+ *
+ * Given `Accept-Encoding: gzip, deflate`
+ * an array sorted by quality is returned:
+ *
+ * ['gzip', 'deflate']
+ *
+ * @param {String|Array} encodings...
+ * @return {String|Array}
+ * @public
+ */
+
+Accepts.prototype.encoding =
+Accepts.prototype.encodings = function (encodings_) {
+ var encodings = encodings_
+
+ // support flattened arguments
+ if (encodings && !Array.isArray(encodings)) {
+ encodings = new Array(arguments.length)
+ for (var i = 0; i < encodings.length; i++) {
+ encodings[i] = arguments[i]
+ }
+ }
+
+ // no encodings, return all requested encodings
+ if (!encodings || encodings.length === 0) {
+ return this.negotiator.encodings()
+ }
+
+ return this.negotiator.encodings(encodings)[0] || false
+}
+
+/**
+ * Return accepted charsets or best fit based on `charsets`.
+ *
+ * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
+ * an array sorted by quality is returned:
+ *
+ * ['utf-8', 'utf-7', 'iso-8859-1']
+ *
+ * @param {String|Array} charsets...
+ * @return {String|Array}
+ * @public
+ */
+
+Accepts.prototype.charset =
+Accepts.prototype.charsets = function (charsets_) {
+ var charsets = charsets_
+
+ // support flattened arguments
+ if (charsets && !Array.isArray(charsets)) {
+ charsets = new Array(arguments.length)
+ for (var i = 0; i < charsets.length; i++) {
+ charsets[i] = arguments[i]
+ }
+ }
+
+ // no charsets, return all requested charsets
+ if (!charsets || charsets.length === 0) {
+ return this.negotiator.charsets()
+ }
+
+ return this.negotiator.charsets(charsets)[0] || false
+}
+
+/**
+ * Return accepted languages or best fit based on `langs`.
+ *
+ * Given `Accept-Language: en;q=0.8, es, pt`
+ * an array sorted by quality is returned:
+ *
+ * ['es', 'pt', 'en']
+ *
+ * @param {String|Array} langs...
+ * @return {Array|String}
+ * @public
+ */
+
+Accepts.prototype.lang =
+Accepts.prototype.langs =
+Accepts.prototype.language =
+Accepts.prototype.languages = function (languages_) {
+ var languages = languages_
+
+ // support flattened arguments
+ if (languages && !Array.isArray(languages)) {
+ languages = new Array(arguments.length)
+ for (var i = 0; i < languages.length; i++) {
+ languages[i] = arguments[i]
+ }
+ }
+
+ // no languages, return all requested languages
+ if (!languages || languages.length === 0) {
+ return this.negotiator.languages()
+ }
+
+ return this.negotiator.languages(languages)[0] || false
+}
+
+/**
+ * Convert extnames to mime.
+ *
+ * @param {String} type
+ * @return {String}
+ * @private
+ */
+
+function extToMime(type) {
+ return type.indexOf('/') === -1
+ ? mime.lookup(type)
+ : type
+}
+
+/**
+ * Check if mime is valid.
+ *
+ * @param {String} type
+ * @return {String}
+ * @private
+ */
+
+function validMime(type) {
+ return typeof type === 'string';
+}
diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json
new file mode 100644
index 0000000..0f12e1e
--- /dev/null
+++ b/node_modules/accepts/package.json
@@ -0,0 +1,112 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "accepts@~1.3.3",
+ "scope": null,
+ "escapedName": "accepts",
+ "name": "accepts",
+ "rawSpec": "~1.3.3",
+ "spec": ">=1.3.3 <1.4.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/express"
+ ]
+ ],
+ "_from": "accepts@>=1.3.3 <1.4.0",
+ "_id": "accepts@1.3.3",
+ "_inCache": true,
+ "_location": "/accepts",
+ "_nodeVersion": "4.4.3",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/accepts-1.3.3.tgz_1462251932032_0.7092335098423064"
+ },
+ "_npmUser": {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ },
+ "_npmVersion": "2.15.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "accepts@~1.3.3",
+ "scope": null,
+ "escapedName": "accepts",
+ "name": "accepts",
+ "rawSpec": "~1.3.3",
+ "spec": ">=1.3.3 <1.4.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/express"
+ ],
+ "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz",
+ "_shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca",
+ "_shrinkwrap": null,
+ "_spec": "accepts@~1.3.3",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/express",
+ "bugs": {
+ "url": "https://github.com/jshttp/accepts/issues"
+ },
+ "contributors": [
+ {
+ "name": "Douglas Christopher Wilson",
+ "email": "doug@somethingdoug.com"
+ },
+ {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com"
+ }
+ ],
+ "dependencies": {
+ "mime-types": "~2.1.11",
+ "negotiator": "0.6.1"
+ },
+ "description": "Higher-level content negotiation",
+ "devDependencies": {
+ "istanbul": "0.4.3",
+ "mocha": "~1.21.5"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca",
+ "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "files": [
+ "LICENSE",
+ "HISTORY.md",
+ "index.js"
+ ],
+ "gitHead": "3e925b1e65ed7da2798849683d49814680dfa426",
+ "homepage": "https://github.com/jshttp/accepts#readme",
+ "keywords": [
+ "content",
+ "negotiation",
+ "accept",
+ "accepts"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ }
+ ],
+ "name": "accepts",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jshttp/accepts.git"
+ },
+ "scripts": {
+ "test": "mocha --reporter spec --check-leaks --bail test/",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+ },
+ "version": "1.3.3"
+}
diff --git a/node_modules/align-text/LICENSE b/node_modules/align-text/LICENSE
new file mode 100644
index 0000000..65f90ac
--- /dev/null
+++ b/node_modules/align-text/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/align-text/README.md b/node_modules/align-text/README.md
new file mode 100644
index 0000000..476b97f
--- /dev/null
+++ b/node_modules/align-text/README.md
@@ -0,0 +1,236 @@
+# align-text [](http://badge.fury.io/js/align-text) [](https://travis-ci.org/jonschlinkert/align-text)
+
+> Align the text in a string.
+
+**Examples**
+
+Align text values in an array:
+
+```js
+align([1, 2, 3, 100]);
+//=> [' 1', ' 2', ' 3', '100']
+```
+
+Or [do stuff like this](./example.js):
+
+[](./example.js)
+
+Visit [the example](./example.js) to see how this works.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i align-text --save
+```
+
+## Usage
+
+```js
+var align = require('align-text');
+align(text, callback_function_or_integer);
+```
+
+**Params**
+
+* `text` can be a **string or array**. If a string is passed, a string will be returned. If an array is passed, an array will be returned.
+* `callback|integer`: if an integer, the text will be indented by that amount. If a function, it must return an integer representing the amount of leading indentation to use as `align` loops over each line.
+
+**Example**
+
+```js
+align(text, 4);
+```
+
+Would align:
+
+```
+abc
+abc
+abc
+```
+
+To:
+
+```
+ abc
+ abc
+ abc
+```
+
+## callback
+
+### params
+
+The callback is used to determine the indentation of each line and gets the following params:
+
+* `len` the length of the "current" line
+* `longest` the length of the longest line
+* `line` the current line (string) being aligned
+* `lines` the array of all lines
+
+### return
+
+The callback may return:
+
+* an integer that represents the number of spaces to use for padding,
+* or an object with the following properties:
+ - `indent`: **{Number}** the amount of indentation to use. Default is `0` when an object is returned.
+ - `character`: **{String}** the character to use for indentation. Default is `''` (empty string) when an object is returned.
+ - `prefix`: **{String}** leading characters to use at the beginning of each line. `''` (empty string) when an object is returned.
+
+**Integer example:**
+
+```js
+// calculate half the difference between the length
+// of the current line and the longest line
+function centerAlign(len, longest, line, lines) {
+ return Math.floor((longest - len) / 2);
+}
+```
+
+**Object example:**
+
+```js
+function centerAlign(len, longest, line, lines) {
+ return {
+ character: '\t',
+ indent: Math.floor((longest - len) / 2),
+ prefix: '~ ',
+ }
+}
+```
+
+## Usage examples
+
+### Center align
+
+Using the `centerAlign` function from above:
+
+```js
+align(text, centerAlign);
+```
+
+Would align this text:
+
+```js
+Lorem ipsum dolor sit amet
+consectetur adipiscin
+elit, sed do eiusmod tempor incididun
+ut labore et dolor
+magna aliqua. Ut enim ad mini
+veniam, quis
+```
+
+Resulting in this:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+**Customize**
+
+If you wanted to add more padding on the left, just pass the number in the callback.
+
+For example, to add 4 spaces before every line:
+
+```js
+function centerAlign(len, longest, line, lines) {
+ return 4 + Math.floor((longest - len) / 2);
+}
+```
+
+Would result in:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+ elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+### Bullets
+
+```js
+align(text, function (len, max, line, lines) {
+ return {prefix: ' - '};
+});
+```
+
+Would return:
+
+```
+- Lorem ipsum dolor sit amet,
+- consectetur adipiscing
+- elit, sed do eiusmod tempor incididunt
+- ut labore et dolore
+- magna aliqua. Ut enim ad minim
+- veniam, quis
+```
+
+### Different indent character
+
+```js
+align(text, function (len, max, line, lines) {
+ return {
+ indent: Math.floor((max - len) / 2),
+ character: '~',
+ };
+});
+```
+
+Would return
+
+```
+~~~~~Lorem ipsum dolor sit amet,
+~~~~~~~~consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+~~~~~~~~~ut labore et dolore
+~~~~magna aliqua. Ut enim ad minim
+~~~~~~~~~~~~~veniam, quis
+```
+
+## Related projects
+
+* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
+* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character
+* [longest](https://github.com/jonschlinkert/longest): Get the longest item in an array.
+* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/align-text/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._
diff --git a/node_modules/align-text/index.js b/node_modules/align-text/index.js
new file mode 100644
index 0000000..75902a3
--- /dev/null
+++ b/node_modules/align-text/index.js
@@ -0,0 +1,52 @@
+/*!
+ * align-text
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var typeOf = require('kind-of');
+var repeat = require('repeat-string');
+var longest = require('longest');
+
+module.exports = function alignText(val, fn) {
+ var lines, type = typeOf(val);
+
+ if (type === 'array') {
+ lines = val;
+ } else if (type === 'string') {
+ lines = val.split(/(?:\r\n|\n)/);
+ } else {
+ throw new TypeError('align-text expects a string or array.');
+ }
+
+ var fnType = typeOf(fn);
+ var len = lines.length;
+ var max = longest(lines);
+ var res = [], i = 0;
+
+ while (len--) {
+ var line = String(lines[i++]);
+ var diff;
+
+ if (fnType === 'function') {
+ diff = fn(line.length, max.length, line, lines, i);
+ } else if (fnType === 'number') {
+ diff = fn;
+ } else {
+ diff = max.length - line.length;
+ }
+
+ if (typeOf(diff) === 'number') {
+ res.push(repeat(' ', diff) + line);
+ } else if (typeOf(diff) === 'object') {
+ var result = repeat(diff.character || ' ', diff.indent || 0);
+ res.push((diff.prefix || '') + result + line);
+ }
+ }
+
+ if (type === 'array') return res;
+ return res.join('\n');
+};
diff --git a/node_modules/align-text/package.json b/node_modules/align-text/package.json
new file mode 100644
index 0000000..3eb1ab8
--- /dev/null
+++ b/node_modules/align-text/package.json
@@ -0,0 +1,117 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "align-text@^0.1.3",
+ "scope": null,
+ "escapedName": "align-text",
+ "name": "align-text",
+ "rawSpec": "^0.1.3",
+ "spec": ">=0.1.3 <0.2.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/center-align"
+ ]
+ ],
+ "_from": "align-text@>=0.1.3 <0.2.0",
+ "_id": "align-text@0.1.4",
+ "_inCache": true,
+ "_location": "/align-text",
+ "_nodeVersion": "5.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/align-text-0.1.4.tgz_1454377856920_0.9624228512402624"
+ },
+ "_npmUser": {
+ "name": "shinnn",
+ "email": "snnskwtnb@gmail.com"
+ },
+ "_npmVersion": "3.6.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "align-text@^0.1.3",
+ "scope": null,
+ "escapedName": "align-text",
+ "name": "align-text",
+ "rawSpec": "^0.1.3",
+ "spec": ">=0.1.3 <0.2.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/center-align",
+ "/right-align"
+ ],
+ "_resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
+ "_shasum": "0cd90a561093f35d0a99256c22b7069433fad117",
+ "_shrinkwrap": null,
+ "_spec": "align-text@^0.1.3",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/center-align",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/align-text/issues"
+ },
+ "dependencies": {
+ "kind-of": "^3.0.2",
+ "longest": "^1.0.1",
+ "repeat-string": "^1.5.2"
+ },
+ "description": "Align the text in a string.",
+ "devDependencies": {
+ "mocha": "*",
+ "should": "*",
+ "word-wrap": "^1.0.3"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "0cd90a561093f35d0a99256c22b7069433fad117",
+ "tarball": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "7f08e823a54c6bda319d875895813537a66a4c5e",
+ "homepage": "https://github.com/jonschlinkert/align-text",
+ "keywords": [
+ "align",
+ "align-center",
+ "alignment",
+ "center",
+ "center-align",
+ "indent",
+ "pad",
+ "padding",
+ "right",
+ "right-align",
+ "text",
+ "typography"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "shinnn",
+ "email": "snnskwtnb@gmail.com"
+ }
+ ],
+ "name": "align-text",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jonschlinkert/align-text.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "0.1.4"
+}
diff --git a/node_modules/amdefine/LICENSE b/node_modules/amdefine/LICENSE
new file mode 100644
index 0000000..9b25ee0
--- /dev/null
+++ b/node_modules/amdefine/LICENSE
@@ -0,0 +1,58 @@
+amdefine is released under two licenses: new BSD, and MIT. You may pick the
+license that best suits your development needs. The text of both licenses are
+provided below.
+
+
+The "New" BSD License:
+----------------------
+
+Copyright (c) 2011-2016, The Dojo Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the Dojo Foundation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+MIT License
+-----------
+
+Copyright (c) 2011-2016, The Dojo Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/amdefine/README.md b/node_modules/amdefine/README.md
new file mode 100644
index 0000000..037a6e8
--- /dev/null
+++ b/node_modules/amdefine/README.md
@@ -0,0 +1,171 @@
+# amdefine
+
+A module that can be used to implement AMD's define() in Node. This allows you
+to code to the AMD API and have the module work in node programs without
+requiring those other programs to use AMD.
+
+## Usage
+
+**1)** Update your package.json to indicate amdefine as a dependency:
+
+```javascript
+ "dependencies": {
+ "amdefine": ">=0.1.0"
+ }
+```
+
+Then run `npm install` to get amdefine into your project.
+
+**2)** At the top of each module that uses define(), place this code:
+
+```javascript
+if (typeof define !== 'function') { var define = require('amdefine')(module) }
+```
+
+**Only use these snippets** when loading amdefine. If you preserve the basic structure,
+with the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).
+
+You can add spaces, line breaks and even require amdefine with a local path, but
+keep the rest of the structure to get the stripping behavior.
+
+As you may know, because `if` statements in JavaScript don't have their own scope, the var
+declaration in the above snippet is made whether the `if` expression is truthy or not. If
+RequireJS is loaded then the declaration is superfluous because `define` is already already
+declared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`
+declarations of the same variable in the same scope gracefully.
+
+If you want to deliver amdefine.js with your code rather than specifying it as a dependency
+with npm, then just download the latest release and refer to it using a relative path:
+
+[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)
+
+### amdefine/intercept
+
+Consider this very experimental.
+
+Instead of pasting the piece of text for the amdefine setup of a `define`
+variable in each module you create or consume, you can use `amdefine/intercept`
+instead. It will automatically insert the above snippet in each .js file loaded
+by Node.
+
+**Warning**: you should only use this if you are creating an application that
+is consuming AMD style defined()'d modules that are distributed via npm and want
+to run that code in Node.
+
+For library code where you are not sure if it will be used by others in Node or
+in the browser, then explicitly depending on amdefine and placing the code
+snippet above is suggested path, instead of using `amdefine/intercept`. The
+intercept module affects all .js files loaded in the Node app, and it is
+inconsiderate to modify global state like that unless you are also controlling
+the top level app.
+
+#### Why distribute AMD-style modules via npm?
+
+npm has a lot of weaknesses for front-end use (installed layout is not great,
+should have better support for the `baseUrl + moduleID + '.js' style of loading,
+single file JS installs), but some people want a JS package manager and are
+willing to live with those constraints. If that is you, but still want to author
+in AMD style modules to get dynamic require([]), better direct source usage and
+powerful loader plugin support in the browser, then this tool can help.
+
+#### amdefine/intercept usage
+
+Just require it in your top level app module (for example index.js, server.js):
+
+```javascript
+require('amdefine/intercept');
+```
+
+The module does not return a value, so no need to assign the result to a local
+variable.
+
+Then just require() code as you normally would with Node's require(). Any .js
+loaded after the intercept require will have the amdefine check injected in
+the .js source as it is loaded. It does not modify the source on disk, just
+prepends some content to the text of the module as it is loaded by Node.
+
+#### How amdefine/intercept works
+
+It overrides the `Module._extensions['.js']` in Node to automatically prepend
+the amdefine snippet above. So, it will affect any .js file loaded by your
+app.
+
+## define() usage
+
+It is best if you use the anonymous forms of define() in your module:
+
+```javascript
+define(function (require) {
+ var dependency = require('dependency');
+});
+```
+
+or
+
+```javascript
+define(['dependency'], function (dependency) {
+
+});
+```
+
+## RequireJS optimizer integration.
+
+Version 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)
+will have support for stripping the `if (typeof define !== 'function')` check
+mentioned above, so you can include this snippet for code that runs in the
+browser, but avoid taking the cost of the if() statement once the code is
+optimized for deployment.
+
+## Node 0.4 Support
+
+If you want to support Node 0.4, then add `require` as the second parameter to amdefine:
+
+```javascript
+//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.
+if (typeof define !== 'function') { var define = require('amdefine')(module, require) }
+```
+
+## Limitations
+
+### Synchronous vs Asynchronous
+
+amdefine creates a define() function that is callable by your code. It will
+execute and trace dependencies and call the factory function *synchronously*,
+to keep the behavior in line with Node's synchronous dependency tracing.
+
+The exception: calling AMD's callback-style require() from inside a factory
+function. The require callback is called on process.nextTick():
+
+```javascript
+define(function (require) {
+ require(['a'], function(a) {
+ //'a' is loaded synchronously, but
+ //this callback is called on process.nextTick().
+ });
+});
+```
+
+### Loader Plugins
+
+Loader plugins are supported as long as they call their load() callbacks
+synchronously. So ones that do network requests will not work. However plugins
+like [text](http://requirejs.org/docs/api.html#text) can load text files locally.
+
+The plugin API's `load.fromText()` is **not supported** in amdefine, so this means
+transpiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)
+will not work. This may be fixable, but it is a bit complex, and I do not have
+enough node-fu to figure it out yet. See the source for amdefine.js if you want
+to get an idea of the issues involved.
+
+## Tests
+
+To run the tests, cd to **tests** and run:
+
+```
+node all.js
+node all-intercept.js
+```
+
+## License
+
+New BSD and MIT. Check the LICENSE file for all the details.
diff --git a/node_modules/amdefine/amdefine.js b/node_modules/amdefine/amdefine.js
new file mode 100644
index 0000000..ca830ba
--- /dev/null
+++ b/node_modules/amdefine/amdefine.js
@@ -0,0 +1,301 @@
+/** vim: et:ts=4:sw=4:sts=4
+ * @license amdefine 1.0.1 Copyright (c) 2011-2016, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/amdefine for details
+ */
+
+/*jslint node: true */
+/*global module, process */
+'use strict';
+
+/**
+ * Creates a define for node.
+ * @param {Object} module the "module" object that is defined by Node for the
+ * current module.
+ * @param {Function} [requireFn]. Node's require function for the current module.
+ * It only needs to be passed in Node versions before 0.5, when module.require
+ * did not exist.
+ * @returns {Function} a define function that is usable for the current node
+ * module.
+ */
+function amdefine(module, requireFn) {
+ 'use strict';
+ var defineCache = {},
+ loaderCache = {},
+ alreadyCalled = false,
+ path = require('path'),
+ makeRequire, stringRequire;
+
+ /**
+ * Trims the . and .. from an array of path segments.
+ * It will keep a leading path segment if a .. will become
+ * the first path segment, to help with module name lookups,
+ * which act like paths, but can be remapped. But the end result,
+ * all paths that use this function should look normalized.
+ * NOTE: this method MODIFIES the input array.
+ * @param {Array} ary the array of path segments.
+ */
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; ary[i]; i+= 1) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
+ //End of the line. Keep at least one non-dot
+ //path segment at the front so it can be mapped
+ //correctly to disk. Otherwise, there is likely
+ //no path mapping for a path starting with '..'.
+ //This can still fail, but catches the most reasonable
+ //uses of ..
+ break;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+
+ function normalize(name, baseName) {
+ var baseParts;
+
+ //Adjust any relative paths.
+ if (name && name.charAt(0) === '.') {
+ //If have a base name, try to normalize against it,
+ //otherwise, assume it is a top-level require that will
+ //be relative to baseUrl in the end.
+ if (baseName) {
+ baseParts = baseName.split('/');
+ baseParts = baseParts.slice(0, baseParts.length - 1);
+ baseParts = baseParts.concat(name.split('/'));
+ trimDots(baseParts);
+ name = baseParts.join('/');
+ }
+ }
+
+ return name;
+ }
+
+ /**
+ * Create the normalize() function passed to a loader plugin's
+ * normalize method.
+ */
+ function makeNormalize(relName) {
+ return function (name) {
+ return normalize(name, relName);
+ };
+ }
+
+ function makeLoad(id) {
+ function load(value) {
+ loaderCache[id] = value;
+ }
+
+ load.fromText = function (id, text) {
+ //This one is difficult because the text can/probably uses
+ //define, and any relative paths and requires should be relative
+ //to that id was it would be found on disk. But this would require
+ //bootstrapping a module/require fairly deeply from node core.
+ //Not sure how best to go about that yet.
+ throw new Error('amdefine does not implement load.fromText');
+ };
+
+ return load;
+ }
+
+ makeRequire = function (systemRequire, exports, module, relId) {
+ function amdRequire(deps, callback) {
+ if (typeof deps === 'string') {
+ //Synchronous, single module require('')
+ return stringRequire(systemRequire, exports, module, deps, relId);
+ } else {
+ //Array of dependencies with a callback.
+
+ //Convert the dependencies to modules.
+ deps = deps.map(function (depName) {
+ return stringRequire(systemRequire, exports, module, depName, relId);
+ });
+
+ //Wait for next tick to call back the require call.
+ if (callback) {
+ process.nextTick(function () {
+ callback.apply(null, deps);
+ });
+ }
+ }
+ }
+
+ amdRequire.toUrl = function (filePath) {
+ if (filePath.indexOf('.') === 0) {
+ return normalize(filePath, path.dirname(module.filename));
+ } else {
+ return filePath;
+ }
+ };
+
+ return amdRequire;
+ };
+
+ //Favor explicit value, passed in if the module wants to support Node 0.4.
+ requireFn = requireFn || function req() {
+ return module.require.apply(module, arguments);
+ };
+
+ function runFactory(id, deps, factory) {
+ var r, e, m, result;
+
+ if (id) {
+ e = loaderCache[id] = {};
+ m = {
+ id: id,
+ uri: __filename,
+ exports: e
+ };
+ r = makeRequire(requireFn, e, m, id);
+ } else {
+ //Only support one define call per file
+ if (alreadyCalled) {
+ throw new Error('amdefine with no module ID cannot be called more than once per file.');
+ }
+ alreadyCalled = true;
+
+ //Use the real variables from node
+ //Use module.exports for exports, since
+ //the exports in here is amdefine exports.
+ e = module.exports;
+ m = module;
+ r = makeRequire(requireFn, e, m, module.id);
+ }
+
+ //If there are dependencies, they are strings, so need
+ //to convert them to dependency values.
+ if (deps) {
+ deps = deps.map(function (depName) {
+ return r(depName);
+ });
+ }
+
+ //Call the factory with the right dependencies.
+ if (typeof factory === 'function') {
+ result = factory.apply(m.exports, deps);
+ } else {
+ result = factory;
+ }
+
+ if (result !== undefined) {
+ m.exports = result;
+ if (id) {
+ loaderCache[id] = m.exports;
+ }
+ }
+ }
+
+ stringRequire = function (systemRequire, exports, module, id, relId) {
+ //Split the ID by a ! so that
+ var index = id.indexOf('!'),
+ originalId = id,
+ prefix, plugin;
+
+ if (index === -1) {
+ id = normalize(id, relId);
+
+ //Straight module lookup. If it is one of the special dependencies,
+ //deal with it, otherwise, delegate to node.
+ if (id === 'require') {
+ return makeRequire(systemRequire, exports, module, relId);
+ } else if (id === 'exports') {
+ return exports;
+ } else if (id === 'module') {
+ return module;
+ } else if (loaderCache.hasOwnProperty(id)) {
+ return loaderCache[id];
+ } else if (defineCache[id]) {
+ runFactory.apply(null, defineCache[id]);
+ return loaderCache[id];
+ } else {
+ if(systemRequire) {
+ return systemRequire(originalId);
+ } else {
+ throw new Error('No module with ID: ' + id);
+ }
+ }
+ } else {
+ //There is a plugin in play.
+ prefix = id.substring(0, index);
+ id = id.substring(index + 1, id.length);
+
+ plugin = stringRequire(systemRequire, exports, module, prefix, relId);
+
+ if (plugin.normalize) {
+ id = plugin.normalize(id, makeNormalize(relId));
+ } else {
+ //Normalize the ID normally.
+ id = normalize(id, relId);
+ }
+
+ if (loaderCache[id]) {
+ return loaderCache[id];
+ } else {
+ plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});
+
+ return loaderCache[id];
+ }
+ }
+ };
+
+ //Create a define function specific to the module asking for amdefine.
+ function define(id, deps, factory) {
+ if (Array.isArray(id)) {
+ factory = deps;
+ deps = id;
+ id = undefined;
+ } else if (typeof id !== 'string') {
+ factory = id;
+ id = deps = undefined;
+ }
+
+ if (deps && !Array.isArray(deps)) {
+ factory = deps;
+ deps = undefined;
+ }
+
+ if (!deps) {
+ deps = ['require', 'exports', 'module'];
+ }
+
+ //Set up properties for this module. If an ID, then use
+ //internal cache. If no ID, then use the external variables
+ //for this node module.
+ if (id) {
+ //Put the module in deep freeze until there is a
+ //require call for it.
+ defineCache[id] = [id, deps, factory];
+ } else {
+ runFactory(id, deps, factory);
+ }
+ }
+
+ //define.require, which has access to all the values in the
+ //cache. Useful for AMD modules that all have IDs in the file,
+ //but need to finally export a value to node based on one of those
+ //IDs.
+ define.require = function (id) {
+ if (loaderCache[id]) {
+ return loaderCache[id];
+ }
+
+ if (defineCache[id]) {
+ runFactory.apply(null, defineCache[id]);
+ return loaderCache[id];
+ }
+ };
+
+ define.amd = {};
+
+ return define;
+}
+
+module.exports = amdefine;
diff --git a/node_modules/amdefine/intercept.js b/node_modules/amdefine/intercept.js
new file mode 100644
index 0000000..771a983
--- /dev/null
+++ b/node_modules/amdefine/intercept.js
@@ -0,0 +1,36 @@
+/*jshint node: true */
+var inserted,
+ Module = require('module'),
+ fs = require('fs'),
+ existingExtFn = Module._extensions['.js'],
+ amdefineRegExp = /amdefine\.js/;
+
+inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}";
+
+//From the node/lib/module.js source:
+function stripBOM(content) {
+ // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ // because the buffer-to-string conversion in `fs.readFileSync()`
+ // translates it to FEFF, the UTF-16 BOM.
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+}
+
+//Also adapted from the node/lib/module.js source:
+function intercept(module, filename) {
+ var content = stripBOM(fs.readFileSync(filename, 'utf8'));
+
+ if (!amdefineRegExp.test(module.id)) {
+ content = inserted + content;
+ }
+
+ module._compile(content, filename);
+}
+
+intercept._id = 'amdefine/intercept';
+
+if (!existingExtFn._id || existingExtFn._id !== intercept._id) {
+ Module._extensions['.js'] = intercept;
+}
diff --git a/node_modules/amdefine/package.json b/node_modules/amdefine/package.json
new file mode 100644
index 0000000..789336b
--- /dev/null
+++ b/node_modules/amdefine/package.json
@@ -0,0 +1,86 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "amdefine@>=0.0.4",
+ "scope": null,
+ "escapedName": "amdefine",
+ "name": "amdefine",
+ "rawSpec": ">=0.0.4",
+ "spec": ">=0.0.4",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/source-map"
+ ]
+ ],
+ "_from": "amdefine@>=0.0.4",
+ "_id": "amdefine@1.0.1",
+ "_inCache": true,
+ "_location": "/amdefine",
+ "_nodeVersion": "6.7.0",
+ "_npmOperationalInternal": {
+ "host": "packages-18-east.internal.npmjs.com",
+ "tmp": "tmp/amdefine-1.0.1.tgz_1478062849665_0.19916908955201507"
+ },
+ "_npmUser": {
+ "name": "jrburke",
+ "email": "jrburke@gmail.com"
+ },
+ "_npmVersion": "3.10.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "amdefine@>=0.0.4",
+ "scope": null,
+ "escapedName": "amdefine",
+ "name": "amdefine",
+ "rawSpec": ">=0.0.4",
+ "spec": ">=0.0.4",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/source-map"
+ ],
+ "_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
+ "_shasum": "4a5282ac164729e93619bcfd3ad151f817ce91f5",
+ "_shrinkwrap": null,
+ "_spec": "amdefine@>=0.0.4",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/source-map",
+ "author": {
+ "name": "James Burke",
+ "email": "jrburke@gmail.com",
+ "url": "http://github.com/jrburke"
+ },
+ "bugs": {
+ "url": "https://github.com/jrburke/amdefine/issues"
+ },
+ "dependencies": {},
+ "description": "Provide AMD's define() API for declaring modules in the AMD format",
+ "devDependencies": {},
+ "directories": {},
+ "dist": {
+ "shasum": "4a5282ac164729e93619bcfd3ad151f817ce91f5",
+ "tarball": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.4.2"
+ },
+ "gitHead": "e59edc9da24404ec7937098e3992f8fb0e260be7",
+ "homepage": "http://github.com/jrburke/amdefine",
+ "license": "BSD-3-Clause OR MIT",
+ "main": "./amdefine.js",
+ "maintainers": [
+ {
+ "name": "jrburke",
+ "email": "jrburke@gmail.com"
+ }
+ ],
+ "name": "amdefine",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jrburke/amdefine.git"
+ },
+ "scripts": {},
+ "version": "1.0.1"
+}
diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js
new file mode 100644
index 0000000..b9574ed
--- /dev/null
+++ b/node_modules/ansi-regex/index.js
@@ -0,0 +1,4 @@
+'use strict';
+module.exports = function () {
+ return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
+};
diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/ansi-regex/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json
new file mode 100644
index 0000000..44a1a79
--- /dev/null
+++ b/node_modules/ansi-regex/package.json
@@ -0,0 +1,133 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "ansi-regex@^2.1.1",
+ "scope": null,
+ "escapedName": "ansi-regex",
+ "name": "ansi-regex",
+ "rawSpec": "^2.1.1",
+ "spec": ">=2.1.1 <3.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/cli-color"
+ ]
+ ],
+ "_from": "ansi-regex@>=2.1.1 <3.0.0",
+ "_id": "ansi-regex@2.1.1",
+ "_inCache": true,
+ "_location": "/ansi-regex",
+ "_nodeVersion": "0.10.32",
+ "_npmOperationalInternal": {
+ "host": "packages-18-east.internal.npmjs.com",
+ "tmp": "tmp/ansi-regex-2.1.1.tgz_1484363378013_0.4482989883981645"
+ },
+ "_npmUser": {
+ "name": "qix",
+ "email": "i.am.qix@gmail.com"
+ },
+ "_npmVersion": "2.14.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "ansi-regex@^2.1.1",
+ "scope": null,
+ "escapedName": "ansi-regex",
+ "name": "ansi-regex",
+ "rawSpec": "^2.1.1",
+ "spec": ">=2.1.1 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/cli-color",
+ "/has-ansi",
+ "/strip-ansi"
+ ],
+ "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
+ "_shrinkwrap": null,
+ "_spec": "ansi-regex@^2.1.1",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/cli-color",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/chalk/ansi-regex/issues"
+ },
+ "dependencies": {},
+ "description": "Regular expression for matching ANSI escape codes",
+ "devDependencies": {
+ "ava": "0.17.0",
+ "xo": "0.16.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
+ "tarball": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "7c908e7b4eb6cd82bfe1295e33fdf6d166c7ed85",
+ "homepage": "https://github.com/chalk/ansi-regex#readme",
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "text",
+ "regex",
+ "regexp",
+ "re",
+ "match",
+ "test",
+ "find",
+ "pattern"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "qix",
+ "email": "i.am.qix@gmail.com"
+ },
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "ansi-regex",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/ansi-regex.git"
+ },
+ "scripts": {
+ "test": "xo && ava --verbose",
+ "view-supported": "node fixtures/view-codes.js"
+ },
+ "version": "2.1.1",
+ "xo": {
+ "rules": {
+ "guard-for-in": 0,
+ "no-loop-func": 0
+ }
+ }
+}
diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md
new file mode 100644
index 0000000..6a928ed
--- /dev/null
+++ b/node_modules/ansi-regex/readme.md
@@ -0,0 +1,39 @@
+# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)
+
+> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```
+$ npm install --save ansi-regex
+```
+
+
+## Usage
+
+```js
+const ansiRegex = require('ansi-regex');
+
+ansiRegex().test('\u001b[4mcake\u001b[0m');
+//=> true
+
+ansiRegex().test('cake');
+//=> false
+
+'\u001b[4mcake\u001b[0m'.match(ansiRegex());
+//=> ['\u001b[4m', '\u001b[0m']
+```
+
+## FAQ
+
+### Why do you test for codes not in the ECMA 48 standard?
+
+Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
+
+On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js
new file mode 100644
index 0000000..7894527
--- /dev/null
+++ b/node_modules/ansi-styles/index.js
@@ -0,0 +1,65 @@
+'use strict';
+
+function assembleStyles () {
+ var styles = {
+ modifiers: {
+ reset: [0, 0],
+ bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29]
+ },
+ colors: {
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+ gray: [90, 39]
+ },
+ bgColors: {
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49]
+ }
+ };
+
+ // fix humans
+ styles.colors.grey = styles.colors.gray;
+
+ Object.keys(styles).forEach(function (groupName) {
+ var group = styles[groupName];
+
+ Object.keys(group).forEach(function (styleName) {
+ var style = group[styleName];
+
+ styles[styleName] = group[styleName] = {
+ open: '\u001b[' + style[0] + 'm',
+ close: '\u001b[' + style[1] + 'm'
+ };
+ });
+
+ Object.defineProperty(styles, groupName, {
+ value: group,
+ enumerable: false
+ });
+ });
+
+ return styles;
+}
+
+Object.defineProperty(module, 'exports', {
+ enumerable: true,
+ get: assembleStyles
+});
diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/ansi-styles/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json
new file mode 100644
index 0000000..569949b
--- /dev/null
+++ b/node_modules/ansi-styles/package.json
@@ -0,0 +1,114 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "ansi-styles@^2.2.1",
+ "scope": null,
+ "escapedName": "ansi-styles",
+ "name": "ansi-styles",
+ "rawSpec": "^2.2.1",
+ "spec": ">=2.2.1 <3.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/chalk"
+ ]
+ ],
+ "_from": "ansi-styles@>=2.2.1 <3.0.0",
+ "_id": "ansi-styles@2.2.1",
+ "_inCache": true,
+ "_location": "/ansi-styles",
+ "_nodeVersion": "4.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176"
+ },
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "_npmVersion": "3.8.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "ansi-styles@^2.2.1",
+ "scope": null,
+ "escapedName": "ansi-styles",
+ "name": "ansi-styles",
+ "rawSpec": "^2.2.1",
+ "spec": ">=2.2.1 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/chalk"
+ ],
+ "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
+ "_shrinkwrap": null,
+ "_spec": "ansi-styles@^2.2.1",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/chalk",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/chalk/ansi-styles/issues"
+ },
+ "dependencies": {},
+ "description": "ANSI escape codes for styling strings in the terminal",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
+ "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "95c59b23be760108b6530ca1c89477c21b258032",
+ "homepage": "https://github.com/chalk/ansi-styles#readme",
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "ansi-styles",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/ansi-styles.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "2.2.1"
+}
diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md
new file mode 100644
index 0000000..3f933f6
--- /dev/null
+++ b/node_modules/ansi-styles/readme.md
@@ -0,0 +1,86 @@
+# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
+
+> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
+
+You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
+
+
+
+
+## Install
+
+```
+$ npm install --save ansi-styles
+```
+
+
+## Usage
+
+```js
+var ansi = require('ansi-styles');
+
+console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
+```
+
+
+## API
+
+Each style has an `open` and `close` property.
+
+
+## Styles
+
+### Modifiers
+
+- `reset`
+- `bold`
+- `dim`
+- `italic` *(not widely supported)*
+- `underline`
+- `inverse`
+- `hidden`
+- `strikethrough` *(not widely supported)*
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue`
+- `magenta`
+- `cyan`
+- `white`
+- `gray`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+
+
+## Advanced usage
+
+By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
+
+- `ansi.modifiers`
+- `ansi.colors`
+- `ansi.bgColors`
+
+
+###### Example
+
+```js
+console.log(ansi.colors.green.open);
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/ap/README.markdown b/node_modules/ap/README.markdown
new file mode 100644
index 0000000..81083b3
--- /dev/null
+++ b/node_modules/ap/README.markdown
@@ -0,0 +1,61 @@
+ap
+==
+
+`Function.prototype.bind` sets `this` which is super annoying if you just want
+to do currying over arguments while passing `this` through.
+
+Instead you can do:
+
+``` js
+var ap = require('ap');
+var z = ap([3], function (x, y) {
+ return this.z * (x * 2 + y);
+}).call({ z : 10 }, 4);
+console.log(z);
+```
+
+***
+
+```
+100
+```
+
+methods
+=======
+
+``` js
+var ap = require('ap')
+```
+
+## ap(args, fn)
+
+Fill in the arguments `args` at the beginning of `fn`'s arguments list.
+
+## ap.pa(args, fn)
+
+Fill in the arguments `args` at the end of `fn`'s arguments list.
+
+## ap.apa(left, right, fn)
+
+Fill in `left` arguments starting from the beginning of `fn`'s argument list and
+`right` arguments starting from the end.
+
+## ap.partial(fn, args...)
+
+Fill in `fn`'s arguments with `args...` from the beginning of `fn`'s arguments
+list.
+
+## ap.partialRight(fn, args...)
+
+Fill in `fn`'s arguments with `args...` starting from the end of `fn`'s
+arguments list.
+
+## ap.curry(fn, args...)
+
+Curry `fn`, returning a new function with `args...` partially applied from the
+beginning of `fn`'s arguments list.
+
+## ap.curryRight(fn, args...)
+
+Curry `fn` returning a new function with `args...` partially applied from the
+end of `fn`'s arguments list.
diff --git a/node_modules/ap/examples/z.js b/node_modules/ap/examples/z.js
new file mode 100644
index 0000000..1d7cee1
--- /dev/null
+++ b/node_modules/ap/examples/z.js
@@ -0,0 +1,5 @@
+var ap = require('../');
+var z = ap([3], function (x, y) {
+ return this.z * (x * 2 + y);
+}).call({ z : 10 }, 4);
+console.log(z);
diff --git a/node_modules/ap/index.js b/node_modules/ap/index.js
new file mode 100644
index 0000000..c72c76a
--- /dev/null
+++ b/node_modules/ap/index.js
@@ -0,0 +1,48 @@
+exports = module.exports = ap;
+function ap (args, fn) {
+ return function () {
+ var rest = [].slice.call(arguments)
+ , first = args.slice()
+ first.push.apply(first, rest)
+ return fn.apply(this, first);
+ };
+}
+
+exports.pa = pa;
+function pa (args, fn) {
+ return function () {
+ var rest = [].slice.call(arguments)
+ rest.push.apply(rest, args)
+ return fn.apply(this, rest);
+ };
+}
+
+exports.apa = apa;
+function apa (left, right, fn) {
+ return function () {
+ return fn.apply(this,
+ left.concat.apply(left, arguments).concat(right)
+ );
+ };
+}
+
+exports.partial = partial;
+function partial (fn) {
+ var args = [].slice.call(arguments, 1);
+ return ap(args, fn);
+}
+
+exports.partialRight = partialRight;
+function partialRight (fn) {
+ var args = [].slice.call(arguments, 1);
+ return pa(args, fn);
+}
+
+exports.curry = curry;
+function curry (fn) {
+ return partial(partial, fn);
+}
+
+exports.curryRight = function curryRight (fn) {
+ return partial(partialRight, fn);
+}
diff --git a/node_modules/ap/package.json b/node_modules/ap/package.json
new file mode 100644
index 0000000..1236f10
--- /dev/null
+++ b/node_modules/ap/package.json
@@ -0,0 +1,94 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "ap@~0.2.0",
+ "scope": null,
+ "escapedName": "ap",
+ "name": "ap",
+ "rawSpec": "~0.2.0",
+ "spec": ">=0.2.0 <0.3.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/pg-types"
+ ]
+ ],
+ "_from": "ap@>=0.2.0 <0.3.0",
+ "_id": "ap@0.2.0",
+ "_inCache": true,
+ "_location": "/ap",
+ "_npmUser": {
+ "name": "substack",
+ "email": "mail@substack.net"
+ },
+ "_npmVersion": "1.1.59",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "ap@~0.2.0",
+ "scope": null,
+ "escapedName": "ap",
+ "name": "ap",
+ "rawSpec": "~0.2.0",
+ "spec": ">=0.2.0 <0.3.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/pg-types"
+ ],
+ "_resolved": "https://registry.npmjs.org/ap/-/ap-0.2.0.tgz",
+ "_shasum": "ae0942600b29912f0d2b14ec60c45e8f330b6110",
+ "_shrinkwrap": null,
+ "_spec": "ap@~0.2.0",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/pg-types",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "bugs": {
+ "url": "https://github.com/substack/node-ap/issues"
+ },
+ "dependencies": {},
+ "description": "Currying in javascript. Like .bind() without also setting `this`.",
+ "devDependencies": {
+ "tap": "0.2.5"
+ },
+ "directories": {
+ "example": "./examples"
+ },
+ "dist": {
+ "shasum": "ae0942600b29912f0d2b14ec60c45e8f330b6110",
+ "tarball": "https://registry.npmjs.org/ap/-/ap-0.2.0.tgz"
+ },
+ "engine": {
+ "node": ">=0.4.0"
+ },
+ "homepage": "https://github.com/substack/node-ap#readme",
+ "keywords": [
+ "curry",
+ "apply",
+ "ap",
+ "bind",
+ "function",
+ "functional"
+ ],
+ "license": "MIT/X11",
+ "main": "./index.js",
+ "maintainers": [
+ {
+ "name": "substack",
+ "email": "mail@substack.net"
+ }
+ ],
+ "name": "ap",
+ "optionalDependencies": {},
+ "readme": "ap\n==\n\n`Function.prototype.bind` sets `this` which is super annoying if you just want\nto do currying over arguments while passing `this` through.\n\nInstead you can do:\n\n``` js\nvar ap = require('ap');\nvar z = ap([3], function (x, y) {\n return this.z * (x * 2 + y);\n}).call({ z : 10 }, 4);\nconsole.log(z);\n```\n\n***\n\n```\n100\n```\n\nmethods\n=======\n\n``` js\nvar ap = require('ap')\n```\n\n## ap(args, fn)\n\nFill in the arguments `args` at the beginning of `fn`'s arguments list.\n\n## ap.pa(args, fn)\n\nFill in the arguments `args` at the end of `fn`'s arguments list.\n\n## ap.apa(left, right, fn)\n\nFill in `left` arguments starting from the beginning of `fn`'s argument list and\n`right` arguments starting from the end.\n\n## ap.partial(fn, args...)\n\nFill in `fn`'s arguments with `args...` from the beginning of `fn`'s arguments\nlist.\n\n## ap.partialRight(fn, args...)\n\nFill in `fn`'s arguments with `args...` starting from the end of `fn`'s\narguments list.\n\n## ap.curry(fn, args...)\n\nCurry `fn`, returning a new function with `args...` partially applied from the\nbeginning of `fn`'s arguments list.\n\n## ap.curryRight(fn, args...)\n\nCurry `fn` returning a new function with `args...` partially applied from the\nend of `fn`'s arguments list.\n",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/substack/node-ap.git"
+ },
+ "scripts": {
+ "test": "tap ./test"
+ },
+ "version": "0.2.0"
+}
diff --git a/node_modules/ap/test/curry.js b/node_modules/ap/test/curry.js
new file mode 100644
index 0000000..c90ffd7
--- /dev/null
+++ b/node_modules/ap/test/curry.js
@@ -0,0 +1,137 @@
+var test = require("tap").test;
+
+var ap = require('../');
+var pa = ap.pa;
+var apa = ap.apa;
+var partial = ap.partial;
+var partialRight = ap.partialRight;
+var curry = ap.curry;
+var curryRight = ap.curryRight;
+
+function one(x, y) {
+ return x * 2 + y
+}
+
+function two(x, y, z, w) {
+ return x * 2 + (y + z) * w
+}
+
+function three(x, y) {
+ return this.z * (x * 2 + y)
+}
+
+var z = {
+ z: 10
+};
+
+test("ap function", function (t) {
+ var apOne = ap([3], one);
+ t.equal(apOne(4),
+ 3 * 2 + 4);
+
+ var apTwo = ap([3,4], two);
+ t.equal(apTwo(5, 6),
+ 3 * 2 + (4 + 5) * 6);
+
+ var apThree = ap([3], three);
+ t.equal(apThree.call(z, 4),
+ 10 * (3 * 2 + 4));
+
+ t.end();
+});
+
+test("pa function", function (t) {
+ var paOne = pa([3], one);
+ t.equal(paOne(4),
+ 4 * 2 + 3);
+
+ var paTwo = pa([3,4], two);
+ t.equal(paTwo(5, 6),
+ 5 * 2 + (6 + 3) * 4);
+
+ var paThree = pa([3], three);
+ t.equal(paThree.call(z, 4),
+ 10 * (4 * 2 + 3));
+
+ t.end();
+});
+
+test("apa function", function (t) {
+ var apaOne = apa([3], [4], one);
+ t.equal(apaOne(),
+ 3 * 2 + 4);
+
+ var apaTwo = apa([3], [4], two);
+ t.equal(apaTwo(5, 6),
+ 3 * 2 + (5 + 6) * 4);
+
+ var apaThree = apa([3], [4], three);
+ t.equal(apaThree.call(z),
+ 10 * (3 * 2 + 4));
+
+ t.end();
+});
+
+test("partial function", function (t) {
+ var apOne = partial(one, 3);
+ t.equal(apOne(4),
+ 3 * 2 + 4);
+
+ var apTwo = partial(two, 3, 4);
+ t.equal(apTwo(5, 6),
+ 3 * 2 + (4 + 5) * 6);
+
+ var apThree = partial(three, 3);
+ t.equal(apThree.call(z, 4),
+ 10 * (3 * 2 + 4));
+
+ t.end();
+});
+
+test("partialRight function", function (t) {
+ var paOne = partialRight(one, 3);
+ t.equal(paOne(4),
+ 4 * 2 + 3);
+
+ var paTwo = partialRight(two, 3, 4);
+ t.equal(paTwo(5, 6),
+ 5 * 2 + (6 + 3) * 4);
+
+ var paThree = partialRight(three, 3);
+ t.equal(paThree.call(z, 4),
+ 10 * (4 * 2 + 3));
+
+ t.end();
+});
+
+test("curry function", function (t) {
+ var apOne = curry(one)(3);
+ t.equal(apOne(4),
+ 3 * 2 + 4, "curry one");
+
+ var apTwo = curry(two)(3, 4);
+ t.equal(apTwo(5, 6),
+ 3 * 2 + (4 + 5) * 6, "curry two");
+
+ var apThree = curry(three)(3);
+ t.equal(apThree.call(z, 4),
+ 10 * (3 * 2 + 4), "curry three");
+
+ t.end();
+});
+
+test("curryRight function", function (t) {
+ var paOne = curryRight(one)(3);
+ t.equal(paOne(4),
+ 4 * 2 + 3);
+
+ var paTwo = curryRight(two)(3, 4);
+ t.equal(paTwo(5, 6),
+ 5 * 2 + (6 + 3) * 4);
+
+ var paThree = curryRight(three)(3);
+ t.equal(paThree.call(z, 4),
+ 10 * (4 * 2 + 3));
+
+ t.end();
+});
diff --git a/node_modules/archy/.travis.yml b/node_modules/archy/.travis.yml
new file mode 100644
index 0000000..895dbd3
--- /dev/null
+++ b/node_modules/archy/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
diff --git a/node_modules/archy/LICENSE b/node_modules/archy/LICENSE
new file mode 100644
index 0000000..ee27ba4
--- /dev/null
+++ b/node_modules/archy/LICENSE
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/archy/examples/beep.js b/node_modules/archy/examples/beep.js
new file mode 100644
index 0000000..9c07047
--- /dev/null
+++ b/node_modules/archy/examples/beep.js
@@ -0,0 +1,24 @@
+var archy = require('../');
+var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+});
+console.log(s);
diff --git a/node_modules/archy/examples/multi_line.js b/node_modules/archy/examples/multi_line.js
new file mode 100644
index 0000000..8afdfad
--- /dev/null
+++ b/node_modules/archy/examples/multi_line.js
@@ -0,0 +1,25 @@
+var archy = require('../');
+
+var s = archy({
+ label : 'beep\none\ntwo',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O\nwheee',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny\nmeat' ]
+ },
+ 'creature'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+});
+console.log(s);
diff --git a/node_modules/archy/index.js b/node_modules/archy/index.js
new file mode 100644
index 0000000..869d64e
--- /dev/null
+++ b/node_modules/archy/index.js
@@ -0,0 +1,35 @@
+module.exports = function archy (obj, prefix, opts) {
+ if (prefix === undefined) prefix = '';
+ if (!opts) opts = {};
+ var chr = function (s) {
+ var chars = {
+ '│' : '|',
+ '└' : '`',
+ '├' : '+',
+ '─' : '-',
+ '┬' : '-'
+ };
+ return opts.unicode === false ? chars[s] : s;
+ };
+
+ if (typeof obj === 'string') obj = { label : obj };
+
+ var nodes = obj.nodes || [];
+ var lines = (obj.label || '').split('\n');
+ var splitter = '\n' + prefix + (nodes.length ? chr('│') : ' ') + ' ';
+
+ return prefix
+ + lines.join(splitter) + '\n'
+ + nodes.map(function (node, ix) {
+ var last = ix === nodes.length - 1;
+ var more = node.nodes && node.nodes.length;
+ var prefix_ = prefix + (last ? ' ' : chr('│')) + ' ';
+
+ return prefix
+ + (last ? chr('└') : chr('├')) + chr('─')
+ + (more ? chr('┬') : chr('─')) + ' '
+ + archy(node, prefix_, opts).slice(prefix.length + 2)
+ ;
+ }).join('')
+ ;
+};
diff --git a/node_modules/archy/package.json b/node_modules/archy/package.json
new file mode 100644
index 0000000..94b1fc9
--- /dev/null
+++ b/node_modules/archy/package.json
@@ -0,0 +1,114 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "archy@^1.0.0",
+ "scope": null,
+ "escapedName": "archy",
+ "name": "archy",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/gulp"
+ ]
+ ],
+ "_from": "archy@>=1.0.0 <2.0.0",
+ "_id": "archy@1.0.0",
+ "_inCache": true,
+ "_location": "/archy",
+ "_npmUser": {
+ "name": "substack",
+ "email": "mail@substack.net"
+ },
+ "_npmVersion": "1.4.25",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "archy@^1.0.0",
+ "scope": null,
+ "escapedName": "archy",
+ "name": "archy",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/gulp"
+ ],
+ "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
+ "_shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40",
+ "_shrinkwrap": null,
+ "_spec": "archy@^1.0.0",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/gulp",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "bugs": {
+ "url": "https://github.com/substack/node-archy/issues"
+ },
+ "dependencies": {},
+ "description": "render nested hierarchies `npm ls` style with unicode pipes",
+ "devDependencies": {
+ "tap": "~0.3.3",
+ "tape": "~0.1.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40",
+ "tarball": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz"
+ },
+ "gitHead": "30223c16191e877bf027b15b12daf077b9b55b84",
+ "homepage": "https://github.com/substack/node-archy",
+ "keywords": [
+ "hierarchy",
+ "npm ls",
+ "unicode",
+ "pretty",
+ "print"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "substack",
+ "email": "mail@substack.net"
+ }
+ ],
+ "name": "archy",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/substack/node-archy.git"
+ },
+ "scripts": {
+ "test": "tap test"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": {
+ "iexplore": [
+ "6.0",
+ "7.0",
+ "8.0",
+ "9.0"
+ ],
+ "chrome": [
+ "20.0"
+ ],
+ "firefox": [
+ "10.0",
+ "15.0"
+ ],
+ "safari": [
+ "5.1"
+ ],
+ "opera": [
+ "12.0"
+ ]
+ }
+ },
+ "version": "1.0.0"
+}
diff --git a/node_modules/archy/readme.markdown b/node_modules/archy/readme.markdown
new file mode 100644
index 0000000..ef7a5cf
--- /dev/null
+++ b/node_modules/archy/readme.markdown
@@ -0,0 +1,88 @@
+# archy
+
+Render nested hierarchies `npm ls` style with unicode pipes.
+
+[](http://ci.testling.com/substack/node-archy)
+
+[](http://travis-ci.org/substack/node-archy)
+
+# example
+
+``` js
+var archy = require('archy');
+var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+});
+console.log(s);
+```
+
+output
+
+```
+beep
+├── ity
+└─┬ boop
+ ├─┬ o_O
+ │ ├─┬ oh
+ │ │ ├── hello
+ │ │ └── puny
+ │ └── human
+ └── party
+ time!
+```
+
+# methods
+
+var archy = require('archy')
+
+## archy(obj, prefix='', opts={})
+
+Return a string representation of `obj` with unicode pipe characters like how
+`npm ls` looks.
+
+`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields.
+`'label'` is a string of text to display at a node level and `'nodes'` is an
+array of the descendents of the current node.
+
+If a node is a string, that string will be used as the `'label'` and an empty
+array of `'nodes'` will be used.
+
+`prefix` gets prepended to all the lines and is used by the algorithm to
+recursively update.
+
+If `'label'` has newlines they will be indented at the present indentation level
+with the current prefix.
+
+To disable unicode results in favor of all-ansi output set `opts.unicode` to
+`false`.
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install archy
+```
+
+# license
+
+MIT
diff --git a/node_modules/archy/test/beep.js b/node_modules/archy/test/beep.js
new file mode 100644
index 0000000..4ea74f9
--- /dev/null
+++ b/node_modules/archy/test/beep.js
@@ -0,0 +1,40 @@
+var test = require('tape');
+var archy = require('../');
+
+test('beep', function (t) {
+ var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party!'
+ ]
+ }
+ ]
+ });
+ t.equal(s, [
+ 'beep',
+ '├── ity',
+ '└─┬ boop',
+ ' ├─┬ o_O',
+ ' │ ├─┬ oh',
+ ' │ │ ├── hello',
+ ' │ │ └── puny',
+ ' │ └── human',
+ ' └── party!',
+ ''
+ ].join('\n'));
+ t.end();
+});
diff --git a/node_modules/archy/test/multi_line.js b/node_modules/archy/test/multi_line.js
new file mode 100644
index 0000000..2cf2154
--- /dev/null
+++ b/node_modules/archy/test/multi_line.js
@@ -0,0 +1,45 @@
+var test = require('tape');
+var archy = require('../');
+
+test('multi-line', function (t) {
+ var s = archy({
+ label : 'beep\none\ntwo',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O\nwheee',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny\nmeat' ]
+ },
+ 'creature'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+ });
+ t.equal(s, [
+ 'beep',
+ '│ one',
+ '│ two',
+ '├── ity',
+ '└─┬ boop',
+ ' ├─┬ o_O',
+ ' │ │ wheee',
+ ' │ ├─┬ oh',
+ ' │ │ ├── hello',
+ ' │ │ └── puny',
+ ' │ │ meat',
+ ' │ └── creature',
+ ' └── party',
+ ' time!',
+ ''
+ ].join('\n'));
+ t.end();
+});
diff --git a/node_modules/archy/test/non_unicode.js b/node_modules/archy/test/non_unicode.js
new file mode 100644
index 0000000..7204d33
--- /dev/null
+++ b/node_modules/archy/test/non_unicode.js
@@ -0,0 +1,40 @@
+var test = require('tape');
+var archy = require('../');
+
+test('beep', function (t) {
+ var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party!'
+ ]
+ }
+ ]
+ }, '', { unicode : false });
+ t.equal(s, [
+ 'beep',
+ '+-- ity',
+ '`-- boop',
+ ' +-- o_O',
+ ' | +-- oh',
+ ' | | +-- hello',
+ ' | | `-- puny',
+ ' | `-- human',
+ ' `-- party!',
+ ''
+ ].join('\n'));
+ t.end();
+});
diff --git a/node_modules/arr-diff/LICENSE b/node_modules/arr-diff/LICENSE
new file mode 100755
index 0000000..fa30c4c
--- /dev/null
+++ b/node_modules/arr-diff/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/arr-diff/README.md b/node_modules/arr-diff/README.md
new file mode 100644
index 0000000..7705c6c
--- /dev/null
+++ b/node_modules/arr-diff/README.md
@@ -0,0 +1,74 @@
+# arr-diff [](https://www.npmjs.com/package/arr-diff) [](https://travis-ci.org/jonschlinkert/base)
+
+> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i arr-diff --save
+```
+Install with [bower](http://bower.io/)
+
+```sh
+$ bower install arr-diff --save
+```
+
+## API
+
+### [diff](index.js#L33)
+
+Return the difference between the first array and additional arrays.
+
+**Params**
+
+* `a` **{Array}**
+* `b` **{Array}**
+* `returns` **{Array}**
+
+**Example**
+
+```js
+var diff = require('arr-diff');
+
+var a = ['a', 'b', 'c', 'd'];
+var b = ['b', 'c'];
+
+console.log(diff(a, b))
+//=> ['a', 'd']
+```
+
+## Related projects
+
+* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten)
+* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter)
+* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://www.npmjs.com/package/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection)
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-diff/issues/new).
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb](https://github.com/verbose/verb) on Sat Dec 05 2015 23:24:53 GMT-0500 (EST)._
diff --git a/node_modules/arr-diff/index.js b/node_modules/arr-diff/index.js
new file mode 100644
index 0000000..bc7200d
--- /dev/null
+++ b/node_modules/arr-diff/index.js
@@ -0,0 +1,58 @@
+/*!
+ * arr-diff
+ *
+ * Copyright (c) 2014 Jon Schlinkert, contributors.
+ * Licensed under the MIT License
+ */
+
+'use strict';
+
+var flatten = require('arr-flatten');
+var slice = [].slice;
+
+/**
+ * Return the difference between the first array and
+ * additional arrays.
+ *
+ * ```js
+ * var diff = require('{%= name %}');
+ *
+ * var a = ['a', 'b', 'c', 'd'];
+ * var b = ['b', 'c'];
+ *
+ * console.log(diff(a, b))
+ * //=> ['a', 'd']
+ * ```
+ *
+ * @param {Array} `a`
+ * @param {Array} `b`
+ * @return {Array}
+ * @api public
+ */
+
+function diff(arr, arrays) {
+ var argsLen = arguments.length;
+ var len = arr.length, i = -1;
+ var res = [], arrays;
+
+ if (argsLen === 1) {
+ return arr;
+ }
+
+ if (argsLen > 2) {
+ arrays = flatten(slice.call(arguments, 1));
+ }
+
+ while (++i < len) {
+ if (!~arrays.indexOf(arr[i])) {
+ res.push(arr[i]);
+ }
+ }
+ return res;
+}
+
+/**
+ * Expose `diff`
+ */
+
+module.exports = diff;
diff --git a/node_modules/arr-diff/package.json b/node_modules/arr-diff/package.json
new file mode 100644
index 0000000..49941d7
--- /dev/null
+++ b/node_modules/arr-diff/package.json
@@ -0,0 +1,119 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "arr-diff@^2.0.0",
+ "scope": null,
+ "escapedName": "arr-diff",
+ "name": "arr-diff",
+ "rawSpec": "^2.0.0",
+ "spec": ">=2.0.0 <3.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/micromatch"
+ ]
+ ],
+ "_from": "arr-diff@>=2.0.0 <3.0.0",
+ "_id": "arr-diff@2.0.0",
+ "_inCache": true,
+ "_location": "/arr-diff",
+ "_nodeVersion": "5.0.0",
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "3.3.6",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "arr-diff@^2.0.0",
+ "scope": null,
+ "escapedName": "arr-diff",
+ "name": "arr-diff",
+ "rawSpec": "^2.0.0",
+ "spec": ">=2.0.0 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/micromatch"
+ ],
+ "_resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
+ "_shasum": "8f3b827f955a8bd669697e4a4256ac3ceae356cf",
+ "_shrinkwrap": null,
+ "_spec": "arr-diff@^2.0.0",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/micromatch",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/arr-diff/issues"
+ },
+ "dependencies": {
+ "arr-flatten": "^1.0.1"
+ },
+ "description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.",
+ "devDependencies": {
+ "array-differ": "^1.0.0",
+ "array-slice": "^0.2.3",
+ "benchmarked": "^0.1.4",
+ "chalk": "^1.1.1",
+ "mocha": "*",
+ "should": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "8f3b827f955a8bd669697e4a4256ac3ceae356cf",
+ "tarball": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "b89f54eb88ca51afd0e0ea6be9a4a63e5ccecf27",
+ "homepage": "https://github.com/jonschlinkert/arr-diff",
+ "keywords": [
+ "arr",
+ "array",
+ "diff",
+ "differ",
+ "difference"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "doowb",
+ "email": "brian.woodward@gmail.com"
+ },
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "paulmillr",
+ "email": "paul@paulmillr.com"
+ }
+ ],
+ "name": "arr-diff",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/arr-diff.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "related": {
+ "list": [
+ "arr-flatten",
+ "array-filter",
+ "array-intersection"
+ ]
+ }
+ },
+ "version": "2.0.0"
+}
diff --git a/node_modules/arr-flatten/LICENSE b/node_modules/arr-flatten/LICENSE
new file mode 100755
index 0000000..3f2eca1
--- /dev/null
+++ b/node_modules/arr-flatten/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2017, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/arr-flatten/README.md b/node_modules/arr-flatten/README.md
new file mode 100755
index 0000000..7dc7a97
--- /dev/null
+++ b/node_modules/arr-flatten/README.md
@@ -0,0 +1,86 @@
+# arr-flatten [](https://www.npmjs.com/package/arr-flatten) [](https://npmjs.org/package/arr-flatten) [](https://npmjs.org/package/arr-flatten) [](https://travis-ci.org/jonschlinkert/arr-flatten) [](https://ci.appveyor.com/project/jonschlinkert/arr-flatten)
+
+> Recursively flatten an array or arrays.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save arr-flatten
+```
+
+## Install
+
+Install with [bower](https://bower.io/)
+
+```sh
+$ bower install arr-flatten --save
+```
+
+## Usage
+
+```js
+var flatten = require('arr-flatten');
+
+flatten(['a', ['b', ['c']], 'd', ['e']]);
+//=> ['a', 'b', 'c', 'd', 'e']
+```
+
+## Why another flatten utility?
+
+I wanted the fastest implementation I could find, with implementation choices that should work for 95% of use cases, but no cruft to cover the other 5%.
+
+## About
+
+### Related projects
+
+* [arr-filter](https://www.npmjs.com/package/arr-filter): Faster alternative to javascript's native filter method. | [homepage](https://github.com/jonschlinkert/arr-filter "Faster alternative to javascript's native filter method.")
+* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.")
+* [array-each](https://www.npmjs.com/package/array-each): Loop over each item in an array and call the given function on every element. | [homepage](https://github.com/jonschlinkert/array-each "Loop over each item in an array and call the given function on every element.")
+* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique "Remove duplicate values from an array. Fastest ES5 implementation.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Contributors
+
+| **Commits** | **Contributor** |
+| --- | --- |
+| 20 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 1 | [lukeed](https://github.com/lukeed) |
+
+### Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+### Running tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+$ npm install && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 05, 2017._
\ No newline at end of file
diff --git a/node_modules/arr-flatten/index.js b/node_modules/arr-flatten/index.js
new file mode 100644
index 0000000..0cb4ea4
--- /dev/null
+++ b/node_modules/arr-flatten/index.js
@@ -0,0 +1,22 @@
+/*!
+ * arr-flatten
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+'use strict';
+
+module.exports = function (arr) {
+ return flat(arr, []);
+};
+
+function flat(arr, res) {
+ var i = 0, cur;
+ var len = arr.length;
+ for (; i < len; i++) {
+ cur = arr[i];
+ Array.isArray(cur) ? flat(cur, res) : res.push(cur);
+ }
+ return res;
+}
diff --git a/node_modules/arr-flatten/package.json b/node_modules/arr-flatten/package.json
new file mode 100644
index 0000000..e55aea1
--- /dev/null
+++ b/node_modules/arr-flatten/package.json
@@ -0,0 +1,150 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "arr-flatten@^1.0.1",
+ "scope": null,
+ "escapedName": "arr-flatten",
+ "name": "arr-flatten",
+ "rawSpec": "^1.0.1",
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/arr-diff"
+ ]
+ ],
+ "_from": "arr-flatten@>=1.0.1 <2.0.0",
+ "_id": "arr-flatten@1.1.0",
+ "_inCache": true,
+ "_location": "/arr-flatten",
+ "_nodeVersion": "7.7.3",
+ "_npmOperationalInternal": {
+ "host": "s3://npm-registry-packages",
+ "tmp": "tmp/arr-flatten-1.1.0.tgz_1499280630530_0.4138362631201744"
+ },
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "5.0.4",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "arr-flatten@^1.0.1",
+ "scope": null,
+ "escapedName": "arr-flatten",
+ "name": "arr-flatten",
+ "rawSpec": "^1.0.1",
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/arr-diff"
+ ],
+ "_resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
+ "_shasum": "36048bbff4e7b47e136644316c99669ea5ae91f1",
+ "_shrinkwrap": null,
+ "_spec": "arr-flatten@^1.0.1",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/arr-diff",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/arr-flatten/issues"
+ },
+ "contributors": [
+ {
+ "name": "Jon Schlinkert",
+ "url": "http://twitter.com/jonschlinkert"
+ },
+ {
+ "name": "Luke Edwards",
+ "url": "https://lukeed.com"
+ }
+ ],
+ "dependencies": {},
+ "description": "Recursively flatten an array or arrays.",
+ "devDependencies": {
+ "ansi-bold": "^0.1.1",
+ "array-flatten": "^2.1.1",
+ "array-slice": "^1.0.0",
+ "benchmarked": "^1.0.0",
+ "compute-flatten": "^1.0.0",
+ "flatit": "^1.1.1",
+ "flatten": "^1.0.2",
+ "flatten-array": "^1.0.0",
+ "glob": "^7.1.1",
+ "gulp-format-md": "^0.1.12",
+ "just-flatten-it": "^1.1.23",
+ "lodash.flattendeep": "^4.4.0",
+ "m_flattened": "^1.0.1",
+ "mocha": "^3.2.0",
+ "utils-flatten": "^1.0.0",
+ "write": "^0.3.3"
+ },
+ "directories": {},
+ "dist": {
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
+ "shasum": "36048bbff4e7b47e136644316c99669ea5ae91f1",
+ "tarball": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "76a1ae28b03fdb1cbe5d49fa521bc4807b9f94d3",
+ "homepage": "https://github.com/jonschlinkert/arr-flatten",
+ "keywords": [
+ "arr",
+ "array",
+ "elements",
+ "flat",
+ "flatten",
+ "nested",
+ "recurse",
+ "recursive",
+ "recursively"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ }
+ ],
+ "name": "arr-flatten",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/arr-flatten.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "arr-filter",
+ "arr-union",
+ "array-each",
+ "array-unique"
+ ]
+ },
+ "lint": {
+ "reflinks": true
+ }
+ },
+ "version": "1.1.0"
+}
diff --git a/node_modules/array-differ/index.js b/node_modules/array-differ/index.js
new file mode 100644
index 0000000..fbe2ed2
--- /dev/null
+++ b/node_modules/array-differ/index.js
@@ -0,0 +1,7 @@
+'use strict';
+module.exports = function (arr) {
+ var rest = [].concat.apply([], [].slice.call(arguments, 1));
+ return arr.filter(function (el) {
+ return rest.indexOf(el) === -1;
+ });
+};
diff --git a/node_modules/array-differ/package.json b/node_modules/array-differ/package.json
new file mode 100644
index 0000000..f775ea3
--- /dev/null
+++ b/node_modules/array-differ/package.json
@@ -0,0 +1,95 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "array-differ@^1.0.0",
+ "scope": null,
+ "escapedName": "array-differ",
+ "name": "array-differ",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/gulp-util"
+ ]
+ ],
+ "_from": "array-differ@>=1.0.0 <2.0.0",
+ "_id": "array-differ@1.0.0",
+ "_inCache": true,
+ "_location": "/array-differ",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "_npmVersion": "1.4.14",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "array-differ@^1.0.0",
+ "scope": null,
+ "escapedName": "array-differ",
+ "name": "array-differ",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/gulp-util"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz",
+ "_shasum": "eff52e3758249d33be402b8bb8e564bb2b5d4031",
+ "_shrinkwrap": null,
+ "_spec": "array-differ@^1.0.0",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/gulp-util",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/array-differ/issues"
+ },
+ "dependencies": {},
+ "description": "Create an array with values that are present in the first input array but not additional ones",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "eff52e3758249d33be402b8bb8e564bb2b5d4031",
+ "tarball": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "e91802976c4710eef8dea2090d48e48525cf41b1",
+ "homepage": "https://github.com/sindresorhus/array-differ",
+ "keywords": [
+ "array",
+ "difference",
+ "diff",
+ "differ",
+ "filter",
+ "exclude"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "array-differ",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/sindresorhus/array-differ.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "1.0.0"
+}
diff --git a/node_modules/array-differ/readme.md b/node_modules/array-differ/readme.md
new file mode 100644
index 0000000..68f5d36
--- /dev/null
+++ b/node_modules/array-differ/readme.md
@@ -0,0 +1,41 @@
+# array-differ [](https://travis-ci.org/sindresorhus/array-differ)
+
+> Create an array with values that are present in the first input array but not additional ones
+
+
+## Install
+
+```sh
+$ npm install --save array-differ
+```
+
+
+## Usage
+
+```js
+var arrayDiffer = require('array-differ');
+
+arrayDiffer([2, 3, 4], [3, 50]);
+//=> [2, 4]
+```
+
+## API
+
+### arrayDiffer(input, values, [values, ...])
+
+Returns the new array.
+
+#### input
+
+Type: `array`
+
+#### values
+
+Type: `array`
+
+Arrays of values to exclude.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/array-each/LICENSE b/node_modules/array-each/LICENSE
new file mode 100644
index 0000000..ec85897
--- /dev/null
+++ b/node_modules/array-each/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, 2017, Jon Schlinkert
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/array-each/README.md b/node_modules/array-each/README.md
new file mode 100644
index 0000000..e8602a1
--- /dev/null
+++ b/node_modules/array-each/README.md
@@ -0,0 +1,84 @@
+# array-each [](https://www.npmjs.com/package/array-each) [](https://npmjs.org/package/array-each) [](https://npmjs.org/package/array-each) [](https://travis-ci.org/jonschlinkert/array-each)
+
+> Loop over each item in an array and call the given function on every element.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save array-each
+```
+
+## Usage
+
+### [each](index.js#L34)
+
+Loop over each item in an array and call the given function on every element.
+
+**Params**
+
+* `array` **{Array}**
+* `fn` **{Function}**
+* `thisArg` **{Object}**: (optional) pass a `thisArg` to be used as the context in which to call the function.
+* `returns` **{undefined}**
+
+**Example**
+
+```js
+each(['a', 'b', 'c'], function(ele) {
+ return ele + ele;
+});
+//=> ['aa', 'bb', 'cc']
+
+each(['a', 'b', 'c'], function(ele, i) {
+ return i + ele;
+});
+//=> ['0a', '1b', '2c']
+```
+
+## About
+
+### Related projects
+
+* [arr-filter](https://www.npmjs.com/package/arr-filter): Faster alternative to javascript's native filter method. | [homepage](https://github.com/jonschlinkert/arr-filter "Faster alternative to javascript's native filter method.")
+* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map "Faster, node.js focused alternative to JavaScript's native array map.")
+* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+### Running tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+$ npm install && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 26, 2017._
\ No newline at end of file
diff --git a/node_modules/array-each/index.js b/node_modules/array-each/index.js
new file mode 100644
index 0000000..12afef4
--- /dev/null
+++ b/node_modules/array-each/index.js
@@ -0,0 +1,46 @@
+/*!
+ * array-each
+ *
+ * Copyright (c) 2015, 2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+'use strict';
+
+/**
+ * Loop over each item in an array and call the given function on every element.
+ *
+ * ```js
+ * each(['a', 'b', 'c'], function(ele) {
+ * return ele + ele;
+ * });
+ * //=> ['aa', 'bb', 'cc']
+ *
+ * each(['a', 'b', 'c'], function(ele, i) {
+ * return i + ele;
+ * });
+ * //=> ['0a', '1b', '2c']
+ * ```
+ *
+ * @name each
+ * @alias forEach
+ * @param {Array} `array`
+ * @param {Function} `fn`
+ * @param {Object} `thisArg` (optional) pass a `thisArg` to be used as the context in which to call the function.
+ * @return {undefined}
+ * @api public
+ */
+
+module.exports = function each(arr, cb, thisArg) {
+ if (arr == null) return;
+
+ var len = arr.length;
+ var idx = -1;
+
+ while (++idx < len) {
+ var ele = arr[idx];
+ if (cb.call(thisArg, ele, idx, arr) === false) {
+ break;
+ }
+ }
+};
diff --git a/node_modules/array-each/package.json b/node_modules/array-each/package.json
new file mode 100644
index 0000000..ac7e10c
--- /dev/null
+++ b/node_modules/array-each/package.json
@@ -0,0 +1,117 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "array-each@^1.0.1",
+ "scope": null,
+ "escapedName": "array-each",
+ "name": "array-each",
+ "rawSpec": "^1.0.1",
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/object.defaults"
+ ]
+ ],
+ "_from": "array-each@>=1.0.1 <2.0.0",
+ "_id": "array-each@1.0.1",
+ "_inCache": true,
+ "_location": "/array-each",
+ "_nodeVersion": "7.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/array-each-1.0.1.tgz_1488156048457_0.42185514722950757"
+ },
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "4.1.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "array-each@^1.0.1",
+ "scope": null,
+ "escapedName": "array-each",
+ "name": "array-each",
+ "rawSpec": "^1.0.1",
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/object.defaults"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
+ "_shasum": "a794af0c05ab1752846ee753a1f211a05ba0c44f",
+ "_shrinkwrap": null,
+ "_spec": "array-each@^1.0.1",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/object.defaults",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/array-each/issues"
+ },
+ "dependencies": {},
+ "description": "Loop over each item in an array and call the given function on every element.",
+ "devDependencies": {
+ "gulp-format-md": "^0.1.11",
+ "mocha": "^3.2.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "a794af0c05ab1752846ee753a1f211a05ba0c44f",
+ "tarball": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "a752d70897f25abfd38bfb51bb1b3a06ffcd2aed",
+ "homepage": "https://github.com/jonschlinkert/array-each",
+ "keywords": [
+ "array",
+ "each"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ }
+ ],
+ "name": "array-each",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/array-each.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "collection-map",
+ "arr-filter",
+ "arr-map"
+ ]
+ },
+ "lint": {
+ "reflinks": true
+ }
+ },
+ "version": "1.0.1"
+}
diff --git a/node_modules/array-flatten/LICENSE b/node_modules/array-flatten/LICENSE
new file mode 100644
index 0000000..983fbe8
--- /dev/null
+++ b/node_modules/array-flatten/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/array-flatten/README.md b/node_modules/array-flatten/README.md
new file mode 100644
index 0000000..91fa5b6
--- /dev/null
+++ b/node_modules/array-flatten/README.md
@@ -0,0 +1,43 @@
+# Array Flatten
+
+[![NPM version][npm-image]][npm-url]
+[![NPM downloads][downloads-image]][downloads-url]
+[![Build status][travis-image]][travis-url]
+[![Test coverage][coveralls-image]][coveralls-url]
+
+> Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
+
+## Installation
+
+```
+npm install array-flatten --save
+```
+
+## Usage
+
+```javascript
+var flatten = require('array-flatten')
+
+flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
+//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
+//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
+
+(function () {
+ flatten(arguments) //=> [1, 2, 3]
+})(1, [2, 3])
+```
+
+## License
+
+MIT
+
+[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
+[npm-url]: https://npmjs.org/package/array-flatten
+[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
+[downloads-url]: https://npmjs.org/package/array-flatten
+[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
+[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
+[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
+[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
diff --git a/node_modules/array-flatten/array-flatten.js b/node_modules/array-flatten/array-flatten.js
new file mode 100644
index 0000000..089117b
--- /dev/null
+++ b/node_modules/array-flatten/array-flatten.js
@@ -0,0 +1,64 @@
+'use strict'
+
+/**
+ * Expose `arrayFlatten`.
+ */
+module.exports = arrayFlatten
+
+/**
+ * Recursive flatten function with depth.
+ *
+ * @param {Array} array
+ * @param {Array} result
+ * @param {Number} depth
+ * @return {Array}
+ */
+function flattenWithDepth (array, result, depth) {
+ for (var i = 0; i < array.length; i++) {
+ var value = array[i]
+
+ if (depth > 0 && Array.isArray(value)) {
+ flattenWithDepth(value, result, depth - 1)
+ } else {
+ result.push(value)
+ }
+ }
+
+ return result
+}
+
+/**
+ * Recursive flatten function. Omitting depth is slightly faster.
+ *
+ * @param {Array} array
+ * @param {Array} result
+ * @return {Array}
+ */
+function flattenForever (array, result) {
+ for (var i = 0; i < array.length; i++) {
+ var value = array[i]
+
+ if (Array.isArray(value)) {
+ flattenForever(value, result)
+ } else {
+ result.push(value)
+ }
+ }
+
+ return result
+}
+
+/**
+ * Flatten an array, with the ability to define a depth.
+ *
+ * @param {Array} array
+ * @param {Number} depth
+ * @return {Array}
+ */
+function arrayFlatten (array, depth) {
+ if (depth == null) {
+ return flattenForever(array, [])
+ }
+
+ return flattenWithDepth(array, [], depth)
+}
diff --git a/node_modules/array-flatten/package.json b/node_modules/array-flatten/package.json
new file mode 100644
index 0000000..ea6f275
--- /dev/null
+++ b/node_modules/array-flatten/package.json
@@ -0,0 +1,96 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "array-flatten@1.1.1",
+ "scope": null,
+ "escapedName": "array-flatten",
+ "name": "array-flatten",
+ "rawSpec": "1.1.1",
+ "spec": "1.1.1",
+ "type": "version"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/express"
+ ]
+ ],
+ "_from": "array-flatten@1.1.1",
+ "_id": "array-flatten@1.1.1",
+ "_inCache": true,
+ "_location": "/array-flatten",
+ "_nodeVersion": "2.3.3",
+ "_npmUser": {
+ "name": "blakeembrey",
+ "email": "hello@blakeembrey.com"
+ },
+ "_npmVersion": "2.11.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "array-flatten@1.1.1",
+ "scope": null,
+ "escapedName": "array-flatten",
+ "name": "array-flatten",
+ "rawSpec": "1.1.1",
+ "spec": "1.1.1",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "/express"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
+ "_shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
+ "_shrinkwrap": null,
+ "_spec": "array-flatten@1.1.1",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/express",
+ "author": {
+ "name": "Blake Embrey",
+ "email": "hello@blakeembrey.com",
+ "url": "http://blakeembrey.me"
+ },
+ "bugs": {
+ "url": "https://github.com/blakeembrey/array-flatten/issues"
+ },
+ "dependencies": {},
+ "description": "Flatten an array of nested arrays into a single flat array",
+ "devDependencies": {
+ "istanbul": "^0.3.13",
+ "mocha": "^2.2.4",
+ "pre-commit": "^1.0.7",
+ "standard": "^3.7.3"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
+ "tarball": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
+ },
+ "files": [
+ "array-flatten.js",
+ "LICENSE"
+ ],
+ "gitHead": "1963a9189229d408e1e8f585a00c8be9edbd1803",
+ "homepage": "https://github.com/blakeembrey/array-flatten",
+ "keywords": [
+ "array",
+ "flatten",
+ "arguments",
+ "depth"
+ ],
+ "license": "MIT",
+ "main": "array-flatten.js",
+ "maintainers": [
+ {
+ "name": "blakeembrey",
+ "email": "hello@blakeembrey.com"
+ }
+ ],
+ "name": "array-flatten",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/blakeembrey/array-flatten.git"
+ },
+ "scripts": {
+ "test": "istanbul cover _mocha -- -R spec"
+ },
+ "version": "1.1.1"
+}
diff --git a/node_modules/array-slice/LICENSE b/node_modules/array-slice/LICENSE
new file mode 100755
index 0000000..d290fe0
--- /dev/null
+++ b/node_modules/array-slice/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2015, 2017, Jon Schlinkert
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/array-slice/README.md b/node_modules/array-slice/README.md
new file mode 100755
index 0000000..b65f79b
--- /dev/null
+++ b/node_modules/array-slice/README.md
@@ -0,0 +1,69 @@
+# array-slice [](https://www.npmjs.com/package/array-slice) [](https://npmjs.org/package/array-slice) [](https://npmjs.org/package/array-slice) [](https://travis-ci.org/jonschlinkert/array-slice)
+
+> Array-slice method. Slices `array` from the `start` index up to, but not including, the `end` index.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save array-slice
+```
+
+This function is used instead of `Array#slice` to support node lists in IE < 9 and to ensure dense arrays are returned. This is also faster than native slice in some cases.
+
+## Usage
+
+```js
+var slice = require('array-slice');
+var arr = ['a', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];
+
+slice(arr, 3, 6);
+//=> ['e', 'f', 'g']
+```
+
+## About
+
+### Related projects
+
+* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.")
+* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique "Remove duplicate values from an array. Fastest ES5 implementation.")
+* [array-xor](https://www.npmjs.com/package/array-xor): Returns the symmetric difference (exclusive-or) of an array of elements (elements that are present in… [more](https://github.com/jonschlinkert/array-xor) | [homepage](https://github.com/jonschlinkert/array-xor "Returns the symmetric difference (exclusive-or) of an array of elements (elements that are present in all given arrays and not in their intersections).")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+### Running tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+$ npm install && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 02, 2017._
\ No newline at end of file
diff --git a/node_modules/array-slice/index.js b/node_modules/array-slice/index.js
new file mode 100755
index 0000000..6adb0b0
--- /dev/null
+++ b/node_modules/array-slice/index.js
@@ -0,0 +1,35 @@
+/*!
+ * array-slice
+ *
+ * Copyright (c) 2014-2015, 2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+'use strict';
+
+module.exports = function slice(arr, start, end) {
+ var len = arr.length;
+ var range = [];
+
+ start = idx(arr, start);
+ end = idx(arr, end, len);
+
+ while (start < end) {
+ range.push(arr[start++]);
+ }
+ return range;
+};
+
+function idx(arr, pos, end) {
+ var len = arr.length;
+
+ if (pos == null) {
+ pos = end || 0;
+ } else if (pos < 0) {
+ pos = Math.max(len + pos, 0);
+ } else {
+ pos = Math.min(pos, len);
+ }
+
+ return pos;
+}
diff --git a/node_modules/array-slice/package.json b/node_modules/array-slice/package.json
new file mode 100644
index 0000000..b43eef9
--- /dev/null
+++ b/node_modules/array-slice/package.json
@@ -0,0 +1,125 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "array-slice@^1.0.0",
+ "scope": null,
+ "escapedName": "array-slice",
+ "name": "array-slice",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/object.defaults"
+ ]
+ ],
+ "_from": "array-slice@>=1.0.0 <2.0.0",
+ "_id": "array-slice@1.0.0",
+ "_inCache": true,
+ "_location": "/array-slice",
+ "_nodeVersion": "7.6.0",
+ "_npmOperationalInternal": {
+ "host": "packages-18-east.internal.npmjs.com",
+ "tmp": "tmp/array-slice-1.0.0.tgz_1488482499689_0.4508651338983327"
+ },
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "4.1.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "array-slice@^1.0.0",
+ "scope": null,
+ "escapedName": "array-slice",
+ "name": "array-slice",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/object.defaults"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz",
+ "_shasum": "e73034f00dcc1f40876008fd20feae77bd4b7c2f",
+ "_shrinkwrap": null,
+ "_spec": "array-slice@^1.0.0",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/object.defaults",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/array-slice/issues"
+ },
+ "dependencies": {},
+ "description": "Array-slice method. Slices `array` from the `start` index up to, but not including, the `end` index.",
+ "devDependencies": {
+ "gulp-format-md": "^0.1.11",
+ "mocha": "^3.2.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "e73034f00dcc1f40876008fd20feae77bd4b7c2f",
+ "tarball": "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "834333ad84ed4d354532d43350a8b9cd48b5751b",
+ "homepage": "https://github.com/jonschlinkert/array-slice",
+ "keywords": [
+ "array",
+ "javascript",
+ "js",
+ "slice",
+ "util",
+ "utils"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "doowb",
+ "email": "brian.woodward@gmail.com"
+ }
+ ],
+ "name": "array-slice",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/array-slice.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "arr-flatten",
+ "array-unique",
+ "array-xor"
+ ]
+ },
+ "lint": {
+ "reflinks": true
+ }
+ },
+ "version": "1.0.0"
+}
diff --git a/node_modules/array-uniq/index.js b/node_modules/array-uniq/index.js
new file mode 100644
index 0000000..edd09f8
--- /dev/null
+++ b/node_modules/array-uniq/index.js
@@ -0,0 +1,62 @@
+'use strict';
+
+// there's 3 implementations written in increasing order of efficiency
+
+// 1 - no Set type is defined
+function uniqNoSet(arr) {
+ var ret = [];
+
+ for (var i = 0; i < arr.length; i++) {
+ if (ret.indexOf(arr[i]) === -1) {
+ ret.push(arr[i]);
+ }
+ }
+
+ return ret;
+}
+
+// 2 - a simple Set type is defined
+function uniqSet(arr) {
+ var seen = new Set();
+ return arr.filter(function (el) {
+ if (!seen.has(el)) {
+ seen.add(el);
+ return true;
+ }
+
+ return false;
+ });
+}
+
+// 3 - a standard Set type is defined and it has a forEach method
+function uniqSetWithForEach(arr) {
+ var ret = [];
+
+ (new Set(arr)).forEach(function (el) {
+ ret.push(el);
+ });
+
+ return ret;
+}
+
+// V8 currently has a broken implementation
+// https://github.com/joyent/node/issues/8449
+function doesForEachActuallyWork() {
+ var ret = false;
+
+ (new Set([true])).forEach(function (el) {
+ ret = el;
+ });
+
+ return ret === true;
+}
+
+if ('Set' in global) {
+ if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) {
+ module.exports = uniqSetWithForEach;
+ } else {
+ module.exports = uniqSet;
+ }
+} else {
+ module.exports = uniqNoSet;
+}
diff --git a/node_modules/array-uniq/license b/node_modules/array-uniq/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/array-uniq/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/array-uniq/package.json b/node_modules/array-uniq/package.json
new file mode 100644
index 0000000..2de48e0
--- /dev/null
+++ b/node_modules/array-uniq/package.json
@@ -0,0 +1,105 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "array-uniq@^1.0.2",
+ "scope": null,
+ "escapedName": "array-uniq",
+ "name": "array-uniq",
+ "rawSpec": "^1.0.2",
+ "spec": ">=1.0.2 <2.0.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/gulp-util"
+ ]
+ ],
+ "_from": "array-uniq@>=1.0.2 <2.0.0",
+ "_id": "array-uniq@1.0.3",
+ "_inCache": true,
+ "_location": "/array-uniq",
+ "_nodeVersion": "4.4.2",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/array-uniq-1.0.3.tgz_1466079716839_0.9139188586268574"
+ },
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "_npmVersion": "2.15.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "array-uniq@^1.0.2",
+ "scope": null,
+ "escapedName": "array-uniq",
+ "name": "array-uniq",
+ "rawSpec": "^1.0.2",
+ "spec": ">=1.0.2 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/gulp-util"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
+ "_shasum": "af6ac877a25cc7f74e058894753858dfdb24fdb6",
+ "_shrinkwrap": null,
+ "_spec": "array-uniq@^1.0.2",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/gulp-util",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/array-uniq/issues"
+ },
+ "dependencies": {},
+ "description": "Create an array without duplicates",
+ "devDependencies": {
+ "ava": "*",
+ "es6-set": "^0.1.0",
+ "require-uncached": "^1.0.2",
+ "xo": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "af6ac877a25cc7f74e058894753858dfdb24fdb6",
+ "tarball": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "3b5bf5a90a585b3950284d575f33d09663f6083a",
+ "homepage": "https://github.com/sindresorhus/array-uniq#readme",
+ "keywords": [
+ "array",
+ "arr",
+ "set",
+ "uniq",
+ "unique",
+ "es6",
+ "duplicate",
+ "remove"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "array-uniq",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/array-uniq.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "1.0.3"
+}
diff --git a/node_modules/array-uniq/readme.md b/node_modules/array-uniq/readme.md
new file mode 100644
index 0000000..f0bd98c
--- /dev/null
+++ b/node_modules/array-uniq/readme.md
@@ -0,0 +1,30 @@
+# array-uniq [](https://travis-ci.org/sindresorhus/array-uniq)
+
+> Create an array without duplicates
+
+It's already pretty fast, but will be much faster when [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) becomes available in V8 (especially with large arrays).
+
+
+## Install
+
+```
+$ npm install --save array-uniq
+```
+
+
+## Usage
+
+```js
+const arrayUniq = require('array-uniq');
+
+arrayUniq([1, 1, 2, 3, 3]);
+//=> [1, 2, 3]
+
+arrayUniq(['foo', 'foo', 'bar', 'foo']);
+//=> ['foo', 'bar']
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/array-unique/LICENSE b/node_modules/array-unique/LICENSE
new file mode 100755
index 0000000..fa30c4c
--- /dev/null
+++ b/node_modules/array-unique/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/array-unique/README.md b/node_modules/array-unique/README.md
new file mode 100755
index 0000000..2e28774
--- /dev/null
+++ b/node_modules/array-unique/README.md
@@ -0,0 +1,51 @@
+# array-unique [](http://badge.fury.io/js/array-unique) [](https://travis-ci.org/jonschlinkert/array-unique)
+
+> Return an array free of duplicate values. Fastest ES5 implementation.
+
+## Install with [npm](npmjs.org)
+
+```bash
+npm i array-unique --save
+```
+
+## Usage
+
+```js
+var unique = require('array-unique');
+
+unique(['a', 'b', 'c', 'c']);
+//=> ['a', 'b', 'c']
+```
+
+## Related
+* [arr-diff](https://github.com/jonschlinkert/arr-diff): Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
+* [arr-union](https://github.com/jonschlinkert/arr-union): Returns an array of unique values using strict equality for comparisons.
+* [arr-flatten](https://github.com/jonschlinkert/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten.
+* [arr-reduce](https://github.com/jonschlinkert/arr-reduce): Fast array reduce that also loops over sparse elements.
+* [arr-map](https://github.com/jonschlinkert/arr-map): Faster, node.js focused alternative to JavaScript's native array map.
+* [arr-pluck](https://github.com/jonschlinkert/arr-pluck): Retrieves the value of a specified property from all elements in the collection.
+
+## Run tests
+Install dev dependencies.
+
+```bash
+npm i -d && npm test
+```
+
+## Contributing
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-unique/issues)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+Copyright (c) 2015 Jon Schlinkert
+Released under the MIT license
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 24, 2015._
\ No newline at end of file
diff --git a/node_modules/array-unique/index.js b/node_modules/array-unique/index.js
new file mode 100755
index 0000000..7fa75af
--- /dev/null
+++ b/node_modules/array-unique/index.js
@@ -0,0 +1,28 @@
+/*!
+ * array-unique
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+module.exports = function unique(arr) {
+ if (!Array.isArray(arr)) {
+ throw new TypeError('array-unique expects an array.');
+ }
+
+ var len = arr.length;
+ var i = -1;
+
+ while (i++ < len) {
+ var j = i + 1;
+
+ for (; j < arr.length; ++j) {
+ if (arr[i] === arr[j]) {
+ arr.splice(j--, 1);
+ }
+ }
+ }
+ return arr;
+};
diff --git a/node_modules/array-unique/package.json b/node_modules/array-unique/package.json
new file mode 100755
index 0000000..7b01ef0
--- /dev/null
+++ b/node_modules/array-unique/package.json
@@ -0,0 +1,94 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "array-unique@^0.2.1",
+ "scope": null,
+ "escapedName": "array-unique",
+ "name": "array-unique",
+ "rawSpec": "^0.2.1",
+ "spec": ">=0.2.1 <0.3.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/micromatch"
+ ]
+ ],
+ "_from": "array-unique@>=0.2.1 <0.3.0",
+ "_id": "array-unique@0.2.1",
+ "_inCache": true,
+ "_location": "/array-unique",
+ "_nodeVersion": "1.6.2",
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "2.7.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "array-unique@^0.2.1",
+ "scope": null,
+ "escapedName": "array-unique",
+ "name": "array-unique",
+ "rawSpec": "^0.2.1",
+ "spec": ">=0.2.1 <0.3.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/micromatch"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
+ "_shasum": "a1d97ccafcbc2625cc70fadceb36a50c58b01a53",
+ "_shrinkwrap": null,
+ "_spec": "array-unique@^0.2.1",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/micromatch",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/array-unique/issues"
+ },
+ "dependencies": {},
+ "description": "Return an array free of duplicate values. Fastest ES5 implementation.",
+ "devDependencies": {
+ "array-uniq": "^1.0.2",
+ "benchmarked": "^0.1.3",
+ "mocha": "*",
+ "should": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "a1d97ccafcbc2625cc70fadceb36a50c58b01a53",
+ "tarball": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "36fde8e586fb7cf880b8b3aa6515df889e64ed85",
+ "homepage": "https://github.com/jonschlinkert/array-unique",
+ "license": {
+ "type": "MIT",
+ "url": "https://github.com/jonschlinkert/array-unique/blob/master/LICENSE"
+ },
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ }
+ ],
+ "name": "array-unique",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jonschlinkert/array-unique.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "0.2.1"
+}
diff --git a/node_modules/asap/CHANGES.md b/node_modules/asap/CHANGES.md
new file mode 100644
index 0000000..f105b91
--- /dev/null
+++ b/node_modules/asap/CHANGES.md
@@ -0,0 +1,70 @@
+
+## 2.0.6
+
+Version 2.0.4 adds support for React Native by clarifying in package.json that
+the browser environment does not support Node.js domains.
+Why this is necessary, we leave as an exercise for the user.
+
+## 2.0.3
+
+Version 2.0.3 fixes a bug when adjusting the capacity of the task queue.
+
+## 2.0.1-2.02
+
+Version 2.0.1 fixes a bug in the way redirects were expressed that affected the
+function of Browserify, but which Mr would tolerate.
+
+## 2.0.0
+
+Version 2 of ASAP is a full rewrite with a few salient changes.
+First, the ASAP source is CommonJS only and designed with [Browserify][] and
+[Browserify-compatible][Mr] module loaders in mind.
+
+[Browserify]: https://github.com/substack/node-browserify
+[Mr]: https://github.com/montagejs/mr
+
+The new version has been refactored in two dimensions.
+Support for Node.js and browsers have been separated, using Browserify
+redirects and ASAP has been divided into two modules.
+The "raw" layer depends on the tasks to catch thrown exceptions and unravel
+Node.js domains.
+
+The full implementation of ASAP is loadable as `require("asap")` in both Node.js
+and browsers.
+
+The raw layer that lacks exception handling overhead is loadable as
+`require("asap/raw")`.
+The interface is the same for both layers.
+
+Tasks are no longer required to be functions, but can rather be any object that
+implements `task.call()`.
+With this feature you can recycle task objects to avoid garbage collector churn
+and avoid closures in general.
+
+The implementation has been rigorously documented so that our successors can
+understand the scope of the problem that this module solves and all of its
+nuances, ensuring that the next generation of implementations know what details
+are essential.
+
+- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js)
+- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js)
+- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js)
+- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js)
+
+The new version has also been rigorously tested across a broad spectrum of
+browsers, in both the window and worker context.
+The following charts capture the browser test results for the most recent
+release.
+The first chart shows test results for ASAP running in the main window context.
+The second chart shows test results for ASAP running in a web worker context.
+Test results are inconclusive (grey) on browsers that do not support web
+workers.
+These data are captured automatically by [Continuous
+Integration][].
+
+
+
+
+
+[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
+
diff --git a/node_modules/asap/LICENSE.md b/node_modules/asap/LICENSE.md
new file mode 100644
index 0000000..ba18c61
--- /dev/null
+++ b/node_modules/asap/LICENSE.md
@@ -0,0 +1,21 @@
+
+Copyright 2009–2014 Contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
diff --git a/node_modules/asap/README.md b/node_modules/asap/README.md
new file mode 100644
index 0000000..452fd8c
--- /dev/null
+++ b/node_modules/asap/README.md
@@ -0,0 +1,237 @@
+# ASAP
+
+[](https://travis-ci.org/kriskowal/asap)
+
+Promise and asynchronous observer libraries, as well as hand-rolled callback
+programs and libraries, often need a mechanism to postpone the execution of a
+callback until the next available event.
+(See [Designing API’s for Asynchrony][Zalgo].)
+The `asap` function executes a task **as soon as possible** but not before it
+returns, waiting only for the completion of the current event and previously
+scheduled tasks.
+
+```javascript
+asap(function () {
+ // ...
+});
+```
+
+[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
+
+This CommonJS package provides an `asap` module that exports a function that
+executes a task function *as soon as possible*.
+
+ASAP strives to schedule events to occur before yielding for IO, reflow,
+or redrawing.
+Each event receives an independent stack, with only platform code in parent
+frames and the events run in the order they are scheduled.
+
+ASAP provides a fast event queue that will execute tasks until it is
+empty before yielding to the JavaScript engine's underlying event-loop.
+When a task gets added to a previously empty event queue, ASAP schedules a flush
+event, preferring for that event to occur before the JavaScript engine has an
+opportunity to perform IO tasks or rendering, thus making the first task and
+subsequent tasks semantically indistinguishable.
+ASAP uses a variety of techniques to preserve this invariant on different
+versions of browsers and Node.js.
+
+By design, ASAP prevents input events from being handled until the task
+queue is empty.
+If the process is busy enough, this may cause incoming connection requests to be
+dropped, and may cause existing connections to inform the sender to reduce the
+transmission rate or stall.
+ASAP allows this on the theory that, if there is enough work to do, there is no
+sense in looking for trouble.
+As a consequence, ASAP can interfere with smooth animation.
+If your task should be tied to the rendering loop, consider using
+`requestAnimationFrame` instead.
+A long sequence of tasks can also effect the long running script dialog.
+If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to
+break long processes into shorter intervals and periodically allow the browser
+to breathe.
+`setImmediate` will yield for IO, reflow, and repaint events.
+It also returns a handler and can be canceled.
+For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].
+
+[setImmediate]: https://github.com/YuzuJS/setImmediate
+
+Take care.
+ASAP can sustain infinite recursive calls without warning.
+It will not halt from a stack overflow, and it will not consume unbounded
+memory.
+This is behaviorally equivalent to an infinite loop.
+Just as with infinite loops, you can monitor a Node.js process for this behavior
+with a heart-beat signal.
+As with infinite loops, a very small amount of caution goes a long way to
+avoiding problems.
+
+```javascript
+function loop() {
+ asap(loop);
+}
+loop();
+```
+
+In browsers, if a task throws an exception, it will not interrupt the flushing
+of high-priority tasks.
+The exception will be postponed to a later, low-priority event to avoid
+slow-downs.
+In Node.js, if a task throws an exception, ASAP will resume flushing only if—and
+only after—the error is handled by `domain.on("error")` or
+`process.on("uncaughtException")`.
+
+## Raw ASAP
+
+Checking for exceptions comes at a cost.
+The package also provides an `asap/raw` module that exports the underlying
+implementation which is faster but stalls if a task throws an exception.
+This internal version of the ASAP function does not check for errors.
+If a task does throw an error, it will stall the event queue unless you manually
+call `rawAsap.requestFlush()` before throwing the error, or any time after.
+
+In Node.js, `asap/raw` also runs all tasks outside any domain.
+If you need a task to be bound to your domain, you will have to do it manually.
+
+```js
+if (process.domain) {
+ task = process.domain.bind(task);
+}
+rawAsap(task);
+```
+
+## Tasks
+
+A task may be any object that implements `call()`.
+A function will suffice, but closures tend not to be reusable and can cause
+garbage collector churn.
+Both `asap` and `rawAsap` accept task objects to give you the option of
+recycling task objects or using higher callable object abstractions.
+See the `asap` source for an illustration.
+
+
+## Compatibility
+
+ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.
+The following charts capture the browser test results for the most recent
+release.
+The first chart shows test results for ASAP running in the main window context.
+The second chart shows test results for ASAP running in a web worker context.
+Test results are inconclusive (grey) on browsers that do not support web
+workers.
+These data are captured automatically by [Continuous
+Integration][].
+
+[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
+
+
+
+
+
+## Caveats
+
+When a task is added to an empty event queue, it is not always possible to
+guarantee that the task queue will begin flushing immediately after the current
+event.
+However, once the task queue begins flushing, it will not yield until the queue
+is empty, even if the queue grows while executing tasks.
+
+The following browsers allow the use of [DOM mutation observers][] to access
+the HTML [microtask queue][], and thus begin flushing ASAP's task queue
+immediately at the end of the current event loop turn, before any rendering or
+IO:
+
+[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue
+[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers
+
+- Android 4–4.3
+- Chrome 26–34
+- Firefox 14–29
+- Internet Explorer 11
+- iPad Safari 6–7.1
+- iPhone Safari 7–7.1
+- Safari 6–7
+
+In the absense of mutation observers, there are a few browsers, and situations
+like web workers in some of the above browsers, where [message channels][]
+would be a useful way to avoid falling back to timers.
+Message channels give direct access to the HTML [task queue][], so the ASAP
+task queue would flush after any already queued rendering and IO tasks, but
+without having the minimum delay imposed by timers.
+However, among these browsers, Internet Explorer 10 and Safari do not reliably
+dispatch messages, so they are not worth the trouble to implement.
+
+[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels
+[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task
+
+- Internet Explorer 10
+- Safair 5.0-1
+- Opera 11-12
+
+In the absense of mutation observers, these browsers and the following browsers
+all fall back to using `setTimeout` and `setInterval` to ensure that a `flush`
+occurs.
+The implementation uses both and cancels whatever handler loses the race, since
+`setTimeout` tends to occasionally skip tasks in unisolated circumstances.
+Timers generally delay the flushing of ASAP's task queue for four milliseconds.
+
+- Firefox 3–13
+- Internet Explorer 6–10
+- iPad Safari 4.3
+- Lynx 2.8.7
+
+
+## Heritage
+
+ASAP has been factored out of the [Q][] asynchronous promise library.
+It originally had a naïve implementation in terms of `setTimeout`, but
+[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be
+useful for creating a high-priority, no-delay event dispatch hack.
+Since then, Internet Explorer proposed and implemented `setImmediate`.
+Robert Katić began contributing to Q by measuring the performance of
+the internal implementation of `asap`, paying particular attention to
+error recovery.
+Domenic, Robert, and Kris Kowal collectively settled on the current strategy of
+unrolling the high-priority event queue internally regardless of what strategy
+we used to dispatch the potentially lower-priority flush event.
+Domenic went on to make ASAP cooperate with Node.js domains.
+
+[Q]: https://github.com/kriskowal/q
+[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html
+
+For further reading, Nicholas Zakas provided a thorough article on [The
+Case for setImmediate][NCZ].
+
+[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/
+
+Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but
+further developed the implentation.
+Particularly, The `MessagePort` implementation was abandoned due to interaction
+[problems with Mobile Internet Explorer][IE Problems] in favor of an
+implementation backed on the newer and more reliable DOM `MutationObserver`
+interface.
+These changes were back-ported into this library.
+
+[IE Problems]: https://github.com/cujojs/when/issues/197
+[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
+
+In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained
+exception-safe, but `asap/raw` provided a tight kernel that could be used for
+tasks that guaranteed that they would not throw exceptions.
+This core is useful for promise implementations that capture thrown errors in
+rejected promises and do not need a second safety net.
+At the same time, the exception handling in `asap` was factored into separate
+implementations for Node.js and browsers, using the the [Browserify][Browser
+Config] `browser` property in `package.json` to instruct browser module loaders
+and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the
+browser-only implementation.
+
+[Browser Config]: https://gist.github.com/defunctzombie/4339901
+[Browserify]: https://github.com/substack/node-browserify
+[Mr]: https://github.com/montagejs/mr
+[Mop]: https://github.com/montagejs/mop
+
+## License
+
+Copyright 2009-2014 by Contributors
+MIT License (enclosed)
+
diff --git a/node_modules/asap/asap.js b/node_modules/asap/asap.js
new file mode 100644
index 0000000..f04fcd5
--- /dev/null
+++ b/node_modules/asap/asap.js
@@ -0,0 +1,65 @@
+"use strict";
+
+var rawAsap = require("./raw");
+var freeTasks = [];
+
+/**
+ * Calls a task as soon as possible after returning, in its own event, with
+ * priority over IO events. An exception thrown in a task can be handled by
+ * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
+ * crash the process. If the error is handled, all subsequent tasks will
+ * resume.
+ *
+ * @param {{call}} task A callable object, typically a function that takes no
+ * arguments.
+ */
+module.exports = asap;
+function asap(task) {
+ var rawTask;
+ if (freeTasks.length) {
+ rawTask = freeTasks.pop();
+ } else {
+ rawTask = new RawTask();
+ }
+ rawTask.task = task;
+ rawTask.domain = process.domain;
+ rawAsap(rawTask);
+}
+
+function RawTask() {
+ this.task = null;
+ this.domain = null;
+}
+
+RawTask.prototype.call = function () {
+ if (this.domain) {
+ this.domain.enter();
+ }
+ var threw = true;
+ try {
+ this.task.call();
+ threw = false;
+ // If the task throws an exception (presumably) Node.js restores the
+ // domain stack for the next event.
+ if (this.domain) {
+ this.domain.exit();
+ }
+ } finally {
+ // We use try/finally and a threw flag to avoid messing up stack traces
+ // when we catch and release errors.
+ if (threw) {
+ // In Node.js, uncaught exceptions are considered fatal errors.
+ // Re-throw them to interrupt flushing!
+ // Ensure that flushing continues if an uncaught exception is
+ // suppressed listening process.on("uncaughtException") or
+ // domain.on("error").
+ rawAsap.requestFlush();
+ }
+ // If the task threw an error, we do not want to exit the domain here.
+ // Exiting the domain would prevent the domain from catching the error.
+ this.task = null;
+ this.domain = null;
+ freeTasks.push(this);
+ }
+};
+
diff --git a/node_modules/asap/browser-asap.js b/node_modules/asap/browser-asap.js
new file mode 100644
index 0000000..805c982
--- /dev/null
+++ b/node_modules/asap/browser-asap.js
@@ -0,0 +1,66 @@
+"use strict";
+
+// rawAsap provides everything we need except exception management.
+var rawAsap = require("./raw");
+// RawTasks are recycled to reduce GC churn.
+var freeTasks = [];
+// We queue errors to ensure they are thrown in right order (FIFO).
+// Array-as-queue is good enough here, since we are just dealing with exceptions.
+var pendingErrors = [];
+var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
+
+function throwFirstError() {
+ if (pendingErrors.length) {
+ throw pendingErrors.shift();
+ }
+}
+
+/**
+ * Calls a task as soon as possible after returning, in its own event, with priority
+ * over other events like animation, reflow, and repaint. An error thrown from an
+ * event will not interrupt, nor even substantially slow down the processing of
+ * other events, but will be rather postponed to a lower priority event.
+ * @param {{call}} task A callable object, typically a function that takes no
+ * arguments.
+ */
+module.exports = asap;
+function asap(task) {
+ var rawTask;
+ if (freeTasks.length) {
+ rawTask = freeTasks.pop();
+ } else {
+ rawTask = new RawTask();
+ }
+ rawTask.task = task;
+ rawAsap(rawTask);
+}
+
+// We wrap tasks with recyclable task objects. A task object implements
+// `call`, just like a function.
+function RawTask() {
+ this.task = null;
+}
+
+// The sole purpose of wrapping the task is to catch the exception and recycle
+// the task object after its single use.
+RawTask.prototype.call = function () {
+ try {
+ this.task.call();
+ } catch (error) {
+ if (asap.onerror) {
+ // This hook exists purely for testing purposes.
+ // Its name will be periodically randomized to break any code that
+ // depends on its existence.
+ asap.onerror(error);
+ } else {
+ // In a web browser, exceptions are not fatal. However, to avoid
+ // slowing down the queue of pending tasks, we rethrow the error in a
+ // lower priority turn.
+ pendingErrors.push(error);
+ requestErrorThrow();
+ }
+ } finally {
+ this.task = null;
+ freeTasks[freeTasks.length] = this;
+ }
+};
diff --git a/node_modules/asap/browser-raw.js b/node_modules/asap/browser-raw.js
new file mode 100644
index 0000000..9cee7e3
--- /dev/null
+++ b/node_modules/asap/browser-raw.js
@@ -0,0 +1,223 @@
+"use strict";
+
+// Use the fastest means possible to execute a task in its own turn, with
+// priority over other events including IO, animation, reflow, and redraw
+// events in browsers.
+//
+// An exception thrown by a task will permanently interrupt the processing of
+// subsequent tasks. The higher level `asap` function ensures that if an
+// exception is thrown by a task, that the task queue will continue flushing as
+// soon as possible, but if you use `rawAsap` directly, you are responsible to
+// either ensure that no exceptions are thrown from your task, or to manually
+// call `rawAsap.requestFlush` if an exception is thrown.
+module.exports = rawAsap;
+function rawAsap(task) {
+ if (!queue.length) {
+ requestFlush();
+ flushing = true;
+ }
+ // Equivalent to push, but avoids a function call.
+ queue[queue.length] = task;
+}
+
+var queue = [];
+// Once a flush has been requested, no further calls to `requestFlush` are
+// necessary until the next `flush` completes.
+var flushing = false;
+// `requestFlush` is an implementation-specific method that attempts to kick
+// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
+// the event queue before yielding to the browser's own event loop.
+var requestFlush;
+// The position of the next task to execute in the task queue. This is
+// preserved between calls to `flush` so that it can be resumed if
+// a task throws an exception.
+var index = 0;
+// If a task schedules additional tasks recursively, the task queue can grow
+// unbounded. To prevent memory exhaustion, the task queue will periodically
+// truncate already-completed tasks.
+var capacity = 1024;
+
+// The flush function processes all tasks that have been scheduled with
+// `rawAsap` unless and until one of those tasks throws an exception.
+// If a task throws an exception, `flush` ensures that its state will remain
+// consistent and will resume where it left off when called again.
+// However, `flush` does not make any arrangements to be called again if an
+// exception is thrown.
+function flush() {
+ while (index < queue.length) {
+ var currentIndex = index;
+ // Advance the index before calling the task. This ensures that we will
+ // begin flushing on the next task the task throws an error.
+ index = index + 1;
+ queue[currentIndex].call();
+ // Prevent leaking memory for long chains of recursive calls to `asap`.
+ // If we call `asap` within tasks scheduled by `asap`, the queue will
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
+ // shift tasks off the queue after they have been executed.
+ // Instead, we periodically shift 1024 tasks off the queue.
+ if (index > capacity) {
+ // Manually shift all values starting at the index back to the
+ // beginning of the queue.
+ for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
+ queue[scan] = queue[scan + index];
+ }
+ queue.length -= index;
+ index = 0;
+ }
+ }
+ queue.length = 0;
+ index = 0;
+ flushing = false;
+}
+
+// `requestFlush` is implemented using a strategy based on data collected from
+// every available SauceLabs Selenium web driver worker at time of writing.
+// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
+
+// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
+// have WebKitMutationObserver but not un-prefixed MutationObserver.
+// Must use `global` or `self` instead of `window` to work in both frames and web
+// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
+
+/* globals self */
+var scope = typeof global !== "undefined" ? global : self;
+var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
+
+// MutationObservers are desirable because they have high priority and work
+// reliably everywhere they are implemented.
+// They are implemented in all modern browsers.
+//
+// - Android 4-4.3
+// - Chrome 26-34
+// - Firefox 14-29
+// - Internet Explorer 11
+// - iPad Safari 6-7.1
+// - iPhone Safari 7-7.1
+// - Safari 6-7
+if (typeof BrowserMutationObserver === "function") {
+ requestFlush = makeRequestCallFromMutationObserver(flush);
+
+// MessageChannels are desirable because they give direct access to the HTML
+// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
+// 11-12, and in web workers in many engines.
+// Although message channels yield to any queued rendering and IO tasks, they
+// would be better than imposing the 4ms delay of timers.
+// However, they do not work reliably in Internet Explorer or Safari.
+
+// Internet Explorer 10 is the only browser that has setImmediate but does
+// not have MutationObservers.
+// Although setImmediate yields to the browser's renderer, it would be
+// preferrable to falling back to setTimeout since it does not have
+// the minimum 4ms penalty.
+// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
+// Desktop to a lesser extent) that renders both setImmediate and
+// MessageChannel useless for the purposes of ASAP.
+// https://github.com/kriskowal/q/issues/396
+
+// Timers are implemented universally.
+// We fall back to timers in workers in most engines, and in foreground
+// contexts in the following browsers.
+// However, note that even this simple case requires nuances to operate in a
+// broad spectrum of browsers.
+//
+// - Firefox 3-13
+// - Internet Explorer 6-9
+// - iPad Safari 4.3
+// - Lynx 2.8.7
+} else {
+ requestFlush = makeRequestCallFromTimer(flush);
+}
+
+// `requestFlush` requests that the high priority event queue be flushed as
+// soon as possible.
+// This is useful to prevent an error thrown in a task from stalling the event
+// queue if the exception handled by Node.js’s
+// `process.on("uncaughtException")` or by a domain.
+rawAsap.requestFlush = requestFlush;
+
+// To request a high priority event, we induce a mutation observer by toggling
+// the text of a text node between "1" and "-1".
+function makeRequestCallFromMutationObserver(callback) {
+ var toggle = 1;
+ var observer = new BrowserMutationObserver(callback);
+ var node = document.createTextNode("");
+ observer.observe(node, {characterData: true});
+ return function requestCall() {
+ toggle = -toggle;
+ node.data = toggle;
+ };
+}
+
+// The message channel technique was discovered by Malte Ubl and was the
+// original foundation for this library.
+// http://www.nonblocking.io/2011/06/windownexttick.html
+
+// Safari 6.0.5 (at least) intermittently fails to create message ports on a
+// page's first load. Thankfully, this version of Safari supports
+// MutationObservers, so we don't need to fall back in that case.
+
+// function makeRequestCallFromMessageChannel(callback) {
+// var channel = new MessageChannel();
+// channel.port1.onmessage = callback;
+// return function requestCall() {
+// channel.port2.postMessage(0);
+// };
+// }
+
+// For reasons explained above, we are also unable to use `setImmediate`
+// under any circumstances.
+// Even if we were, there is another bug in Internet Explorer 10.
+// It is not sufficient to assign `setImmediate` to `requestFlush` because
+// `setImmediate` must be called *by name* and therefore must be wrapped in a
+// closure.
+// Never forget.
+
+// function makeRequestCallFromSetImmediate(callback) {
+// return function requestCall() {
+// setImmediate(callback);
+// };
+// }
+
+// Safari 6.0 has a problem where timers will get lost while the user is
+// scrolling. This problem does not impact ASAP because Safari 6.0 supports
+// mutation observers, so that implementation is used instead.
+// However, if we ever elect to use timers in Safari, the prevalent work-around
+// is to add a scroll event listener that calls for a flush.
+
+// `setTimeout` does not call the passed callback if the delay is less than
+// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
+// even then.
+
+function makeRequestCallFromTimer(callback) {
+ return function requestCall() {
+ // We dispatch a timeout with a specified delay of 0 for engines that
+ // can reliably accommodate that request. This will usually be snapped
+ // to a 4 milisecond delay, but once we're flushing, there's no delay
+ // between events.
+ var timeoutHandle = setTimeout(handleTimer, 0);
+ // However, since this timer gets frequently dropped in Firefox
+ // workers, we enlist an interval handle that will try to fire
+ // an event 20 times per second until it succeeds.
+ var intervalHandle = setInterval(handleTimer, 50);
+
+ function handleTimer() {
+ // Whichever timer succeeds will cancel both timers and
+ // execute the callback.
+ clearTimeout(timeoutHandle);
+ clearInterval(intervalHandle);
+ callback();
+ }
+ };
+}
+
+// This is for `asap.js` only.
+// Its name will be periodically randomized to break any code that depends on
+// its existence.
+rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
+
+// ASAP was originally a nextTick shim included in Q. This was factored out
+// into this ASAP package. It was later adapted to RSVP which made further
+// amendments. These decisions, particularly to marginalize MessageChannel and
+// to capture the MutationObserver implementation in a closure, were integrated
+// back into ASAP proper.
+// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
diff --git a/node_modules/asap/package.json b/node_modules/asap/package.json
new file mode 100644
index 0000000..b6f07f7
--- /dev/null
+++ b/node_modules/asap/package.json
@@ -0,0 +1,127 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "asap@~2.0.3",
+ "scope": null,
+ "escapedName": "asap",
+ "name": "asap",
+ "rawSpec": "~2.0.3",
+ "spec": ">=2.0.3 <2.1.0",
+ "type": "range"
+ },
+ "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/promise"
+ ]
+ ],
+ "_from": "asap@>=2.0.3 <2.1.0",
+ "_id": "asap@2.0.6",
+ "_inCache": true,
+ "_location": "/asap",
+ "_nodeVersion": "6.9.5",
+ "_npmOperationalInternal": {
+ "host": "s3://npm-registry-packages",
+ "tmp": "tmp/asap-2.0.6.tgz_1499700096673_0.1125483822543174"
+ },
+ "_npmUser": {
+ "name": "kriskowal",
+ "email": "kris.kowal@cixar.com"
+ },
+ "_npmVersion": "3.10.10",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "asap@~2.0.3",
+ "scope": null,
+ "escapedName": "asap",
+ "name": "asap",
+ "rawSpec": "~2.0.3",
+ "spec": ">=2.0.3 <2.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/promise"
+ ],
+ "_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
+ "_shasum": "e50347611d7e690943208bbdafebcbc2fb866d46",
+ "_shrinkwrap": null,
+ "_spec": "asap@~2.0.3",
+ "_where": "/home/stephanie/Documents/vcs/databases/assignment_okodin/node_modules/promise",
+ "browser": {
+ "./asap": "./browser-asap.js",
+ "./asap.js": "./browser-asap.js",
+ "./raw": "./browser-raw.js",
+ "./raw.js": "./browser-raw.js",
+ "./test/domain.js": "./test/browser-domain.js"
+ },
+ "bugs": {
+ "url": "https://github.com/kriskowal/asap/issues"
+ },
+ "dependencies": {},
+ "description": "High-priority task queue for Node.js and browsers",
+ "devDependencies": {
+ "benchmark": "^1.0.0",
+ "events": "^1.0.1",
+ "jshint": "^2.5.1",
+ "knox": "^0.8.10",
+ "mr": "^2.0.5",
+ "opener": "^1.3.0",
+ "q": "^2.0.3",
+ "q-io": "^2.0.3",
+ "saucelabs": "^0.1.1",
+ "wd": "^0.2.21",
+ "weak-map": "^1.0.5"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "e50347611d7e690943208bbdafebcbc2fb866d46",
+ "tarball": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz"
+ },
+ "files": [
+ "raw.js",
+ "asap.js",
+ "browser-raw.js",
+ "browser-asap.js"
+ ],
+ "gitHead": "3e3d99381444379bb0483cb9216caa39ac67bebb",
+ "homepage": "https://github.com/kriskowal/asap#readme",
+ "keywords": [
+ "event",
+ "task",
+ "queue"
+ ],
+ "license": "MIT",
+ "main": "./asap.js",
+ "maintainers": [
+ {
+ "name": "kriskowal",
+ "email": "kris.kowal@cixar.com"
+ },
+ {
+ "name": "forbeslindesay",
+ "email": "forbes@lindesay.co.uk"
+ }
+ ],
+ "name": "asap",
+ "optionalDependencies": {},
+ "react-native": {
+ "domain": false
+ },
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/kriskowal/asap.git"
+ },
+ "scripts": {
+ "benchmarks": "node benchmarks",
+ "lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)",
+ "test": "npm run lint && npm run test-node",
+ "test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener",
+ "test-node": "node test/asap-test.js",
+ "test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy",
+ "test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json",
+ "test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json",
+ "test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json",
+ "test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json",
+ "test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker"
+ },
+ "version": "2.0.6"
+}
diff --git a/node_modules/asap/raw.js b/node_modules/asap/raw.js
new file mode 100644
index 0000000..ae3b892
--- /dev/null
+++ b/node_modules/asap/raw.js
@@ -0,0 +1,101 @@
+"use strict";
+
+var domain; // The domain module is executed on demand
+var hasSetImmediate = typeof setImmediate === "function";
+
+// Use the fastest means possible to execute a task in its own turn, with
+// priority over other events including network IO events in Node.js.
+//
+// An exception thrown by a task will permanently interrupt the processing of
+// subsequent tasks. The higher level `asap` function ensures that if an
+// exception is thrown by a task, that the task queue will continue flushing as
+// soon as possible, but if you use `rawAsap` directly, you are responsible to
+// either ensure that no exceptions are thrown from your task, or to manually
+// call `rawAsap.requestFlush` if an exception is thrown.
+module.exports = rawAsap;
+function rawAsap(task) {
+ if (!queue.length) {
+ requestFlush();
+ flushing = true;
+ }
+ // Avoids a function call
+ queue[queue.length] = task;
+}
+
+var queue = [];
+// Once a flush has been requested, no further calls to `requestFlush` are
+// necessary until the next `flush` completes.
+var flushing = false;
+// The position of the next task to execute in the task queue. This is
+// preserved between calls to `flush` so that it can be resumed if
+// a task throws an exception.
+var index = 0;
+// If a task schedules additional tasks recursively, the task queue can grow
+// unbounded. To prevent memory excaustion, the task queue will periodically
+// truncate already-completed tasks.
+var capacity = 1024;
+
+// The flush function processes all tasks that have been scheduled with
+// `rawAsap` unless and until one of those tasks throws an exception.
+// If a task throws an exception, `flush` ensures that its state will remain
+// consistent and will resume where it left off when called again.
+// However, `flush` does not make any arrangements to be called again if an
+// exception is thrown.
+function flush() {
+ while (index < queue.length) {
+ var currentIndex = index;
+ // Advance the index before calling the task. This ensures that we will
+ // begin flushing on the next task the task throws an error.
+ index = index + 1;
+ queue[currentIndex].call();
+ // Prevent leaking memory for long chains of recursive calls to `asap`.
+ // If we call `asap` within tasks scheduled by `asap`, the queue will
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
+ // shift tasks off the queue after they have been executed.
+ // Instead, we periodically shift 1024 tasks off the queue.
+ if (index > capacity) {
+ // Manually shift all values starting at the index back to the
+ // beginning of the queue.
+ for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
+ queue[scan] = queue[scan + index];
+ }
+ queue.length -= index;
+ index = 0;
+ }
+ }
+ queue.length = 0;
+ index = 0;
+ flushing = false;
+}
+
+rawAsap.requestFlush = requestFlush;
+function requestFlush() {
+ // Ensure flushing is not bound to any domain.
+ // It is not sufficient to exit the domain, because domains exist on a stack.
+ // To execute code outside of any domain, the following dance is necessary.
+ var parentDomain = process.domain;
+ if (parentDomain) {
+ if (!domain) {
+ // Lazy execute the domain module.
+ // Only employed if the user elects to use domains.
+ domain = require("domain");
+ }
+ domain.active = process.domain = null;
+ }
+
+ // `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
+ // cannot handle recursion.
+ // `requestFlush` will only be called recursively from `asap.js`, to resume
+ // flushing after an error is thrown into a domain.
+ // Conveniently, `setImmediate` was introduced in the same version
+ // `process.nextTick` started throwing recursion errors.
+ if (flushing && hasSetImmediate) {
+ setImmediate(flush);
+ } else {
+ process.nextTick(flush);
+ }
+
+ if (parentDomain) {
+ domain.active = process.domain = parentDomain;
+ }
+}
diff --git a/node_modules/async/CHANGELOG.md b/node_modules/async/CHANGELOG.md
new file mode 100644
index 0000000..f15e081
--- /dev/null
+++ b/node_modules/async/CHANGELOG.md
@@ -0,0 +1,125 @@
+# v1.5.2
+- Allow using `"consructor"` as an argument in `memoize` (#998)
+- Give a better error messsage when `auto` dependency checking fails (#994)
+- Various doc updates (#936, #956, #979, #1002)
+
+# v1.5.1
+- Fix issue with `pause` in `queue` with concurrency enabled (#946)
+- `while` and `until` now pass the final result to callback (#963)
+- `auto` will properly handle concurrency when there is no callback (#966)
+- `auto` will now properly stop execution when an error occurs (#988, #993)
+- Various doc fixes (#971, #980)
+
+# v1.5.0
+
+- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
+- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873)
+- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637)
+- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891)
+- Various code simplifications (#896, #904)
+- Various doc fixes :scroll: (#890, #894, #903, #905, #912)
+
+# v1.4.2
+
+- Ensure coverage files don't get published on npm (#879)
+
+# v1.4.1
+
+- Add in overlooked `detectLimit` method (#866)
+- Removed unnecessary files from npm releases (#861)
+- Removed usage of a reserved word to prevent :boom: in older environments (#870)
+
+# v1.4.0
+
+- `asyncify` now supports promises (#840)
+- Added `Limit` versions of `filter` and `reject` (#836)
+- Add `Limit` versions of `detect`, `some` and `every` (#828, #829)
+- `some`, `every` and `detect` now short circuit early (#828, #829)
+- Improve detection of the global object (#804), enabling use in WebWorkers
+- `whilst` now called with arguments from iterator (#823)
+- `during` now gets called with arguments from iterator (#824)
+- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
+
+
+# v1.3.0
+
+New Features:
+- Added `constant`
+- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806)
+- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800)
+- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793)
+- `async` should work better in Web Workers due to better `root` detection (#804)
+- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642)
+- Various internal updates (#786, #801, #802, #803)
+- Various doc fixes (#790, #794)
+
+Bug Fixes:
+- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783)
+
+
+# v1.2.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
+
+
+# v1.2.0
+
+New Features:
+
+- Added `timesLimit` (#743)
+- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772)
+
+Bug Fixes:
+
+- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
+
+
+# v1.1.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
+
+
+# v1.1.0
+
+New Features:
+
+- `cargo` now supports all of the same methods and event callbacks as `queue`.
+- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
+- Optimized `map`, `eachOf`, and `waterfall` families of functions
+- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667).
+- The callback is now optional for the composed results of `compose` and `seq`. (#618)
+- Reduced file size by 4kb, (minified version by 1kb)
+- Added code coverage through `nyc` and `coveralls` (#768)
+
+Bug Fixes:
+
+- `forever` will no longer stack overflow with a synchronous iterator (#622)
+- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
+- Always pass `null` in callbacks when there is no error (#439)
+- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
+- `each` and family will properly handle an empty array (#578)
+- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
+- `queue` will throw if a non-function is passed to `q.push()` (#593)
+- Doc fixes (#629, #766)
+
+
+# v1.0.0
+
+No known breaking changes, we are simply complying with semver from here on out.
+
+Changes:
+
+- Start using a changelog!
+- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
+- Detect deadlocks in `auto` (#663)
+- Better support for require.js (#527)
+- Throw if queue created with concurrency `0` (#714)
+- Fix unneeded iteration in `queue.resume()` (#758)
+- Guard against timer mocking overriding `setImmediate` (#609 #611)
+- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
+- Use single noop function internally (#546)
+- Optimize internal `_each`, `_map` and `_keys` functions.
diff --git a/node_modules/async/LICENSE b/node_modules/async/LICENSE
new file mode 100644
index 0000000..8f29698
--- /dev/null
+++ b/node_modules/async/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010-2014 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/async/README.md b/node_modules/async/README.md
new file mode 100644
index 0000000..316c405
--- /dev/null
+++ b/node_modules/async/README.md
@@ -0,0 +1,1877 @@
+# Async.js
+
+[](https://travis-ci.org/caolan/async)
+[](https://www.npmjs.org/package/async)
+[](https://coveralls.io/r/caolan/async?branch=master)
+[](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+
+Async is a utility module which provides straight-forward, powerful functions
+for working with asynchronous JavaScript. Although originally designed for
+use with [Node.js](http://nodejs.org) and installable via `npm install async`,
+it can also be used directly in the browser.
+
+Async is also installable via:
+
+- [bower](http://bower.io/): `bower install async`
+- [component](https://github.com/component/component): `component install
+ caolan/async`
+- [jam](http://jamjs.org/): `jam install async`
+- [spm](http://spmjs.io/): `spm install async`
+
+Async provides around 20 functions that include the usual 'functional'
+suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns
+for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these
+functions assume you follow the Node.js convention of providing a single
+callback as the last argument of your `async` function.
+
+
+## Quick Examples
+
+```javascript
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+ // results now equals an array of the existing files
+});
+
+async.parallel([
+ function(){ ... },
+ function(){ ... }
+], callback);
+
+async.series([
+ function(){ ... },
+ function(){ ... }
+]);
+```
+
+There are many more functions available so take a look at the docs below for a
+full list. This module aims to be comprehensive, so if you feel anything is
+missing please create a GitHub issue for it.
+
+## Common Pitfalls [(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js)
+### Synchronous iteration functions
+
+If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop.
+
+This can also arise by accident if you callback early in certain cases:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ callback(null, cache[item]); // if many items are cached, you'll overflow
+ } else {
+ doSomeIO(item, callback);
+ }
+}, function done() {
+ //...
+});
+```
+
+Just change it to:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ async.setImmediate(function () {
+ callback(null, cache[item]);
+ });
+ } else {
+ doSomeIO(item, callback);
+ //...
+```
+
+Async guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.
+
+If JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.
+
+
+### Multiple callbacks
+
+Make sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases.
+
+```js
+async.waterfall([
+ function (callback) {
+ getSomething(options, function (err, result) {
+ if (err) {
+ callback(new Error("failed getting something:" + err.message));
+ // we should return here
+ }
+ // since we did not return, this callback still will be called and
+ // `processData` will be called twice
+ callback(null, result);
+ });
+ },
+ processData
+], done)
+```
+
+It is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function.
+
+
+### Binding a context to an iterator
+
+This section is really about `bind`, not about `async`. If you are wondering how to
+make `async` execute your iterators in a given context, or are confused as to why
+a method of another library isn't working as an iterator, study this example:
+
+```js
+// Here is a simple object with an (unnecessarily roundabout) squaring method
+var AsyncSquaringLibrary = {
+ squareExponent: 2,
+ square: function(number, callback){
+ var result = Math.pow(number, this.squareExponent);
+ setTimeout(function(){
+ callback(null, result);
+ }, 200);
+ }
+};
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
+ // result is [NaN, NaN, NaN]
+ // This fails because the `this.squareExponent` expression in the square
+ // function is not evaluated in the context of AsyncSquaringLibrary, and is
+ // therefore undefined.
+});
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
+ // result is [1, 4, 9]
+ // With the help of bind we can attach a context to the iterator before
+ // passing it to async. Now the square function will be executed in its
+ // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
+ // will be as expected.
+});
+```
+
+## Download
+
+The source is available for download from
+[GitHub](https://github.com/caolan/async/blob/master/lib/async.js).
+Alternatively, you can install using Node Package Manager (`npm`):
+
+ npm install async
+
+As well as using Bower:
+
+ bower install async
+
+__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
+
+## In the Browser
+
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
+
+Usage:
+
+```html
+
+
+```
+
+## Documentation
+
+Some functions are also available in the following forms:
+* `Series` - the same as `` but runs only a single async operation at a time
+* `Limit` - the same as `` but runs a maximum of `limit` async operations at a time
+
+### Collections
+
+* [`each`](#each), `eachSeries`, `eachLimit`
+* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`
+* [`map`](#map), `mapSeries`, `mapLimit`
+* [`filter`](#filter), `filterSeries`, `filterLimit`
+* [`reject`](#reject), `rejectSeries`, `rejectLimit`
+* [`reduce`](#reduce), [`reduceRight`](#reduceRight)
+* [`detect`](#detect), `detectSeries`, `detectLimit`
+* [`sortBy`](#sortBy)
+* [`some`](#some), `someLimit`
+* [`every`](#every), `everyLimit`
+* [`concat`](#concat), `concatSeries`
+
+### Control Flow
+
+* [`series`](#seriestasks-callback)
+* [`parallel`](#parallel), `parallelLimit`
+* [`whilst`](#whilst), [`doWhilst`](#doWhilst)
+* [`until`](#until), [`doUntil`](#doUntil)
+* [`during`](#during), [`doDuring`](#doDuring)
+* [`forever`](#forever)
+* [`waterfall`](#waterfall)
+* [`compose`](#compose)
+* [`seq`](#seq)
+* [`applyEach`](#applyEach), `applyEachSeries`
+* [`queue`](#queue), [`priorityQueue`](#priorityQueue)
+* [`cargo`](#cargo)
+* [`auto`](#auto)
+* [`retry`](#retry)
+* [`iterator`](#iterator)
+* [`times`](#times), `timesSeries`, `timesLimit`
+
+### Utils
+
+* [`apply`](#apply)
+* [`nextTick`](#nextTick)
+* [`memoize`](#memoize)
+* [`unmemoize`](#unmemoize)
+* [`ensureAsync`](#ensureAsync)
+* [`constant`](#constant)
+* [`asyncify`](#asyncify)
+* [`wrapSync`](#wrapSync)
+* [`log`](#log)
+* [`dir`](#dir)
+* [`noConflict`](#noConflict)
+
+## Collections
+
+
+
+### each(arr, iterator, [callback])
+
+Applies the function `iterator` to each item in `arr`, in parallel.
+The `iterator` is called with an item from the list, and a callback for when it
+has finished. If the `iterator` passes an error to its `callback`, the main
+`callback` (for the `each` function) is immediately called with the error.
+
+Note, that since this function applies `iterator` to each item in parallel,
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err)` which must be called once it has
+ completed. If no error has occurred, the `callback` should be run without
+ arguments or with an explicit `null` argument. The array index is not passed
+ to the iterator. If you need the index, use [`forEachOf`](#forEachOf).
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions
+ have finished, or an error occurs.
+
+__Examples__
+
+
+```js
+// assuming openFiles is an array of file names and saveFile is a function
+// to save the modified contents of that file:
+
+async.each(openFiles, saveFile, function(err){
+ // if any of the saves produced an error, err would equal that error
+});
+```
+
+```js
+// assuming openFiles is an array of file names
+
+async.each(openFiles, function(file, callback) {
+
+ // Perform operation on file here.
+ console.log('Processing file ' + file);
+
+ if( file.length > 32 ) {
+ console.log('This file name is too long');
+ callback('File name too long');
+ } else {
+ // Do work to process file here
+ console.log('File processed');
+ callback();
+ }
+}, function(err){
+ // if any of the file processing produced an error, err would equal that error
+ if( err ) {
+ // One of the iterations produced an error.
+ // All processing will now stop.
+ console.log('A file failed to process');
+ } else {
+ console.log('All files have been processed successfully');
+ }
+});
+```
+
+__Related__
+
+* eachSeries(arr, iterator, [callback])
+* eachLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+
+
+### forEachOf(obj, iterator, [callback])
+
+Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.
+
+__Arguments__
+
+* `obj` - An object or array to iterate over.
+* `iterator(item, key, callback)` - A function to apply to each item in `obj`.
+The `key` is the item's key, or index in the case of an array. The iterator is
+passed a `callback(err)` which must be called once it has completed. If no
+error has occurred, the callback should be run without arguments or with an
+explicit `null` argument.
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.
+
+__Example__
+
+```js
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, function (value, key, callback) {
+ fs.readFile(__dirname + value, "utf8", function (err, data) {
+ if (err) return callback(err);
+ try {
+ configs[key] = JSON.parse(data);
+ } catch (e) {
+ return callback(e);
+ }
+ callback();
+ })
+}, function (err) {
+ if (err) console.error(err.message);
+ // configs is now a map of JSON data
+ doSomethingWith(configs);
+})
+```
+
+__Related__
+
+* forEachOfSeries(obj, iterator, [callback])
+* forEachOfLimit(obj, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### map(arr, iterator, [callback])
+
+Produces a new array of values by mapping each value in `arr` through
+the `iterator` function. The `iterator` is called with an item from `arr` and a
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to its
+callback, the main `callback` (for the `map` function) is immediately called with the error.
+
+Note, that since this function applies the `iterator` to each item in parallel,
+there is no guarantee that the `iterator` functions will complete in order.
+However, the results array will be in the same order as the original `arr`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, transformed)` which must be called once
+ it has completed with an error (which can be `null`) and a transformed item.
+* `callback(err, results)` - *Optional* A callback which is called when all `iterator`
+ functions have finished, or an error occurs. Results is an array of the
+ transformed items from the `arr`.
+
+__Example__
+
+```js
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+```
+
+__Related__
+* mapSeries(arr, iterator, [callback])
+* mapLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+
+### filter(arr, iterator, [callback])
+
+__Alias:__ `select`
+
+Returns a new array of all the values in `arr` which pass an async truth test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. This operation is
+performed in parallel, but the results array will be in the same order as the
+original.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
+ boolean argument once it has completed.
+* `callback(results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished.
+
+__Example__
+
+```js
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+ // results now equals an array of the existing files
+});
+```
+
+__Related__
+
+* filterSeries(arr, iterator, [callback])
+* filterLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### reject(arr, iterator, [callback])
+
+The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
+
+__Related__
+
+* rejectSeries(arr, iterator, [callback])
+* rejectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### reduce(arr, memo, iterator, [callback])
+
+__Aliases:__ `inject`, `foldl`
+
+Reduces `arr` into a single value using an async `iterator` to return
+each successive step. `memo` is the initial state of the reduction.
+This function only operates in series.
+
+For performance reasons, it may make sense to split a call to this function into
+a parallel map, and then use the normal `Array.prototype.reduce` on the results.
+This function is for situations where each step in the reduction needs to be async;
+if you can get the data before reducing it, then it's probably a good idea to do so.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `memo` - The initial state of the reduction.
+* `iterator(memo, item, callback)` - A function applied to each item in the
+ array to produce the next step in the reduction. The `iterator` is passed a
+ `callback(err, reduction)` which accepts an optional error as its first
+ argument, and the state of the reduction as the second. If an error is
+ passed to the callback, the reduction is stopped and the main `callback` is
+ immediately called with the error.
+* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished. Result is the reduced value.
+
+__Example__
+
+```js
+async.reduce([1,2,3], 0, function(memo, item, callback){
+ // pointless async:
+ process.nextTick(function(){
+ callback(null, memo + item)
+ });
+}, function(err, result){
+ // result is now equal to the last value of memo, which is 6
+});
+```
+
+---------------------------------------
+
+
+### reduceRight(arr, memo, iterator, [callback])
+
+__Alias:__ `foldr`
+
+Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
+
+
+---------------------------------------
+
+
+### detect(arr, iterator, [callback])
+
+Returns the first value in `arr` that passes an async truth test. The
+`iterator` is applied in parallel, meaning the first iterator to return `true` will
+fire the detect `callback` with that result. That means the result might not be
+the first item in the original `arr` (in terms of order) that passes the test.
+
+If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The iterator is passed a `callback(truthValue)` which must be called with a
+ boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `true`, or after all the `iterator` functions have finished. Result will be
+ the first item in the array that passes the truth test (iterator) or the
+ value `undefined` if none passed. **Note: this callback does not take an error as its first argument.**
+
+__Example__
+
+```js
+async.detect(['file1','file2','file3'], fs.exists, function(result){
+ // result now equals the first file in the list that exists
+});
+```
+
+__Related__
+
+* detectSeries(arr, iterator, [callback])
+* detectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### sortBy(arr, iterator, [callback])
+
+Sorts a list by the results of running each `arr` value through an async `iterator`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, sortValue)` which must be called once it
+ has completed with an error (which can be `null`) and a value to use as the sort
+ criteria.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is the items from
+ the original `arr` sorted by the values returned by the `iterator` calls.
+
+__Example__
+
+```js
+async.sortBy(['file1','file2','file3'], function(file, callback){
+ fs.stat(file, function(err, stats){
+ callback(err, stats.mtime);
+ });
+}, function(err, results){
+ // results is now the original array of files sorted by
+ // modified date
+});
+```
+
+__Sort Order__
+
+By modifying the callback parameter the sorting order can be influenced:
+
+```js
+//ascending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x);
+}, function(err,result){
+ //result callback
+} );
+
+//descending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x*-1); //<- x*-1 instead of x, turns the order around
+}, function(err,result){
+ //result callback
+} );
+```
+
+---------------------------------------
+
+
+### some(arr, iterator, [callback])
+
+__Alias:__ `any`
+
+Returns `true` if at least one element in the `arr` satisfies an async test.
+_The callback for each iterator call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. Once any iterator
+call returns `true`, the main `callback` is immediately called.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a `callback(truthValue)`` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `true`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+__Example__
+
+```js
+async.some(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then at least one of the files exists
+});
+```
+
+__Related__
+
+* someLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+
+### every(arr, iterator, [callback])
+
+__Alias:__ `all`
+
+Returns `true` if every element in `arr` satisfies an async test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a `callback(truthValue)` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `false`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+
+__Example__
+
+```js
+async.every(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then every file exists
+});
+```
+
+__Related__
+
+* everyLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+
+### concat(arr, iterator, [callback])
+
+Applies `iterator` to each item in `arr`, concatenating the results. Returns the
+concatenated list. The `iterator`s are called in parallel, and the results are
+concatenated as they return. There is no guarantee that the results array will
+be returned in the original order of `arr` passed to the `iterator` function.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, results)` which must be called once it
+ has completed with an error (which can be `null`) and an array of results.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is an array containing
+ the concatenated results of the `iterator` function.
+
+__Example__
+
+```js
+async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
+ // files is now a list of filenames that exist in the 3 directories
+});
+```
+
+__Related__
+
+* concatSeries(arr, iterator, [callback])
+
+
+## Control Flow
+
+
+### series(tasks, [callback])
+
+Run the functions in the `tasks` array in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its
+callback, no more functions are run, and `callback` is immediately called with the value of the error.
+Otherwise, `callback` receives an array of results when `tasks` have completed.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function, and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`series`](#series).
+
+**Note** that while many implementations preserve the order of object properties, the
+[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+explicitly states that
+
+> The mechanics and order of enumerating the properties is not specified.
+
+So if you rely on the order in which your series of functions are executed, and want
+this to work on all platforms, consider using an array.
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run, each function is passed
+ a `callback(err, result)` it must call on completion with an error `err` (which can
+ be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+ have completed. This function gets a results array (or object) containing all
+ the result arguments passed to the `task` callbacks.
+
+__Example__
+
+```js
+async.series([
+ function(callback){
+ // do some stuff ...
+ callback(null, 'one');
+ },
+ function(callback){
+ // do some more stuff ...
+ callback(null, 'two');
+ }
+],
+// optional callback
+function(err, results){
+ // results is now equal to ['one', 'two']
+});
+
+
+// an example using an object instead of an array
+async.series({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equal to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+
+### parallel(tasks, [callback])
+
+Run the `tasks` array of functions in parallel, without waiting until the previous
+function has completed. If any of the functions pass an error to its
+callback, the main `callback` is immediately called with the value of the error.
+Once the `tasks` have completed, the results are passed to the final `callback` as an
+array.
+
+**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`parallel`](#parallel).
+
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run. Each function is passed
+ a `callback(err, result)` which it must call on completion with an error `err`
+ (which can be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+ have completed successfully. This function gets a results array (or object) containing all
+ the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.parallel([
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'one');
+ }, 200);
+ },
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'two');
+ }, 100);
+ }
+],
+// optional callback
+function(err, results){
+ // the results array will equal ['one','two'] even though
+ // the second function had a shorter timeout.
+});
+
+
+// an example using an object instead of an array
+async.parallel({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equals to: {one: 1, two: 2}
+});
+```
+
+__Related__
+
+* parallelLimit(tasks, limit, [callback])
+
+---------------------------------------
+
+
+### whilst(test, fn, callback)
+
+Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
+or an error occurs.
+
+__Arguments__
+
+* `test()` - synchronous truth test to perform before each execution of `fn`.
+* `fn(callback)` - A function which is called each time `test` passes. The function is
+ passed a `callback(err)`, which must be called once it has completed with an
+ optional `err` argument.
+* `callback(err, [results])` - A callback which is called after the test
+ function has failed and repeated execution of `fn` has stopped. `callback`
+ will be passed an error and any arguments passed to the final `fn`'s callback.
+
+__Example__
+
+```js
+var count = 0;
+
+async.whilst(
+ function () { return count < 5; },
+ function (callback) {
+ count++;
+ setTimeout(function () {
+ callback(null, count);
+ }, 1000);
+ },
+ function (err, n) {
+ // 5 seconds have passed, n = 5
+ }
+);
+```
+
+---------------------------------------
+
+
+### doWhilst(fn, test, callback)
+
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+
+---------------------------------------
+
+
+### until(test, fn, callback)
+
+Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
+or an error occurs. `callback` will be passed an error and any arguments passed
+to the final `fn`'s callback.
+
+The inverse of [`whilst`](#whilst).
+
+---------------------------------------
+
+
+### doUntil(fn, test, callback)
+
+Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
+
+---------------------------------------
+
+
+### during(test, fn, callback)
+
+Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.
+
+__Example__
+
+```js
+var count = 0;
+
+async.during(
+ function (callback) {
+ return callback(null, count < 5);
+ },
+ function (callback) {
+ count++;
+ setTimeout(callback, 1000);
+ },
+ function (err) {
+ // 5 seconds have passed
+ }
+);
+```
+
+---------------------------------------
+
+
+### doDuring(fn, test, callback)
+
+The post-check version of [`during`](#during). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.
+
+---------------------------------------
+
+
+### forever(fn, [errback])
+
+Calls the asynchronous function `fn` with a callback parameter that allows it to
+call itself again, in series, indefinitely.
+
+If an error is passed to the callback then `errback` is called with the
+error, and execution stops, otherwise it will never be called.
+
+```js
+async.forever(
+ function(next) {
+ // next is suitable for passing to things that need a callback(err [, whatever]);
+ // it will result in this function being called again.
+ },
+ function(err) {
+ // if next is called with a value in its first parameter, it will appear
+ // in here as 'err', and execution will stop.
+ }
+);
+```
+
+---------------------------------------
+
+
+### waterfall(tasks, [callback])
+
+Runs the `tasks` array of functions in series, each passing their results to the next in
+the array. However, if any of the `tasks` pass an error to their own callback, the
+next function is not executed, and the main `callback` is immediately called with
+the error.
+
+__Arguments__
+
+* `tasks` - An array of functions to run, each function is passed a
+ `callback(err, result1, result2, ...)` it must call on completion. The first
+ argument is an error (which can be `null`) and any further arguments will be
+ passed as arguments in order to the next task.
+* `callback(err, [results])` - An optional callback to run once all the functions
+ have completed. This will be passed the results of the last task's callback.
+
+
+
+__Example__
+
+```js
+async.waterfall([
+ function(callback) {
+ callback(null, 'one', 'two');
+ },
+ function(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+ },
+ function(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+ }
+], function (err, result) {
+ // result now equals 'done'
+});
+```
+Or, with named functions:
+
+```js
+async.waterfall([
+ myFirstFunction,
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(callback) {
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+Or, if you need to pass any argument to the first function:
+
+```js
+async.waterfall([
+ async.apply(myFirstFunction, 'zero'),
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(arg1, callback) {
+ // arg1 now equals 'zero'
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+---------------------------------------
+
+### compose(fn1, fn2...)
+
+Creates a function which is a composition of the passed asynchronous
+functions. Each function consumes the return value of the function that
+follows. Composing functions `f()`, `g()`, and `h()` would produce the result of
+`f(g(h()))`, only this version uses callbacks to obtain the return values.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+function add1(n, callback) {
+ setTimeout(function () {
+ callback(null, n + 1);
+ }, 10);
+}
+
+function mul3(n, callback) {
+ setTimeout(function () {
+ callback(null, n * 3);
+ }, 10);
+}
+
+var add1mul3 = async.compose(mul3, add1);
+
+add1mul3(4, function (err, result) {
+ // result now equals 15
+});
+```
+
+---------------------------------------
+
+### seq(fn1, fn2...)
+
+Version of the compose function that is more natural to read.
+Each function consumes the return value of the previous function.
+It is the equivalent of [`compose`](#compose) with the arguments reversed.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+// Requires lodash (or underscore), express3 and dresende's orm2.
+// Part of an app, that fetches cats of the logged user.
+// This example uses `seq` function to avoid overnesting and error
+// handling clutter.
+app.get('/cats', function(request, response) {
+ var User = request.models.User;
+ async.seq(
+ _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
+ function(user, fn) {
+ user.getCats(fn); // 'getCats' has signature (callback(err, data))
+ }
+ )(req.session.user_id, function (err, cats) {
+ if (err) {
+ console.error(err);
+ response.json({ status: 'error', message: err.message });
+ } else {
+ response.json({ status: 'ok', message: 'Cats found', data: cats });
+ }
+ });
+});
+```
+
+---------------------------------------
+
+### applyEach(fns, args..., callback)
+
+Applies the provided arguments to each function in the array, calling
+`callback` after all functions have completed. If you only provide the first
+argument, then it will return a function which lets you pass in the
+arguments as if it were a single function call.
+
+__Arguments__
+
+* `fns` - the asynchronous functions to all call with the same arguments
+* `args...` - any number of separate arguments to pass to the function
+* `callback` - the final argument should be the callback, called when all
+ functions have completed processing
+
+
+__Example__
+
+```js
+async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+
+// partial application example:
+async.each(
+ buckets,
+ async.applyEach([enableSearch, updateSchema]),
+ callback
+);
+```
+
+__Related__
+
+* applyEachSeries(tasks, args..., [callback])
+
+---------------------------------------
+
+
+### queue(worker, [concurrency])
+
+Creates a `queue` object with the specified `concurrency`. Tasks added to the
+`queue` are processed in parallel (up to the `concurrency` limit). If all
+`worker`s are in progress, the task is queued until one becomes available.
+Once a `worker` completes a `task`, that `task`'s callback is called.
+
+__Arguments__
+
+* `worker(task, callback)` - An asynchronous function for processing a queued
+ task, which must call its `callback(err)` argument when finished, with an
+ optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`.
+* `concurrency` - An `integer` for determining how many `worker` functions should be
+ run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.
+
+__Queue objects__
+
+The `queue` object returned by this function has the following properties and
+methods:
+
+* `length()` - a function returning the number of items waiting to be processed.
+* `started` - a function returning whether or not any items have been pushed and processed by the queue
+* `running()` - a function returning the number of items currently being processed.
+* `workersList()` - a function returning the array of items currently being processed.
+* `idle()` - a function returning false if there are items waiting or being processed, or true if not.
+* `concurrency` - an integer for determining how many `worker` functions should be
+ run in parallel. This property can be changed after a `queue` is created to
+ alter the concurrency on-the-fly.
+* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
+ the `worker` has finished processing the task. Instead of a single task, a `tasks` array
+ can be submitted. The respective callback is used for every task in the list.
+* `unshift(task, [callback])` - add a new task to the front of the `queue`.
+* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
+ and further tasks will be queued.
+* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
+* `paused` - a boolean for determining whether the queue is in a paused state
+* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
+* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
+* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.
+
+__Example__
+
+```js
+// create a queue object with concurrency 2
+
+var q = async.queue(function (task, callback) {
+ console.log('hello ' + task.name);
+ callback();
+}, 2);
+
+
+// assign a callback
+q.drain = function() {
+ console.log('all items have been processed');
+}
+
+// add some items to the queue
+
+q.push({name: 'foo'}, function (err) {
+ console.log('finished processing foo');
+});
+q.push({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+
+// add some items to the queue (batch-wise)
+
+q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
+ console.log('finished processing item');
+});
+
+// add some items to the front of the queue
+
+q.unshift({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+```
+
+
+---------------------------------------
+
+
+### priorityQueue(worker, concurrency)
+
+The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
+
+* `push(task, priority, [callback])` - `priority` should be a number. If an array of
+ `tasks` is given, all tasks will be assigned the same priority.
+* The `unshift` method was removed.
+
+---------------------------------------
+
+
+### cargo(worker, [payload])
+
+Creates a `cargo` object with the specified payload. Tasks added to the
+cargo will be processed altogether (up to the `payload` limit). If the
+`worker` is in progress, the task is queued until it becomes available. Once
+the `worker` has completed some tasks, each callback of those tasks is called.
+Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.
+
+While [queue](#queue) passes only one task to one of a group of workers
+at a time, cargo passes an array of tasks to a single worker, repeating
+when the worker is finished.
+
+__Arguments__
+
+* `worker(tasks, callback)` - An asynchronous function for processing an array of
+ queued tasks, which must call its `callback(err)` argument when finished, with
+ an optional `err` argument.
+* `payload` - An optional `integer` for determining how many tasks should be
+ processed per round; if omitted, the default is unlimited.
+
+__Cargo objects__
+
+The `cargo` object returned by this function has the following properties and
+methods:
+
+* `length()` - A function returning the number of items waiting to be processed.
+* `payload` - An `integer` for determining how many tasks should be
+ process per round. This property can be changed after a `cargo` is created to
+ alter the payload on-the-fly.
+* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
+ once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
+ can be submitted. The respective callback is used for every task in the list.
+* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
+* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
+* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)
+
+__Example__
+
+```js
+// create a cargo object with payload 2
+
+var cargo = async.cargo(function (tasks, callback) {
+ for(var i=0; i
+### auto(tasks, [concurrency], [callback])
+
+Determines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.
+
+If any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far.
+
+Note, all functions are called with a `results` object as a second argument,
+so it is unsafe to pass functions in the `tasks` object which cannot handle the
+extra argument.
+
+For example, this snippet of code:
+
+```js
+async.auto({
+ readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
+}, callback);
+```
+
+will have the effect of calling `readFile` with the results object as the last
+argument, which will fail:
+
+```js
+fs.readFile('data.txt', 'utf-8', cb, {});
+```
+
+Instead, wrap the call to `readFile` in a function which does not forward the
+`results` object:
+
+```js
+async.auto({
+ readData: function(cb, results){
+ fs.readFile('data.txt', 'utf-8', cb);
+ }
+}, callback);
+```
+
+__Arguments__
+
+* `tasks` - An object. Each of its properties is either a function or an array of
+ requirements, with the function itself the last item in the array. The object's key
+ of a property serves as the name of the task defined by that property,
+ i.e. can be used when specifying requirements for other tasks.
+ The function receives two arguments: (1) a `callback(err, result)` which must be
+ called when finished, passing an `error` (which can be `null`) and the result of
+ the function's execution, and (2) a `results` object, containing the results of
+ the previously executed functions.
+* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.
+* `callback(err, results)` - An optional callback which is called when all the
+ tasks have been completed. It receives the `err` argument if any `tasks`
+ pass an error to their callback. Results are always returned; however, if
+ an error occurs, no further `tasks` will be performed, and the results
+ object will only contain partial results.
+
+
+__Example__
+
+```js
+async.auto({
+ get_data: function(callback){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ make_folder: function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ },
+ write_file: ['get_data', 'make_folder', function(callback, results){
+ console.log('in write_file', JSON.stringify(results));
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ callback(null, 'filename');
+ }],
+ email_link: ['write_file', function(callback, results){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ // results.write_file contains the filename returned by write_file.
+ callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ }]
+}, function(err, results) {
+ console.log('err = ', err);
+ console.log('results = ', results);
+});
+```
+
+This is a fairly trivial example, but to do this using the basic parallel and
+series functions would look like this:
+
+```js
+async.parallel([
+ function(callback){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ }
+],
+function(err, results){
+ async.series([
+ function(callback){
+ console.log('in write_file', JSON.stringify(results));
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ results.push('filename');
+ callback(null);
+ },
+ function(callback){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ callback(null, {'file':results.pop(), 'email':'user@example.com'});
+ }
+ ]);
+});
+```
+
+For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
+new tasks much easier (and the code more readable).
+
+
+---------------------------------------
+
+
+### retry([opts = {times: 5, interval: 0}| 5], task, [callback])
+
+Attempts to get a successful response from `task` no more than `times` times before
+returning an error. If the task is successful, the `callback` will be passed the result
+of the successful task. If all attempts fail, the callback will be passed the error and
+result (if any) of the final attempt.
+
+__Arguments__
+
+* `opts` - Can be either an object with `times` and `interval` or a number.
+ * `times` - The number of attempts to make before giving up. The default is `5`.
+ * `interval` - The time to wait between retries, in milliseconds. The default is `0`.
+ * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`.
+* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
+ which must be called when finished, passing `err` (which can be `null`) and the `result` of
+ the function's execution, and (2) a `results` object, containing the results of
+ the previously executed functions (if nested inside another control flow).
+* `callback(err, results)` - An optional callback which is called when the
+ task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
+
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:
+
+```js
+// try calling apiMethod 3 times
+async.retry(3, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+```js
+// try calling apiMethod 3 times, waiting 200 ms between each retry
+async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+```js
+// try calling apiMethod the default 5 times no delay between each retry
+async.retry(apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+It can also be embedded within other control flow functions to retry individual methods
+that are not as reliable, like this:
+
+```js
+async.auto({
+ users: api.getUsers.bind(api),
+ payments: async.retry(3, api.getPayments.bind(api))
+}, function(err, results) {
+ // do something with the results
+});
+```
+
+
+---------------------------------------
+
+
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the `tasks` array,
+returning a continuation to call the next one after that. It's also possible to
+“peek” at the next iterator with `iterator.next()`.
+
+This function is used internally by the `async` module, but can be useful when
+you want to manually control the flow of functions in series.
+
+__Arguments__
+
+* `tasks` - An array of functions to run.
+
+__Example__
+
+```js
+var iterator = async.iterator([
+ function(){ sys.p('one'); },
+ function(){ sys.p('two'); },
+ function(){ sys.p('three'); }
+]);
+
+node> var iterator2 = iterator();
+'one'
+node> var iterator3 = iterator2();
+'two'
+node> iterator3();
+'three'
+node> var nextfn = iterator2.next();
+node> nextfn();
+'three'
+```
+
+---------------------------------------
+
+
+### apply(function, arguments..)
+
+Creates a continuation function with some arguments already applied.
+
+Useful as a shorthand when combined with other control flow functions. Any arguments
+passed to the returned function are added to the arguments originally passed
+to apply.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to automatically apply when the
+ continuation is called.
+
+__Example__
+
+```js
+// using apply
+
+async.parallel([
+ async.apply(fs.writeFile, 'testfile1', 'test1'),
+ async.apply(fs.writeFile, 'testfile2', 'test2'),
+]);
+
+
+// the same process without using apply
+
+async.parallel([
+ function(callback){
+ fs.writeFile('testfile1', 'test1', callback);
+ },
+ function(callback){
+ fs.writeFile('testfile2', 'test2', callback);
+ }
+]);
+```
+
+It's possible to pass any number of additional arguments when calling the
+continuation:
+
+```js
+node> var fn = async.apply(sys.puts, 'one');
+node> fn('two', 'three');
+one
+two
+three
+```
+
+---------------------------------------
+
+
+### nextTick(callback), setImmediate(callback)
+
+Calls `callback` on a later loop around the event loop. In Node.js this just
+calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
+if available, otherwise `setTimeout(callback, 0)`, which means other higher priority
+events may precede the execution of `callback`.
+
+This is used internally for browser-compatibility purposes.
+
+__Arguments__
+
+* `callback` - The function to call on a later loop around the event loop.
+
+__Example__
+
+```js
+var call_order = [];
+async.nextTick(function(){
+ call_order.push('two');
+ // call_order now equals ['one','two']
+});
+call_order.push('one')
+```
+
+
+### times(n, iterator, [callback])
+
+Calls the `iterator` function `n` times, and accumulates results in the same manner
+you would use with [`map`](#map).
+
+__Arguments__
+
+* `n` - The number of times to run the function.
+* `iterator` - The function to call `n` times.
+* `callback` - see [`map`](#map)
+
+__Example__
+
+```js
+// Pretend this is some complicated async factory
+var createUser = function(id, callback) {
+ callback(null, {
+ id: 'user' + id
+ })
+}
+// generate 5 users
+async.times(5, function(n, next){
+ createUser(n, function(err, user) {
+ next(err, user)
+ })
+}, function(err, users) {
+ // we should now have 5 users
+});
+```
+
+__Related__
+
+* timesSeries(n, iterator, [callback])
+* timesLimit(n, limit, iterator, [callback])
+
+
+## Utils
+
+
+### memoize(fn, [hasher])
+
+Caches the results of an `async` function. When creating a hash to store function
+results against, the callback is omitted from the hash and an optional hash
+function can be used.
+
+If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
+
+The cache of results is exposed as the `memo` property of the function returned
+by `memoize`.
+
+__Arguments__
+
+* `fn` - The function to proxy and cache results from.
+* `hasher` - An optional function for generating a custom hash for storing
+ results. It has all the arguments applied to it apart from the callback, and
+ must be synchronous.
+
+__Example__
+
+```js
+var slow_fn = function (name, callback) {
+ // do something
+ callback(null, result);
+};
+var fn = async.memoize(slow_fn);
+
+// fn can now be used as if it were slow_fn
+fn('some name', function () {
+ // callback
+});
+```
+
+
+### unmemoize(fn)
+
+Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized
+form. Handy for testing.
+
+__Arguments__
+
+* `fn` - the memoized function
+
+---------------------------------------
+
+
+### ensureAsync(fn)
+
+Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.
+
+__Arguments__
+
+* `fn` - an async function, one that expects a node-style callback as its last argument
+
+Returns a wrapped function with the exact same call signature as the function passed in.
+
+__Example__
+
+```js
+function sometimesAsync(arg, callback) {
+ if (cache[arg]) {
+ return callback(null, cache[arg]); // this would be synchronous!!
+ } else {
+ doSomeIO(arg, callback); // this IO would be asynchronous
+ }
+}
+
+// this has a risk of stack overflows if many results are cached in a row
+async.mapSeries(args, sometimesAsync, done);
+
+// this will defer sometimesAsync's callback if necessary,
+// preventing stack overflows
+async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+
+```
+
+---------------------------------------
+
+
+### constant(values...)
+
+Returns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`.
+
+__Example__
+
+```js
+async.waterfall([
+ async.constant(42),
+ function (value, next) {
+ // value === 42
+ },
+ //...
+], callback);
+
+async.waterfall([
+ async.constant(filename, "utf8"),
+ fs.readFile,
+ function (fileData, next) {
+ //...
+ }
+ //...
+], callback);
+
+async.auto({
+ hostname: async.constant("https://server.net/"),
+ port: findFreePort,
+ launchServer: ["hostname", "port", function (cb, options) {
+ startServer(options, cb);
+ }],
+ //...
+}, callback);
+
+```
+
+---------------------------------------
+
+
+
+### asyncify(func)
+
+__Alias:__ `wrapSync`
+
+Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.
+
+__Example__
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(JSON.parse),
+ function (data, next) {
+ // data is the result of parsing the text.
+ // If there was a parsing error, it would have been caught.
+ }
+], callback)
+```
+
+If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example:
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(function (contents) {
+ return db.model.create(contents);
+ }),
+ function (model, next) {
+ // `model` is the instantiated model object.
+ // If there was an error, this function would be skipped.
+ }
+], callback)
+```
+
+This also means you can asyncify ES2016 `async` functions.
+
+```js
+var q = async.queue(async.asyncify(async function (file) {
+ var intermediateStep = await processFile(file);
+ return await somePromise(intermediateStep)
+}));
+
+q.push(files);
+```
+
+---------------------------------------
+
+
+### log(function, arguments)
+
+Logs the result of an `async` function to the `console`. Only works in Node.js or
+in browsers that support `console.log` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.log` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, 'hello ' + name);
+ }, 1000);
+};
+```
+```js
+node> async.log(hello, 'world');
+'hello world'
+```
+
+---------------------------------------
+
+
+### dir(function, arguments)
+
+Logs the result of an `async` function to the `console` using `console.dir` to
+display the properties of the resulting object. Only works in Node.js or
+in browsers that support `console.dir` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.dir` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, {hello: name});
+ }, 1000);
+};
+```
+```js
+node> async.dir(hello, 'world');
+{hello: 'world'}
+```
+
+---------------------------------------
+
+
+### noConflict()
+
+Changes the value of `async` back to its original value, returning a reference to the
+`async` object.
diff --git a/node_modules/async/dist/async.js b/node_modules/async/dist/async.js
new file mode 100644
index 0000000..31e7620
--- /dev/null
+++ b/node_modules/async/dist/async.js
@@ -0,0 +1,1265 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+ var async = {};
+ function noop() {}
+ function identity(v) {
+ return v;
+ }
+ function toBool(v) {
+ return !!v;
+ }
+ function notId(v) {
+ return !v;
+ }
+
+ // global on the server, window in the browser
+ var previous_async;
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = typeof self === 'object' && self.self === self && self ||
+ typeof global === 'object' && global.global === global && global ||
+ this;
+
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ function _once(fn) {
+ return function() {
+ if (fn === null) return;
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
+ // Ported from underscore.js isObject
+ var _isObject = function(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ };
+
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &&
+ arr.length >= 0 &&
+ arr.length % 1 === 0
+ );
+ }
+
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+
+ while (++index < length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+
+ function _range(count) {
+ return _map(Array(count), function (v, i) { return i; });
+ }
+
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ }
+
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+
+ function _indexOf(arr, item) {
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] === item) return i;
+ }
+ return -1;
+ }
+
+ var _keys = Object.keys || function (obj) {
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i < len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i < len ? keys[i] : null;
+ };
+ }
+ }
+
+ // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+ // This accumulates the arguments passed into an array, after a given index.
+ // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+ function _restParam(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0);
+ var rest = Array(length);
+ for (var index = 0; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ }
+ // Currently unused but handle cases outside of the switch statement:
+ // var args = Array(startIndex + 1);
+ // for (index = 0; index < startIndex; index++) {
+ // args[index] = arguments[index];
+ // }
+ // args[startIndex] = rest;
+ // return func.apply(this, args);
+ };
+ }
+
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+ var _delay = _setImmediate ? function(fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ } : function(fn) {
+ setTimeout(fn, 0);
+ };
+
+ if (typeof process === 'object' && typeof process.nextTick === 'function') {
+ async.nextTick = process.nextTick;
+ } else {
+ async.nextTick = _delay;
+ }
+ async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+ async.forEach =
+ async.each = function (arr, iterator, callback) {
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+
+
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+
+ var iter = _keyIterator(object);
+ var key, completed = 0;
+
+ while ((key = iter()) != null) {
+ completed += 1;
+ iterator(object[key], key, only_once(done));
+ }
+
+ if (completed === 0) callback(null);
+
+ function done(err) {
+ completed--;
+ if (err) {
+ callback(err);
+ }
+ // Check key is null in case iterator isn't exhausted
+ // and done resolved synchronously.
+ else if (key === null && completed <= 0) {
+ callback(null);
+ }
+ }
+ };
+
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ var key = nextKey();
+ function iterate() {
+ var sync = true;
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, only_once(function (err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ key = nextKey();
+ if (key === null) {
+ return callback(null);
+ } else {
+ if (sync) {
+ async.setImmediate(iterate);
+ } else {
+ iterate();
+ }
+ }
+ }
+ }));
+ sync = false;
+ }
+ iterate();
+ };
+
+
+
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
+ };
+
+ function _eachOfLimit(limit) {
+
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit <= 0) {
+ return callback(null);
+ }
+ var done = false;
+ var running = 0;
+ var errored = false;
+
+ (function replenish () {
+ if (done && running <= 0) {
+ return callback(null);
+ }
+
+ while (running < limit && !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iterator(obj[key], key, only_once(function (err) {
+ running -= 1;
+ if (err) {
+ callback(err);
+ errored = true;
+ }
+ else {
+ replenish();
+ }
+ }));
+ }
+ })();
+ };
+ }
+
+
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
+ };
+ }
+ function doParallelLimit(fn) {
+ return function (obj, limit, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
+ };
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
+ };
+ }
+
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ arr = arr || [];
+ var results = _isArrayLike(arr) ? [] : {};
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = doParallelLimit(_asyncMap);
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.inject =
+ async.foldl =
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+
+ async.foldr =
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, identity).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+
+ async.transform = function (arr, memo, iterator, callback) {
+ if (arguments.length === 3) {
+ callback = iterator;
+ iterator = memo;
+ memo = _isArray(arr) ? [] : {};
+ }
+
+ async.eachOf(arr, function(v, k, cb) {
+ iterator(memo, v, k, cb);
+ }, function(err) {
+ callback(err, memo);
+ });
+ };
+
+ function _filter(eachfn, arr, iterator, callback) {
+ var results = [];
+ eachfn(arr, function (x, index, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+
+ async.select =
+ async.filter = doParallel(_filter);
+
+ async.selectLimit =
+ async.filterLimit = doParallelLimit(_filter);
+
+ async.selectSeries =
+ async.filterSeries = doSeries(_filter);
+
+ function _reject(eachfn, arr, iterator, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iterator(value, function(v) {
+ cb(!v);
+ });
+ }, callback);
+ }
+ async.reject = doParallel(_reject);
+ async.rejectLimit = doParallelLimit(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ function _createTester(eachfn, check, getResult) {
+ return function(arr, limit, iterator, cb) {
+ function done() {
+ if (cb) cb(getResult(false, void 0));
+ }
+ function iteratee(x, _, callback) {
+ if (!cb) return callback();
+ iterator(x, function (v) {
+ if (cb && check(v)) {
+ cb(getResult(true, x));
+ cb = iterator = false;
+ }
+ callback();
+ });
+ }
+ if (arguments.length > 3) {
+ eachfn(arr, limit, iteratee, done);
+ } else {
+ cb = iterator;
+ iterator = limit;
+ eachfn(arr, iteratee, done);
+ }
+ };
+ }
+
+ async.any =
+ async.some = _createTester(async.eachOf, toBool, identity);
+
+ async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+ async.all =
+ async.every = _createTester(async.eachOf, notId, notId);
+
+ async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+ function _findGetResult(v, x) {
+ return x;
+ }
+ async.detect = _createTester(async.eachOf, identity, _findGetResult);
+ async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+ async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ callback(null, _map(results.sort(comparator), function (x) {
+ return x.value;
+ }));
+ }
+
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+ };
+
+ async.auto = function (tasks, concurrency, callback) {
+ if (typeof arguments[1] === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = _once(callback || noop);
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = remainingTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+
+ var hasError = false;
+
+ var listeners = [];
+ function addListener(fn) {
+ listeners.unshift(fn);
+ }
+ function removeListener(fn) {
+ var idx = _indexOf(listeners, fn);
+ if (idx >= 0) listeners.splice(idx, 1);
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ }
+
+ addListener(function () {
+ if (!remainingTasks) {
+ callback(null, results);
+ }
+ });
+
+ _arrayEach(keys, function (k) {
+ if (hasError) return;
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = _restParam(function(err, args) {
+ runningTasks--;
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _forEachOf(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[k] = args;
+ hasError = true;
+
+ callback(err, safeResults);
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ });
+ var requires = task.slice(0, task.length - 1);
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has nonexistent dependency in ' + requires.join(', '));
+ }
+ if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
+ return runningTasks < concurrency && _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ }
+ if (ready()) {
+ runningTasks++;
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ addListener(listener);
+ }
+ function listener() {
+ if (ready()) {
+ runningTasks++;
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
+ });
+ };
+
+
+
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var attempts = [];
+
+ var opts = {
+ times: DEFAULT_TIMES,
+ interval: DEFAULT_INTERVAL
+ };
+
+ function parseTimes(acc, t){
+ if(typeof t === 'number'){
+ acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+ } else if(typeof t === 'object'){
+ acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+ acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+ } else {
+ throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+ }
+ }
+
+ var length = arguments.length;
+ if (length < 1 || length > 3) {
+ throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+ } else if (length <= 2 && typeof times === 'function') {
+ callback = task;
+ task = times;
+ }
+ if (typeof times !== 'function') {
+ parseTimes(opts, times);
+ }
+ opts.callback = callback;
+ opts.task = task;
+
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ }
+
+ function retryInterval(interval){
+ return function(seriesCallback){
+ setTimeout(function(){
+ seriesCallback(null);
+ }, interval);
+ };
+ }
+
+ while (opts.times) {
+
+ var finalAttempt = !(opts.times-=1);
+ attempts.push(retryAttempt(opts.task, finalAttempt));
+ if(!finalAttempt && opts.interval > 0){
+ attempts.push(retryInterval(opts.interval));
+ }
+ }
+
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || opts.callback)(data.err, data.result);
+ });
+ }
+
+ // If a callback is passed, run this as a controll flow
+ return opts.callback ? wrappedTask() : wrappedTask;
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = _once(callback || noop);
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ function wrapIterator(iterator) {
+ return _restParam(function (err, args) {
+ if (err) {
+ callback.apply(null, [err].concat(args));
+ }
+ else {
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ ensureAsync(iterator).apply(null, args);
+ }
+ });
+ }
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ task(_restParam(function (err, args) {
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ }));
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.parallel = function (tasks, callback) {
+ _parallel(async.eachOf, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+ };
+
+ async.series = function(tasks, callback) {
+ _parallel(async.eachOfSeries, tasks, callback);
+ };
+
+ async.iterator = function (tasks) {
+ function makeCallback(index) {
+ function fn() {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ }
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ }
+ return makeCallback(0);
+ };
+
+ async.apply = _restParam(function (fn, args) {
+ return _restParam(function (callArgs) {
+ return fn.apply(
+ null, args.concat(callArgs)
+ );
+ });
+ });
+
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
+ fn(x, function (err, y) {
+ result = result.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, result);
+ });
+ }
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ callback = callback || noop;
+ if (test()) {
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else if (test.apply(this, args)) {
+ iterator(next);
+ } else {
+ callback.apply(null, [null].concat(args));
+ }
+ });
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ var calls = 0;
+ return async.whilst(function() {
+ return ++calls <= 1 || test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.until = function (test, iterator, callback) {
+ return async.whilst(function() {
+ return !test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ return async.doWhilst(iterator, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+ };
+
+ async.during = function (test, iterator, callback) {
+ callback = callback || noop;
+
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else {
+ args.push(check);
+ test.apply(this, args);
+ }
+ });
+
+ var check = function(err, truth) {
+ if (err) {
+ callback(err);
+ } else if (truth) {
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ test(check);
+ };
+
+ async.doDuring = function (iterator, test, callback) {
+ var calls = 0;
+ async.during(function(next) {
+ if (calls++ < 1) {
+ next(null, true);
+ } else {
+ test.apply(this, arguments);
+ }
+ }, iterator, callback);
+ };
+
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ });
+ async.setImmediate(q.process);
+ }
+ function _next(q, tasks) {
+ return function(){
+ workers -= 1;
+
+ var removed = false;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ _arrayEach(workersList, function (worker, index) {
+ if (worker === task && !removed) {
+ workersList.splice(index, 1);
+ removed = true;
+ }
+ });
+
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var workers = 0;
+ var workersList = [];
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ workersList.push(tasks[0]);
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w <= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ }
+
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+
+ return q;
+ };
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : noop
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ return _queue(worker, 1, payload);
+ };
+
+ function _console_fn(name) {
+ return _restParam(function (fn, args) {
+ fn.apply(null, args.concat([_restParam(function (err, args) {
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ })]));
+ });
+ }
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ var has = Object.prototype.hasOwnProperty;
+ hasher = hasher || identity;
+ var memoized = _restParam(function memoized(args) {
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (has.call(memo, key)) {
+ async.setImmediate(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (has.call(queues, key)) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([_restParam(function (args) {
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ })]));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ function _times(mapper) {
+ return function (count, iterator, callback) {
+ mapper(_range(count), iterator, callback);
+ };
+ }
+
+ async.times = _times(async.map);
+ async.timesSeries = _times(async.mapSeries);
+ async.timesLimit = function (count, limit, iterator, callback) {
+ return async.mapLimit(_range(count), limit, iterator, callback);
+ };
+
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return _restParam(function (args) {
+ var that = this;
+
+ var callback = args[args.length - 1];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+ cb(err, nextargs);
+ })]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ });
+ };
+
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
+
+ function _applyEach(eachfn) {
+ return _restParam(function(fns, args) {
+ var go = _restParam(function(args) {
+ var that = this;
+ var callback = args.pop();
+ return eachfn(fns, function (fn, _, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ });
+ }
+
+ async.applyEach = _applyEach(async.eachOf);
+ async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+ async.forever = function (fn, callback) {
+ var done = only_once(callback || noop);
+ var task = ensureAsync(fn);
+ function next(err) {
+ if (err) {
+ return done(err);
+ }
+ task(next);
+ }
+ next();
+ };
+
+ function ensureAsync(fn) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ });
+ }
+
+ async.ensureAsync = ensureAsync;
+
+ async.constant = _restParam(function(values) {
+ var args = [null].concat(values);
+ return function (callback) {
+ return callback.apply(this, args);
+ };
+ });
+
+ async.wrapSync =
+ async.asyncify = function asyncify(func) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (_isObject(result) && typeof result.then === "function") {
+ result.then(function(value) {
+ callback(null, value);
+ })["catch"](function(err) {
+ callback(err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+ };
+
+ // Node.js
+ if (typeof module === 'object' && module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else if (typeof define === 'function' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // included directly via
+