Browse Source

冷链物流app1.0

qianduan 11 months ago
commit
f69e3117c2
100 changed files with 9103 additions and 0 deletions
  1. 13 0
      .env.js
  2. 16 0
      .hbuilderx/launch.json
  3. 25 0
      App.vue
  4. 31 0
      common/amap-wx.js
  5. 392 0
      common/barcode.js
  6. 111 0
      common/index.scss
  7. 22 0
      components/x-barCode.vue
  8. 67 0
      components/x-bluetooth.vue
  9. 66 0
      components/x-checkbox.vue
  10. 110 0
      components/x-form.vue
  11. 153 0
      components/x-humiture.vue
  12. 97 0
      components/x-navbottom.vue
  13. 45 0
      components/x-orderCard.vue
  14. 201 0
      components/x-orderManagement.vue
  15. 34 0
      components/x-radar.vue
  16. 218 0
      components/x-statistics.vue
  17. 169 0
      components/x-steps.vue
  18. 20 0
      index.html
  19. 33 0
      main.js
  20. 131 0
      manifest.json
  21. 66 0
      node_modules/.package-lock.json
  22. 58 0
      node_modules/array-parallel/.npmignore
  23. 6 0
      node_modules/array-parallel/.travis.yml
  24. 78 0
      node_modules/array-parallel/README.md
  25. 11 0
      node_modules/array-parallel/component.json
  26. 40 0
      node_modules/array-parallel/index.js
  27. 23 0
      node_modules/array-parallel/package.json
  28. 62 0
      node_modules/array-parallel/test.js
  29. 58 0
      node_modules/array-series/.npmignore
  30. 4 0
      node_modules/array-series/.travis.yml
  31. 76 0
      node_modules/array-series/README.md
  32. 11 0
      node_modules/array-series/component.json
  33. 34 0
      node_modules/array-series/index.js
  34. 23 0
      node_modules/array-series/package.json
  35. 88 0
      node_modules/array-series/test.js
  36. 2 0
      node_modules/barcode/.npmignore
  37. 20 0
      node_modules/barcode/LICENSE
  38. 113 0
      node_modules/barcode/README.md
  39. 68 0
      node_modules/barcode/index.js
  40. 102 0
      node_modules/barcode/lib/codabar.js
  41. 151 0
      node_modules/barcode/lib/code128.js
  42. 114 0
      node_modules/barcode/lib/code39.js
  43. 105 0
      node_modules/barcode/lib/ean13.js
  44. 91 0
      node_modules/barcode/lib/upc-a.js
  45. 145 0
      node_modules/barcode/lib/upc-e.js
  46. 55 0
      node_modules/barcode/lib/utils/checksums.js
  47. 148 0
      node_modules/barcode/lib/utils/draw1D.js
  48. 34 0
      node_modules/barcode/package.json
  49. 4 0
      node_modules/debug/.npmignore
  50. 47 0
      node_modules/debug/History.md
  51. 4 0
      node_modules/debug/Makefile
  52. 130 0
      node_modules/debug/Readme.md
  53. 120 0
      node_modules/debug/debug.component.js
  54. 116 0
      node_modules/debug/debug.js
  55. 19 0
      node_modules/debug/example/app.js
  56. 24 0
      node_modules/debug/example/browser.html
  57. 10 0
      node_modules/debug/example/wildcards.js
  58. 22 0
      node_modules/debug/example/worker.js
  59. 1 0
      node_modules/debug/head.js
  60. 2 0
      node_modules/debug/index.js
  61. 135 0
      node_modules/debug/lib/debug.js
  62. 17 0
      node_modules/debug/package.json
  63. 4 0
      node_modules/debug/tail.js
  64. 2 0
      node_modules/gm/.npmignore
  65. 7 0
      node_modules/gm/.travis.yml
  66. 496 0
      node_modules/gm/History.md
  67. 8 0
      node_modules/gm/Makefile
  68. 560 0
      node_modules/gm/README.md
  69. 130 0
      node_modules/gm/index.js
  70. 1064 0
      node_modules/gm/lib/args.js
  71. 358 0
      node_modules/gm/lib/command.js
  72. 100 0
      node_modules/gm/lib/compare.js
  73. 11 0
      node_modules/gm/lib/convenience.js
  74. 57 0
      node_modules/gm/lib/convenience/autoOrient.js
  75. 61 0
      node_modules/gm/lib/convenience/morph.js
  76. 10 0
      node_modules/gm/lib/convenience/sepia.js
  77. 73 0
      node_modules/gm/lib/convenience/thumb.js
  78. 160 0
      node_modules/gm/lib/drawing.js
  79. 300 0
      node_modules/gm/lib/getters.js
  80. 17 0
      node_modules/gm/lib/options.js
  81. 23 0
      node_modules/gm/lib/utils.js
  82. 49 0
      node_modules/gm/package.json
  83. 1 0
      node_modules/jsbarcode/.dockerignore
  84. 4 0
      node_modules/jsbarcode/.eslintignore
  85. 24 0
      node_modules/jsbarcode/.eslintrc
  86. 16 0
      node_modules/jsbarcode/.travis.yml
  87. 84 0
      node_modules/jsbarcode/CONTRIBUTING.md
  88. 13 0
      node_modules/jsbarcode/Dockerfile
  89. 7 0
      node_modules/jsbarcode/MIT-LICENSE.txt
  90. 255 0
      node_modules/jsbarcode/README.md
  91. 37 0
      node_modules/jsbarcode/automation/barcode-building.json
  92. 132 0
      node_modules/jsbarcode/automation/building.js
  93. 9 0
      node_modules/jsbarcode/automation/linting.js
  94. 30 0
      node_modules/jsbarcode/automation/misc.js
  95. 163 0
      node_modules/jsbarcode/automation/releasing.js
  96. 6 0
      node_modules/jsbarcode/automation/settings.json
  97. 5 0
      node_modules/jsbarcode/automation/shared.js
  98. 252 0
      node_modules/jsbarcode/bin/JsBarcode.js
  99. 17 0
      node_modules/jsbarcode/bin/barcodes/Barcode.js
  100. 167 0
      node_modules/jsbarcode/bin/barcodes/CODE128/CODE128.js

+ 13 - 0
.env.js

@@ -0,0 +1,13 @@
+const UNI_APP = {
+	APP_DEV_URL: 'https://coldlogistics.coldbaozhida.com/Cold_Logistic',
+	APP_PROD_URL: 'https://coldlogistics.coldbaozhida.com/Cold_Logistic',
+	APP_LINK_URL: 'https://coldlogistics.coldbaozhida.com',
+	// APP_DEV_URL: 'http://coldlogisticstest.coldbaozhida.com/Cold_Logistic', //测试
+	// APP_PROD_URL: 'http://coldlogisticstest.coldbaozhida.com/Cold_Logistic', //测试
+	// APP_LINK_URL: 'http://coldlogisticstest.coldbaozhida.com', //测试
+
+	AES_KEY: "675I3123J3Toq10L",
+	AES_IV: "AdC01PoIU3LnSh10",
+}
+
+module.exports = UNI_APP;

+ 16 - 0
.hbuilderx/launch.json

@@ -0,0 +1,16 @@
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version": "0.0",
+    "configurations": [{
+     	"app-plus" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"default" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"type" : "uniCloud"
+     }
+    ]
+}

+ 25 - 0
App.vue

@@ -0,0 +1,25 @@
+<script>
+	// 冷链物流移动端
+	export default {
+		onLaunch: function() {
+			console.log('App Launch')
+		},
+		onShow: function() {
+			console.log('App Show')
+		},
+		onHide: function() {
+			console.log('App Hide')
+		}
+	}
+</script>
+
+<style lang="scss">
+	/*每个页面公共css */
+	@import "uview-ui/index.scss";
+	@import "common/index.scss";
+	@import url(@/static/fonts/iconfont.css);
+
+	page {
+		background-color: #f3f4f6;
+	}
+</style>

+ 31 - 0
common/amap-wx.js

@@ -0,0 +1,31 @@
+function AMapWX(a){this.key=a.key;this.requestConfig={key:a.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};this.MeRequestConfig={key:a.key,serviceName:"https://restapi.amap.com/rest/me"}}
+AMapWX.prototype.getWxLocation=function(a,b){wx.getLocation({type:"gcj02",success:function(c){c=c.longitude+","+c.latitude;wx.setStorage({key:"userLocation",data:c});b(c)},fail:function(c){wx.getStorage({key:"userLocation",success:function(d){d.data&&b(d.data)}});a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getMEKeywordsSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.city&&(d.city=b.city);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);b.sig&&(d.sig=
+b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/local",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEIdSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.id&&(d.id=b.id);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/id",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&
+0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEPolygonSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.polygon&&(d.polygon=b.polygon);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);
+b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/polygon",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEaroundSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.center&&(d.center=b.center);b.radius&&(d.radius=b.radius);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&
+(d.pageSize=b.pageSize);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/around",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getGeo=function(a){var b=this.requestConfig,c=a.options;b={key:this.key,extensions:"all",s:b.s,platform:b.platform,appname:this.key,sdkversion:b.sdkversion,logversion:b.logversion};c.address&&(b.address=c.address);c.city&&(b.city=c.city);c.batch&&(b.batch=c.batch);c.sig&&(b.sig=c.sig);wx.request({url:"https://restapi.amap.com/v3/geocode/geo",data:b,method:"GET",header:{"content-type":"application/json"},success:function(d){(d=d.data)&&d.status&&"1"===d.status?a.success(d):a.fail({errCode:"0",
+errMsg:d})},fail:function(d){a.fail({errCode:"0",errMsg:d.errMsg||""})}})};
+AMapWX.prototype.getRegeo=function(a){function b(d){var e=c.requestConfig;wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:c.key,location:d,extensions:"all",s:e.s,platform:e.platform,appname:c.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){g=g.data.regeocode;var h=g.addressComponent,f=[],k=g.roads[0].name+"\u9644\u8fd1",m=d.split(",")[0],n=d.split(",")[1];if(g.pois&&
+g.pois[0]){k=g.pois[0].name+"\u9644\u8fd1";var l=g.pois[0].location;l&&(m=parseFloat(l.split(",")[0]),n=parseFloat(l.split(",")[1]))}h.provice&&f.push(h.provice);h.city&&f.push(h.city);h.district&&f.push(h.district);h.streetNumber&&h.streetNumber.street&&h.streetNumber.number?(f.push(h.streetNumber.street),f.push(h.streetNumber.number)):f.push(g.roads[0].name);f=f.join("");a.success([{iconPath:a.iconPath,width:a.iconWidth,height:a.iconHeight,name:f,desc:k,longitude:m,latitude:n,id:0,regeocodeData:g}])}else a.fail({errCode:g.data.infocode,
+errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this;a.location?b(a.location):c.getWxLocation(a,function(d){b(d)})};
+AMapWX.prototype.getWeather=function(a){function b(g){var h="base";a.type&&"forecast"==a.type&&(h="all");wx.request({url:"https://restapi.amap.com/v3/weather/weatherInfo",data:{key:d.key,city:g,extensions:h,s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(f){if(f.data.status&&"1"==f.data.status)if(f.data.lives){if((f=f.data.lives)&&0<f.length){f=f[0];var k={city:{text:"\u57ce\u5e02",data:f.city},
+weather:{text:"\u5929\u6c14",data:f.weather},temperature:{text:"\u6e29\u5ea6",data:f.temperature},winddirection:{text:"\u98ce\u5411",data:f.winddirection+"\u98ce"},windpower:{text:"\u98ce\u529b",data:f.windpower+"\u7ea7"},humidity:{text:"\u6e7f\u5ea6",data:f.humidity+"%"}};k.liveData=f;a.success(k)}}else f.data.forecasts&&f.data.forecasts[0]&&a.success({forecast:f.data.forecasts[0]});else a.fail({errCode:f.data.infocode,errMsg:f.data.info})},fail:function(f){a.fail({errCode:"0",errMsg:f.errMsg||""})}})}
+function c(g){wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:d.key,location:g,extensions:"all",s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(h){if(h.data.status&&"1"==h.data.status){h=h.data.regeocode;if(h.addressComponent)var f=h.addressComponent.adcode;else h.aois&&0<h.aois.length&&(f=h.aois[0].adcode);b(f)}else a.fail({errCode:h.data.infocode,errMsg:h.data.info})},
+fail:function(h){a.fail({errCode:"0",errMsg:h.errMsg||""})}})}var d=this,e=d.requestConfig;a.city?b(a.city):d.getWxLocation(a,function(g){c(g)})};
+AMapWX.prototype.getPoiAround=function(a){function b(e){e={key:c.key,location:e,s:d.s,platform:d.platform,appname:c.key,sdkversion:d.sdkversion,logversion:d.logversion};a.querytypes&&(e.types=a.querytypes);a.querykeywords&&(e.keywords=a.querykeywords);wx.request({url:"https://restapi.amap.com/v3/place/around",data:e,method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){if((g=g.data)&&g.pois){for(var h=[],f=0;f<g.pois.length;f++){var k=0==
+f?a.iconPathSelected:a.iconPath;h.push({latitude:parseFloat(g.pois[f].location.split(",")[1]),longitude:parseFloat(g.pois[f].location.split(",")[0]),iconPath:k,width:22,height:32,id:f,name:g.pois[f].name,address:g.pois[f].address})}a.success({markers:h,poisData:g.pois})}}else a.fail({errCode:g.data.infocode,errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this,d=c.requestConfig;a.location?b(a.location):c.getWxLocation(a,function(e){b(e)})};
+AMapWX.prototype.getStaticmap=function(a){function b(e){c.push("location="+e);a.zoom&&c.push("zoom="+a.zoom);a.size&&c.push("size="+a.size);a.scale&&c.push("scale="+a.scale);a.markers&&c.push("markers="+a.markers);a.labels&&c.push("labels="+a.labels);a.paths&&c.push("paths="+a.paths);a.traffic&&c.push("traffic="+a.traffic);e="https://restapi.amap.com/v3/staticmap?"+c.join("&");a.success({url:e})}var c=[];c.push("key="+this.key);var d=this.requestConfig;c.push("s="+d.s);c.push("platform="+d.platform);
+c.push("appname="+d.appname);c.push("sdkversion="+d.sdkversion);c.push("logversion="+d.logversion);a.location?b(a.location):this.getWxLocation(a,function(e){b(e)})};
+AMapWX.prototype.getInputtips=function(a){var b=Object.assign({},this.requestConfig);a.location&&(b.location=a.location);a.keywords&&(b.keywords=a.keywords);a.type&&(b.type=a.type);a.city&&(b.city=a.city);a.citylimit&&(b.citylimit=a.citylimit);wx.request({url:"https://restapi.amap.com/v3/assistant/inputtips",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.tips&&a.success({tips:c.data.tips})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||
+""})}})};
+AMapWX.prototype.getDrivingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.waypoints&&(b.waypoints=a.waypoints);a.avoidpolygons&&(b.avoidpolygons=a.avoidpolygons);a.avoidroad&&(b.avoidroad=a.avoidroad);wx.request({url:"https://restapi.amap.com/v3/direction/driving",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths,
+taxi_cost:c.data.route.taxi_cost||""})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getWalkingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/walking",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getTransitRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.city&&(b.city=a.city);a.cityd&&(b.cityd=a.cityd);wx.request({url:"https://restapi.amap.com/v3/direction/transit/integrated",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&(c=c.data.route,a.success({distance:c.distance||"",taxi_cost:c.taxi_cost||
+"",transits:c.transits}))},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getRidingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/riding",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};module.exports.AMapWX=AMapWX;

+ 392 - 0
common/barcode.js

@@ -0,0 +1,392 @@
+var CHAR_TILDE = 126;
+var CODE_FNC1 = 102;
+
+var SET_STARTA = 103;
+var SET_STARTB = 104;
+var SET_STARTC = 105;
+var SET_SHIFT = 98;
+var SET_CODEA = 101;
+var SET_CODEB = 100;
+var SET_STOP = 106;
+
+
+var REPLACE_CODES = {
+	CHAR_TILDE: CODE_FNC1 //~ corresponds to FNC1 in GS1-128 standard
+}
+
+var CODESET = {
+	ANY: 1,
+	AB: 2,
+	A: 3,
+	B: 4,
+	C: 5
+};
+
+function getBytes(str) {
+	var bytes = [];
+	for (var i = 0; i < str.length; i++) {
+		bytes.push(str.charCodeAt(i));
+	}
+	return bytes;
+}
+
+exports.code128 = function(ctx, text, width, height) {
+
+	width = parseInt(width);
+
+	height = parseInt(height);
+
+	var codes = stringToCode128(text);
+
+	var g = new Graphics(ctx, width, height);
+
+	var barWeight = g.area.width / ((codes.length - 3) * 11 + 35);
+
+	var x = g.area.left;
+	var y = g.area.top;
+	for (var i = 0; i < codes.length; i++) {
+		var c = codes[i];
+		//two bars at a time: 1 black and 1 white
+		for (var bar = 0; bar < 8; bar += 2) {
+			var barW = PATTERNS[c][bar] * barWeight;
+			// var barH = height - y - this.border;
+			var barH = height - y;
+			var spcW = PATTERNS[c][bar + 1] * barWeight;
+
+			//no need to draw if 0 width
+			if (barW > 0) {
+				g.fillFgRect(x, y, barW, barH);
+			}
+
+			x += barW + spcW;
+		}
+	}
+
+	ctx.draw();
+}
+
+
+function stringToCode128(text) {
+
+	var barc = {
+		currcs: CODESET.C
+	};
+
+	var bytes = getBytes(text);
+	//decide starting codeset
+	var index = bytes[0] == CHAR_TILDE ? 1 : 0;
+
+	var csa1 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB;
+	var csa2 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB;
+	barc.currcs = getBestStartSet(csa1, csa2);
+	barc.currcs = perhapsCodeC(bytes, barc.currcs);
+
+	//if no codeset changes this will end up with bytes.length+3
+	//start, checksum and stop
+	var codes = new Array();
+
+	switch (barc.currcs) {
+		case CODESET.A:
+			codes.push(SET_STARTA);
+			break;
+		case CODESET.B:
+			codes.push(SET_STARTB);
+			break;
+		default:
+			codes.push(SET_STARTC);
+			break;
+	}
+
+
+	for (var i = 0; i < bytes.length; i++) {
+		var b1 = bytes[i]; //get the first of a pair
+		//should we translate/replace
+		if (b1 in REPLACE_CODES) {
+			codes.push(REPLACE_CODES[b1]);
+			i++ //jump to next
+			b1 = bytes[i];
+		}
+
+		//get the next in the pair if possible
+		var b2 = bytes.length > (i + 1) ? bytes[i + 1] : -1;
+
+		codes = codes.concat(codesForChar(b1, b2, barc.currcs));
+		//code C takes 2 chars each time
+		if (barc.currcs == CODESET.C) i++;
+	}
+
+	//calculate checksum according to Code 128 standards
+	var checksum = codes[0];
+	for (var weight = 1; weight < codes.length; weight++) {
+		checksum += (weight * codes[weight]);
+	}
+	codes.push(checksum % 103);
+
+	codes.push(SET_STOP);
+
+	//encoding should now be complete
+	return codes;
+
+	function getBestStartSet(csa1, csa2) {
+		//tries to figure out the best codeset
+		//to start with to get the most compact code
+		var vote = 0;
+		vote += csa1 == CODESET.A ? 1 : 0;
+		vote += csa1 == CODESET.B ? -1 : 0;
+		vote += csa2 == CODESET.A ? 1 : 0;
+		vote += csa2 == CODESET.B ? -1 : 0;
+		//tie goes to B due to my own predudices
+		return vote > 0 ? CODESET.A : CODESET.B;
+	}
+
+	function perhapsCodeC(bytes, codeset) {
+		for (var i = 0; i < bytes.length; i++) {
+			var b = bytes[i]
+			if ((b < 48 || b > 57) && b != CHAR_TILDE)
+				return codeset;
+		}
+		return CODESET.C;
+	}
+
+	//chr1 is current byte
+	//chr2 is the next byte to process. looks ahead.
+	function codesForChar(chr1, chr2, currcs) {
+		var result = [];
+		var shifter = -1;
+
+		if (charCompatible(chr1, currcs)) {
+			if (currcs == CODESET.C) {
+				if (chr2 == -1) {
+					shifter = SET_CODEB;
+					currcs = CODESET.B;
+				} else if ((chr2 != -1) && !charCompatible(chr2, currcs)) {
+					//need to check ahead as well
+					if (charCompatible(chr2, CODESET.A)) {
+						shifter = SET_CODEA;
+						currcs = CODESET.A;
+					} else {
+						shifter = SET_CODEB;
+						currcs = CODESET.B;
+					}
+				}
+			}
+		} else {
+			//if there is a next char AND that next char is also not compatible
+			if ((chr2 != -1) && !charCompatible(chr2, currcs)) {
+				//need to switch code sets
+				switch (currcs) {
+					case CODESET.A:
+						shifter = SET_CODEB;
+						currcs = CODESET.B;
+						break;
+					case CODESET.B:
+						shifter = SET_CODEA;
+						currcs = CODESET.A;
+						break;
+				}
+			} else {
+				//no need to shift code sets, a temporary SHIFT will suffice
+				shifter = SET_SHIFT;
+			}
+		}
+
+		//ok some type of shift is nessecary
+		if (shifter != -1) {
+			result.push(shifter);
+			result.push(codeValue(chr2));
+		} else {
+			if (currcs == CODESET.C) {
+				//include next as well
+				result.push(codeValue(chr1, chr2));
+			} else {
+				result.push(codeValue(chr1));
+			}
+		}
+		barc.currcs = currcs;
+
+		return result;
+	}
+}
+
+//reduce the ascii code to fit into the Code128 char table
+function codeValue(chr1, chr2) {
+	if (typeof chr2 == "undefined") {
+		return chr1 >= 32 ? chr1 - 32 : chr1 + 64;
+	} else {
+		return parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2));
+	}
+}
+
+function charCompatible(chr, codeset) {
+	var csa = codeSetAllowedFor(chr);
+	if (csa == CODESET.ANY) return true;
+	//if we need to change from current
+	if (csa == CODESET.AB) return true;
+	if (csa == CODESET.A && codeset == CODESET.A) return true;
+	if (csa == CODESET.B && codeset == CODESET.B) return true;
+	return false;
+}
+
+function codeSetAllowedFor(chr) {
+	if (chr >= 48 && chr <= 57) {
+		//0-9
+		return CODESET.ANY;
+	} else if (chr >= 32 && chr <= 95) {
+		//0-9 A-Z
+		return CODESET.AB;
+	} else {
+		//if non printable
+		return chr < 32 ? CODESET.A : CODESET.B;
+	}
+}
+
+var Graphics = function(ctx, width, height) {
+
+	this.width = width;
+	this.height = height;
+	this.quiet = Math.round(this.width / 40);
+
+	this.border_size = 0;
+	this.padding_width = 0;
+
+	this.area = {
+		width: width - this.padding_width * 2 - this.quiet * 2,
+		height: height - this.border_size * 2,
+		top: this.border_size - 4,
+		left: this.padding_width + this.quiet
+	};
+
+	this.ctx = ctx;
+	this.fg = "#000000";
+	this.bg = "#ffffff";
+
+	// fill background
+	this.fillBgRect(0, 0, width, height);
+
+	// fill center to create border
+	this.fillBgRect(0, this.border_size, width, height - this.border_size * 2);
+}
+
+//use native color
+Graphics.prototype._fillRect = function(x, y, width, height, color) {
+	this.ctx.setFillStyle(color)
+	this.ctx.fillRect(x, y, width, height)
+}
+
+Graphics.prototype.fillFgRect = function(x, y, width, height) {
+	this._fillRect(x, y, width, height, this.fg);
+}
+
+Graphics.prototype.fillBgRect = function(x, y, width, height) {
+	this._fillRect(x, y, width, height, this.bg);
+}
+
+var PATTERNS = [
+	[2, 1, 2, 2, 2, 2, 0, 0], // 0
+	[2, 2, 2, 1, 2, 2, 0, 0], // 1
+	[2, 2, 2, 2, 2, 1, 0, 0], // 2
+	[1, 2, 1, 2, 2, 3, 0, 0], // 3
+	[1, 2, 1, 3, 2, 2, 0, 0], // 4
+	[1, 3, 1, 2, 2, 2, 0, 0], // 5
+	[1, 2, 2, 2, 1, 3, 0, 0], // 6
+	[1, 2, 2, 3, 1, 2, 0, 0], // 7
+	[1, 3, 2, 2, 1, 2, 0, 0], // 8
+	[2, 2, 1, 2, 1, 3, 0, 0], // 9
+	[2, 2, 1, 3, 1, 2, 0, 0], // 10
+	[2, 3, 1, 2, 1, 2, 0, 0], // 11
+	[1, 1, 2, 2, 3, 2, 0, 0], // 12
+	[1, 2, 2, 1, 3, 2, 0, 0], // 13
+	[1, 2, 2, 2, 3, 1, 0, 0], // 14
+	[1, 1, 3, 2, 2, 2, 0, 0], // 15
+	[1, 2, 3, 1, 2, 2, 0, 0], // 16
+	[1, 2, 3, 2, 2, 1, 0, 0], // 17
+	[2, 2, 3, 2, 1, 1, 0, 0], // 18
+	[2, 2, 1, 1, 3, 2, 0, 0], // 19
+	[2, 2, 1, 2, 3, 1, 0, 0], // 20
+	[2, 1, 3, 2, 1, 2, 0, 0], // 21
+	[2, 2, 3, 1, 1, 2, 0, 0], // 22
+	[3, 1, 2, 1, 3, 1, 0, 0], // 23
+	[3, 1, 1, 2, 2, 2, 0, 0], // 24
+	[3, 2, 1, 1, 2, 2, 0, 0], // 25
+	[3, 2, 1, 2, 2, 1, 0, 0], // 26
+	[3, 1, 2, 2, 1, 2, 0, 0], // 27
+	[3, 2, 2, 1, 1, 2, 0, 0], // 28
+	[3, 2, 2, 2, 1, 1, 0, 0], // 29
+	[2, 1, 2, 1, 2, 3, 0, 0], // 30
+	[2, 1, 2, 3, 2, 1, 0, 0], // 31
+	[2, 3, 2, 1, 2, 1, 0, 0], // 32
+	[1, 1, 1, 3, 2, 3, 0, 0], // 33
+	[1, 3, 1, 1, 2, 3, 0, 0], // 34
+	[1, 3, 1, 3, 2, 1, 0, 0], // 35
+	[1, 1, 2, 3, 1, 3, 0, 0], // 36
+	[1, 3, 2, 1, 1, 3, 0, 0], // 37
+	[1, 3, 2, 3, 1, 1, 0, 0], // 38
+	[2, 1, 1, 3, 1, 3, 0, 0], // 39
+	[2, 3, 1, 1, 1, 3, 0, 0], // 40
+	[2, 3, 1, 3, 1, 1, 0, 0], // 41
+	[1, 1, 2, 1, 3, 3, 0, 0], // 42
+	[1, 1, 2, 3, 3, 1, 0, 0], // 43
+	[1, 3, 2, 1, 3, 1, 0, 0], // 44
+	[1, 1, 3, 1, 2, 3, 0, 0], // 45
+	[1, 1, 3, 3, 2, 1, 0, 0], // 46
+	[1, 3, 3, 1, 2, 1, 0, 0], // 47
+	[3, 1, 3, 1, 2, 1, 0, 0], // 48
+	[2, 1, 1, 3, 3, 1, 0, 0], // 49
+	[2, 3, 1, 1, 3, 1, 0, 0], // 50
+	[2, 1, 3, 1, 1, 3, 0, 0], // 51
+	[2, 1, 3, 3, 1, 1, 0, 0], // 52
+	[2, 1, 3, 1, 3, 1, 0, 0], // 53
+	[3, 1, 1, 1, 2, 3, 0, 0], // 54
+	[3, 1, 1, 3, 2, 1, 0, 0], // 55
+	[3, 3, 1, 1, 2, 1, 0, 0], // 56
+	[3, 1, 2, 1, 1, 3, 0, 0], // 57
+	[3, 1, 2, 3, 1, 1, 0, 0], // 58
+	[3, 3, 2, 1, 1, 1, 0, 0], // 59
+	[3, 1, 4, 1, 1, 1, 0, 0], // 60
+	[2, 2, 1, 4, 1, 1, 0, 0], // 61
+	[4, 3, 1, 1, 1, 1, 0, 0], // 62
+	[1, 1, 1, 2, 2, 4, 0, 0], // 63
+	[1, 1, 1, 4, 2, 2, 0, 0], // 64
+	[1, 2, 1, 1, 2, 4, 0, 0], // 65
+	[1, 2, 1, 4, 2, 1, 0, 0], // 66
+	[1, 4, 1, 1, 2, 2, 0, 0], // 67
+	[1, 4, 1, 2, 2, 1, 0, 0], // 68
+	[1, 1, 2, 2, 1, 4, 0, 0], // 69
+	[1, 1, 2, 4, 1, 2, 0, 0], // 70
+	[1, 2, 2, 1, 1, 4, 0, 0], // 71
+	[1, 2, 2, 4, 1, 1, 0, 0], // 72
+	[1, 4, 2, 1, 1, 2, 0, 0], // 73
+	[1, 4, 2, 2, 1, 1, 0, 0], // 74
+	[2, 4, 1, 2, 1, 1, 0, 0], // 75
+	[2, 2, 1, 1, 1, 4, 0, 0], // 76
+	[4, 1, 3, 1, 1, 1, 0, 0], // 77
+	[2, 4, 1, 1, 1, 2, 0, 0], // 78
+	[1, 3, 4, 1, 1, 1, 0, 0], // 79
+	[1, 1, 1, 2, 4, 2, 0, 0], // 80
+	[1, 2, 1, 1, 4, 2, 0, 0], // 81
+	[1, 2, 1, 2, 4, 1, 0, 0], // 82
+	[1, 1, 4, 2, 1, 2, 0, 0], // 83
+	[1, 2, 4, 1, 1, 2, 0, 0], // 84
+	[1, 2, 4, 2, 1, 1, 0, 0], // 85
+	[4, 1, 1, 2, 1, 2, 0, 0], // 86
+	[4, 2, 1, 1, 1, 2, 0, 0], // 87
+	[4, 2, 1, 2, 1, 1, 0, 0], // 88
+	[2, 1, 2, 1, 4, 1, 0, 0], // 89
+	[2, 1, 4, 1, 2, 1, 0, 0], // 90
+	[4, 1, 2, 1, 2, 1, 0, 0], // 91
+	[1, 1, 1, 1, 4, 3, 0, 0], // 92
+	[1, 1, 1, 3, 4, 1, 0, 0], // 93
+	[1, 3, 1, 1, 4, 1, 0, 0], // 94
+	[1, 1, 4, 1, 1, 3, 0, 0], // 95
+	[1, 1, 4, 3, 1, 1, 0, 0], // 96
+	[4, 1, 1, 1, 1, 3, 0, 0], // 97
+	[4, 1, 1, 3, 1, 1, 0, 0], // 98
+	[1, 1, 3, 1, 4, 1, 0, 0], // 99
+	[1, 1, 4, 1, 3, 1, 0, 0], // 100
+	[3, 1, 1, 1, 4, 1, 0, 0], // 101
+	[4, 1, 1, 1, 3, 1, 0, 0], // 102
+	[2, 1, 1, 4, 1, 2, 0, 0], // 103
+	[2, 1, 1, 2, 1, 4, 0, 0], // 104
+	[2, 1, 1, 2, 3, 2, 0, 0], // 105
+	[2, 3, 3, 1, 1, 1, 2, 0] // 106
+]

+ 111 - 0
common/index.scss

@@ -0,0 +1,111 @@
+// 颜色
+$color-blue:#3387FF;
+$color-white:#FFFFFF;
+// 字体大小
+$font_size_34:34rpx;
+$font_size_36:36rpx;
+
+page{
+	background-color: #fff;
+}
+.but_button690{
+	margin: 10rpx;
+	width: 690rpx;
+	height: 88rpx;
+	font-size: $font_size_34;
+	font-weight: normal;
+}
+.but_button630{
+	margin: 10rpx;
+	width: 630rpx;
+	height: 88rpx;
+	font-size: $font_size_34;
+	font-weight: normal;
+}
+
+.center_in_sequence{
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+}
+.center_in{
+	width: 100%;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+.space_between{
+	width: 100%;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+}
+.safeDistance{
+	padding-top: constant(safe-area-inset-top);
+	padding-top: env(safe-area-inset-top);
+}
+.up_and_down{
+	display: flex;
+	flex-direction: column;
+	justify-content: space-between;
+	align-items: center;
+}
+.font36{
+	font-size: $font_size_36;
+	font-weight: bold;
+	text-align: left;
+	color: #333;
+}
+
+	.btn_print {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		background-color: #fff;
+		padding: 20rpx;
+	}
+.wx_card {
+		position: fixed;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		bottom: 50rpx;
+		left: 0rpx;
+		right: 0rpx;
+		margin-bottom: 50rpx;
+	}
+
+	.card_btn_wx {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 70rpx;
+		height: 70rpx;
+		border-radius: 50%;
+	}
+
+	// 伪元素1rpx边框
+	.frame {
+		position: relative; //重要
+	}
+
+	.frame::after {
+		position: absolute;
+		content: '';
+		border: 2rpx solid #b4b3b1;
+		border-radius: 50%;
+		width: 200%;
+		height: 200%;
+		top: 0;
+		left: 0;
+		transform: scale(0.5);
+		transform-origin: 0 0;
+		pointer-events: none;
+		/* 使伪元素不会阻止鼠标事件 */
+	}
+
+	.title_login_wx {
+		font-size: 26rpx;
+		margin-top: 12rpx;
+	}

+ 22 - 0
components/x-barCode.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		<canvas class="bar_code" canvas-id="Brcode"></canvas>
+	</view>
+</template>
+
+<script>
+	import brCode from "../common/barcode.js"
+	export default {
+		data() {
+			return {}
+		},
+		mounted() {
+			brCode.code128(uni.createCanvasContext('Brcode'), '23627747723', 300, 90);
+		},
+		methods: {}
+	}
+</script>
+
+<style lang="scss">
+	.bar_code {}
+</style>

+ 67 - 0
components/x-bluetooth.vue

@@ -0,0 +1,67 @@
+<template>
+	<view>
+		<view class="card_item_tooth" v-for="(item,index) in list" :key="index">
+			<view class="card_wifi">
+				<u-icon name="wifi" color="#2979ff" size="26"></u-icon>
+				<view class="wifi_item_title">{{item.name}}</view>
+			</view>
+			<view>
+				<u-button size="small" :type="btnType" :text="text" @click="connect(item)"></u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'x-bluetooth',
+		props: {
+			list: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			text: {
+				type: String,
+				default () {
+					return '连接'
+				}
+			},
+			btnType: {
+				type: String,
+				default () {
+					return 'primary'
+				}
+			},
+		},
+		data() {
+			return {}
+		},
+		mounted() {},
+		methods: {
+			connect(value) {
+				this.$emit('connect', value)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.card_item_tooth {
+		padding: 20rpx 0rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
+
+	.card_wifi {
+		display: flex;
+		align-items: center;
+	}
+
+	.wifi_item_title {
+		font-size: 28rpx;
+		margin-left: 16rpx;
+	}
+</style>

+ 66 - 0
components/x-checkbox.vue

@@ -0,0 +1,66 @@
+<template>
+	<view class="checkbox-container">
+		<view class="checkbox" :class="{'checkbox-checked': isChecked}">
+			<!-- 复选框内部可以放一个小图标或者其他装饰 -->
+			<text v-if="isChecked" class="checkbox-icon">
+				<u-icon name="checkbox-mark" color="#fff"></u-icon>
+			</text>
+		</view>
+		<text class="check_title">{{ label }}</text>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			label: String, // 复选框旁边的文本
+			isChecked: Boolean, // 复选框旁边的文本
+		},
+		data() {
+			return {};
+		},
+		methods: {
+			toggleCheck() {
+				// this.isChecked = !this.isChecked;
+				// 触发自定义事件,可以在父组件中监听该事件
+				// this.$emit('change', this.isChecked);
+			},
+		},
+	};
+</script>
+
+<style scoped>
+	.checkbox-container {
+		display: flex;
+		align-items: center;
+	}
+
+	.checkbox {
+		width: 35rpx;
+		height: 35rpx;
+		border: 1rpx solid #ccc;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin-right: 10rpx;
+		border-radius: 8rpx;
+		user-select: none;
+		cursor: pointer;
+	}
+
+	.check_title {
+		margin-left: 5rpx;
+		font-size: 32rpx;
+		font-weight: 600;
+	}
+
+	.checkbox-checked {
+		border-color: #2979ff;
+		background-color: #2979ff;
+	}
+
+	.checkbox-icon {
+		color: #fff;
+		font-size: 24rpx;
+	}
+</style>

+ 110 - 0
components/x-form.vue

@@ -0,0 +1,110 @@
+<template>
+	<!-- 表单 -->
+	<view style="margin: 0rpx 20rpx 0rpx 30rpx;">
+		<u--form :model="model" :rules="rules" labelPosition="left" ref="uForm" labelWidth="70">
+			<view v-for="(item,index) in list" :key="index">
+				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
+					v-if="item.type == 'input'">
+					<view class="card_form_item">
+						<u--input v-model="model[`${item.field}`]" :disabled="item.disabled ? true : false"
+							:placeholder="item.placeholder"></u--input>
+					</view>
+				</u-form-item>
+				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
+					v-else-if="item.type == 'select'">
+					<view class="card_form_item">
+						<u--input :placeholder="item.placeholder" suffixIcon="arrow-down"
+							v-model="model[`${item.field}`]" @focus="change(item)"></u--input>
+					</view>
+				</u-form-item>
+				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
+					v-else-if="item.type == 'textarea'">
+					<view class="card_form_item">
+						<u--textarea v-model="model[`${item.field}`]" autoHeight
+							:placeholder="item.placeholder"></u--textarea>
+					</view>
+				</u-form-item>
+			</view>
+		</u--form>
+		<u-picker :defaultIndex="findIndex(model[fieldType], columns[0])" :show="show" :columns="columns"
+			keyName="label" @confirm="confirm($event, fieldType)" @cancel="cancel"></u-picker>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'x-form',
+		props: {
+			list: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			model: {
+				type: Object,
+				default () {
+					return {}
+				}
+			},
+			rules: {
+				type: Object,
+				default () {
+					return {}
+				}
+			},
+		},
+		data() {
+			return {
+				show: false,
+				columns: [],
+				fieldType: '',
+			}
+		},
+		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		methods: {
+			change(e) {
+				this.columns = []
+				this.fieldType = e.field
+				this.show = true
+				this.$nextTick(() => {
+					this.columns.push(e.options)
+				})
+			},
+			// 选择确定
+			confirm(value, type) {
+				this.show = false
+				this.model[type] = value.value[0].label
+			},
+			// 点击确定
+			cancel() {
+				this.show = false
+			},
+			findIndex(code, list) {
+				if (!code || !list) {
+					return [0]
+				}
+				return [list.findIndex((item) => (item.label === code || item.label === code))]
+			},
+			//子组件校验,传递到父组件
+			async validateForm() {
+				let flag = null
+				await this.$refs.uForm.validate(valid => {}).then(res => {
+					flag = true
+				}).catch(err => {
+					flag = false
+				})
+				return flag
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	.card_form_item {
+		width: 100%;
+	}
+</style>

+ 153 - 0
components/x-humiture.vue

@@ -0,0 +1,153 @@
+<template>
+	<view style="width: 100%;">
+		<view class="sub_card" v-if="probeList.length > 0">
+			<u-subsection :list="probeList" :current="current" keyName="T_name" @change="sectionChange1"></u-subsection>
+		</view>
+		<view class="card_humiture border_humiture" v-if="humitureData.length > 0">
+			<view class="headline_item w_wsd">温度(°C)</view>
+			<view class="headline_item w_wsd">湿度(Rh)</view>
+			<view class="headline_item w_time">时间</view>
+		</view>
+		<view class="card_record" v-if="humitureData.length > 0">
+			<scroll-view class="scroll-view" scroll-y="true" @scrolltolower="loadMore">
+				<view class="card_humiture" v-for="(item,index) in humitureData" :key="index">
+					<view class="title_item w_wsd">{{item.T_t || ''}}</view>
+					<view class="title_item w_wsd">{{item.T_rh || ''}}</view>
+					<view class="title_item w_time">{{item.T_time || ''}}</view>
+				</view>
+			</scroll-view>
+		</view>
+		<view v-else style="padding: 30rpx 0rpx;">
+			<u-empty mode="data" text="暂无温湿度记录"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'Xhumiture',
+		props: {
+			probeList: {
+				type: Array,
+				default: () => [],
+			},
+			waybillNo: {
+				type: String,
+				default: () => '',
+			},
+			taskId: {
+				type: Number,
+				default: () => null,
+			},
+		},
+		data() {
+			return {
+				current: 0,
+				loadingMore: true,
+				pageSize: 10,
+				currentPage: 1,
+				tIds: [],
+				humitureData: [],
+				loading: ''
+			}
+		},
+		mounted() {
+			// this.getProbe()
+		},
+		methods: {
+			getlist(num) {
+				this.currentPage = 1
+				this.getList(num)
+			},
+			getList(tIds) {
+				this.loadingMore = true;
+				this.tIds = []
+				this.tIds.push(tIds)
+
+				function methods1(arr) {
+					return Array.from(new Set(arr));
+				}
+				this.tIds = methods1(this.tIds)
+				let params = {
+					t_ids: this.tIds,
+					taskId: this.taskId,
+					waybillNo: this.waybillNo,
+					page: this.currentPage,
+					pageSize: this.pageSize,
+				}
+				this.$api.post('/api/waybill-task/data', params).then(res => {
+					if (res.code == 200) {
+						const data = res.data.list
+						if (this.loadingMore == true && data) {
+							this.humitureData = this.humitureData.concat(data);
+						}
+						if (this.humitureData.length < this.pageSize) {
+							this.loadingMore = true
+							this.loading = '没有更多了'
+						} else {
+							this.loadingMore = false
+							this.currentPage++
+						}
+					}
+				})
+			},
+			sectionChange1(value) {
+				this.current = value
+				this.currentPage = 1
+				this.humitureData = []
+				const num = this.probeList[value].T_id
+				this.getList(num)
+			},
+			// 滚动加载更多
+			loadMore() {
+				this.getList(this.tIds[0]);
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.sub_card {
+		margin: 0rpx 20rpx 20rpx 20rpx;
+	}
+
+	.card_humiture {
+		width: 100%;
+		display: flex;
+		align-items: center;
+		padding: 20rpx 0rpx;
+		margin-bottom: 10rpx;
+	}
+
+	.border_humiture {
+		border-bottom: 1rpx solid #EBEEF5;
+	}
+
+	.headline_item {
+		font-size: 30rpx;
+		font-weight: 600;
+	}
+
+	.title_item {
+		font-size: 28rpx
+	}
+
+	.w_wsd {
+		text-align: center;
+		width: 27%;
+	}
+
+	.w_time {
+		text-align: center;
+		width: 46%;
+	}
+
+	.card_record {
+		margin-bottom: 20rpx;
+	}
+
+	.scroll-view {
+		max-height: 500rpx;
+		overflow: hidden;
+	}
+</style>

+ 97 - 0
components/x-navbottom.vue

@@ -0,0 +1,97 @@
+<template>
+	<!-- 底部tabbar -->
+	<view class="navmainbox">
+		<view class="navigation">
+			<view class="navcont" v-for="(item,index) in list" :key="index" @click="gonavs(item,index)">
+				<span class="iconfont icon_image" :class="[item.icon,nowchos == index ? 'activeName' :'']"></span>
+				<view class="navchosbox" :class="nowchos == index ? 'activeName' :''">
+					{{item.title}}
+				</view>
+			</view>
+		</view>
+		<!-- //防止 固定的底部菜单遮挡页面上的内容 -->
+		<view class="navmainbox" style="position: relative;opacity: 0;z-index: 0;">
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'x-navbottom',
+		props: {
+			nowchos: {
+				type: Number,
+				default () {
+					return 0
+				}
+			},
+		},
+		data() {
+			return {
+				dataList: [],
+				list: [{
+						icon: 'icon-shouye',
+						title: '首页',
+					},
+					{
+						icon: 'icon-wode',
+						title: '我的',
+					}
+				],
+			}
+		},
+		mounted() {},
+		methods: {
+			gonavs(e, cindex) {
+				this.$emit('botomchos', cindex)
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.navmainbox {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		z-index: 5;
+		background-color: #ffffff;
+		box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
+		width: 100%;
+		height: 100rpx;
+		padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
+		padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
+	}
+
+	.navigation {
+		z-index: 2024;
+		position: relative;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100rpx;
+		padding-bottom: var(--window-bottom);
+	}
+
+	.navigation .navcont {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		flex: 1;
+	}
+
+	.navchosbox {
+		color: #727289 !important;
+		margin-top: 2rpx;
+		font-size: 26rpx;
+	}
+
+	.activeName {
+		color: #3E80FF !important;
+	}
+
+	.icon_image {
+		font-size: 44rpx;
+	}
+</style>

+ 45 - 0
components/x-orderCard.vue

@@ -0,0 +1,45 @@
+<template>
+	<!-- 订单详情表单 -->
+	<view class="card_ordercard">
+		<view class="title_detail"><span>姓名:</span>{{list.name}}</view>
+		<view class="title_detail"><span>联系方式:</span>{{list.phone}}</view>
+		<view class="title_detail"><span>地址:</span>{{list.address}}</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'x-orderCard',
+		props: {
+			list: {
+				type: Object,
+				default () {
+					return {}
+				}
+			},
+		},
+		data() {
+			return {
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.card_ordercard {
+		border-radius: 20rpx;
+		padding: 20rpx;
+		background-color: #fff;
+	}
+
+	.title_detail {
+		margin: 10rpx 0rpx;
+
+		span {
+			font-size: 28rpx;
+			color: #909399;
+			margin-right: 10rpx;
+		}
+	}
+</style>

+ 201 - 0
components/x-orderManagement.vue

@@ -0,0 +1,201 @@
+<template>
+	<view style="width: 100%;">
+		<view class="card_ordermang" v-for="(item,index) in orderList" :key="index" @click="goOrderDetails(item)">
+			<view class="head_ordermang space_between">
+				<view class="waybill_title">运单号:<span>{{item.waybillNo}}</span></view>
+				<span class="card_state" :style="{color:getState(item.status)}">{{orderStatus(item.status)}}</span>
+			</view>
+			<view class="card_specification">
+				<view class="specification_title">
+					<u-tag :text="item.temperatureInterval" plain size="mini" type="success"
+						@click="goOrderDetails(item)"></u-tag>
+				</view>
+				<view class="specification_title">
+					<u-tag :text="item.deliveryCondition" plain size="mini" type="primary"
+						@click="goOrderDetails(item)"></u-tag>
+				</view>
+				<view class="specification_title">
+					<u-tag :text="item.cargoType" plain size="mini" type="warning"
+						@click="goOrderDetails(item)"></u-tag>
+				</view>
+			</view>
+			<view class="title_ordermang"><span>收货地址:</span>{{item.consigneeAddressDetails}}</view>
+			<view class="title_ordermang"><span>收货电话:</span>{{item.consigneeAddressPhone}}</view>
+			<view class="title_ordermang"><span>下单时间:</span>{{item.orderTime}}</view>
+			<view class="btn_printil"
+				v-if="item.status == 2 && userInfo.userType === 'sys' || item.status == 3 && userInfo.userType === 'sys'"
+				@click.stop="printBarCode(item)">
+				<u-button size="small" type="primary" text="打印条码"></u-button>
+			</view>
+			<view class="btn_printil" v-if="item.status == 8 && userInfo.userType == 'sys'"
+				@click.stop="humidityRecording(item)">
+				<u-button size="small" type="warning" text="打印温湿度记录"></u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'xOrderManagement',
+		props: {
+			// 订单列表
+			orderList: {
+				type: Array,
+				default: () => [],
+			},
+			userInfo: {
+				type: Object,
+				default: () => {},
+			}
+		},
+		data() {
+			return {}
+		},
+		mounted() {
+			// console.log(this.userInfo, 26)
+		},
+		methods: {
+			// 打印条码
+			printBarCode(value) {
+				this.$cache.setCache('commodity', JSON.stringify(value))
+				uni.navigateTo({
+					url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=barCode'
+				});
+			},
+			// 打印温湿度记录
+			humidityRecording(value) {
+				this.$cache.setCache('commodity', JSON.stringify(value))
+				uni.navigateTo({
+					url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=record'
+				});
+			},
+			// 订单详情
+			goOrderDetails(value) {
+				this.$cache.setCache('orderDetails', value)
+				uni.navigateTo({
+					url: '/pages/order/orderDetails?type=details'
+				});
+			},
+			// 订单状态
+			orderStatus(value) {
+				if (this.userInfo.userType == 'sys') {
+					if (this.userInfo.type == 2) {
+						// 仓管
+						if (value == 3) {
+							return '未入库'
+						} else if (value == 5) {
+							return '已入库'
+						} else {
+							return '已出库'
+						}
+					} else if (this.userInfo.type == 3) {
+						// 司机
+						if (value == 2) {
+							return '未装车'
+						} else if (value == 4) {
+							return '已装车'
+						} else if (value == 6) {
+							return '已下车'
+						} else {
+							return '已签收'
+						}
+					}
+				} else {
+					if (value == 1 || value == 2 || value == 3) {
+						return '未发货'
+					} else if (value == 4 || value == 5 || value == 6 || value == 7) {
+						return '已发货'
+					} else {
+						return '已签收'
+					}
+				}
+			},
+			// 订单文字颜色
+			getState(value) {
+				if (this.userInfo.userType == 'sys') {
+					if (this.userInfo.type == 2) {
+						// 仓管
+						if (value == 3) {
+							return '#ff9900'
+						} else if (value == 5) {
+							return '#19be6b'
+						} else {
+							return '#606266'
+						}
+					} else if (this.userInfo.type == 3) {
+						// 司机
+						if (value == 2) {
+							return '#ff9900'
+						} else if (value == 4) {
+							return '#19be6b'
+						} else if (value == 6) {
+							return '#19be6b'
+						} else {
+							return '#606266'
+						}
+					}
+				} else {
+					if (value == 1 || value == 2 || value == 3) {
+						return '#ff9900'
+					} else if (value == 4 || value == 5 || value == 6 || value == 7) {
+						return '#19be6b'
+					} else {
+						return '#606266'
+					}
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.card_ordermang {
+		background-color: #fff;
+		padding: 20rpx;
+		border-radius: 20rpx;
+		margin: 20rpx;
+	}
+
+	.head_ordermang {
+		margin-bottom: 10rpx;
+	}
+
+	.title_ordermang {
+		margin-top: 10rpx;
+		font-size: 26rpx;
+		color: #909399;
+
+		span {
+			font-size: 26rpx;
+			color: #909399;
+			margin-right: 10rpx;
+		}
+	}
+
+	.waybill_title {
+		font-size: 32rpx;
+
+		span {
+			margin-left: 10rpx;
+		}
+	}
+
+	.card_state {
+		color: #606266;
+		font-size: 32rpx;
+	}
+
+	.card_specification {
+		display: flex;
+		align-items: center;
+	}
+
+	.specification_title {
+		margin-right: 20rpx;
+	}
+
+	.btn_printil {
+		margin-top: 20rpx;
+	}
+</style>

+ 34 - 0
components/x-radar.vue

@@ -0,0 +1,34 @@
+<template>
+	<!-- 雷达扫描 -->
+	<view>
+		<view class="radar1">
+			<view class="search" :class="BlueState?'startSearch':''"></view>
+			<view class="radar2">
+				<view class="radar3">
+					<view class="radar4">
+					</view>	
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props:['BlueState'],
+		data() {
+			return {
+
+			};
+		},
+		watch:{
+			BlueState(val){
+				// console.log('状态发生变化',val)
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import '../static/css/styles.scss';
+</style>

+ 218 - 0
components/x-statistics.vue

@@ -0,0 +1,218 @@
+<template>
+	<!-- 首页统计 -->
+	<view class="home_card">
+		<view class="card_item_home" v-for="(item,index) in list" :key="index" @click="goOrder(index)">
+			<view class="home_head">
+				<view class="home_line" :style="{backgroundColor:item.color,}"></view>
+				<view class="home_item_title">{{item.value || 0}}</view>
+			</view>
+			<view class="item_subheading">{{item.title}}</view>
+			<view class="home_bottom_item">
+				<view class="home_right_icon center_in">
+					<u-icon name="arrow-right" size="15" color="#fff"></u-icon>
+				</view>
+				<span :style="{color: item.color}" class="iconfont home_icon_image" :class="item.icon"></span>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'XStatistics',
+		props: {
+			userType: {
+				type: Number,
+				default: 1,
+			},
+			orderStatistics: {
+				type: Object,
+				default: {},
+			},
+		},
+		data() {
+			return {
+				list: [],
+				list1: [{
+					sign: 0,
+					id: 'detailsil',
+					title: '全部',
+					icon: 'icon-cheliangxinxi',
+					color: '#4bc7fc',
+					value: null,
+				}, {
+					sign: 3,
+					id: 'truck',
+					title: '未入库',
+					icon: 'icon-chukudan',
+					color: '#fece56',
+					value: null,
+				}, {
+					sign: 5,
+					id: 'signfor',
+					title: '已入库',
+					icon: 'icon-fankudengji',
+					color: '#9ddd54',
+					value: null,
+				}, {
+					sign: 7,
+					id: 'add',
+					title: '已出库',
+					icon: 'icon-yidaoda',
+					color: '#1cc723',
+					value: null,
+				}],
+				list2: [{
+					sign: 0,
+					id: 'detailsil',
+					title: '全部',
+					icon: 'icon-cheliangxinxi',
+					color: '#4bc7fc',
+					value: null,
+				}, {
+					sign: 2,
+					id: 'truck',
+					title: '未装车',
+					icon: 'icon-fankudengji',
+					color: '#fece56',
+					value: null,
+				}, {
+					sign: 4,
+					id: 'signfor',
+					title: '已装车',
+					icon: 'icon-yidaoda',
+					color: '#9ddd54',
+					value: null,
+				}, {
+					sign: 8,
+					id: 'add',
+					title: '已签收',
+					icon: 'icon-qianshou_fill',
+					color: '#1cc723',
+					value: null,
+				}],
+				list3: [{
+					sign: 0,
+					id: 'detailsil',
+					title: '全部',
+					icon: 'icon-cheliangxinxi',
+					color: '#4bc7fc',
+					value: null,
+				}, {
+					sign: 1,
+					id: 'truck',
+					title: '未发货',
+					icon: 'icon-weifahuo',
+					color: '#fece56',
+					value: null,
+				}, {
+					sign: 2,
+					id: 'signfor',
+					title: '已发货',
+					icon: 'icon-yifahuo',
+					color: '#9ddd54',
+					value: null,
+				}, {
+					sign: 3,
+					id: 'add',
+					title: '已签收',
+					icon: 'icon-qianshou_fill',
+					color: '#1cc723',
+					value: null,
+				}],
+				token: '',
+			}
+		},
+		created() {
+			if (this.userType == 1) {
+				this.list = this.list1
+			} else if (this.userType == 2) {
+				this.list = this.list2
+			} else if (this.userType == 3) {
+				this.list = this.list3
+			}
+			for (let key in this.orderStatistics) {
+				this.list.forEach((item, index) => {
+					if (key == item.sign) {
+						item.value = this.orderStatistics[key]
+					}
+				})
+			}
+		},
+		mounted() {
+			var token = this.$cache.getToken()
+			this.token = token
+		},
+		methods: {
+			// 订单页面
+			goOrder(index) {
+				if (this.token) {
+					uni.navigateTo({
+						url: '/pages/order/index?current=' + index
+					});
+				} else {
+					uni.$u.toast('请先登录')
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.home_card {
+		display: flex;
+		flex-direction: row;
+		flex-wrap: wrap;
+		justify-content: space-evenly;
+	}
+
+	.home_head {
+		margin-top: 30rpx;
+		display: flex;
+		align-items: center;
+	}
+
+	.home_line {
+		width: 8rpx;
+		height: 40rpx;
+		border-top-right-radius: 4rpx;
+		border-bottom-right-radius: 4rpx;
+	}
+
+	.home_item_title {
+		margin-left: 20rpx;
+		font-size: 50rpx;
+		font-weight: 600;
+	}
+
+	.item_subheading {
+		margin-left: 20rpx;
+		font-size: 30rpx;
+		color: #909399;
+	}
+
+	.card_item_home {
+		margin-top: 20rpx;
+		width: calc(50% - 40rpx);
+		background-color: #fff;
+		border-radius: 20rpx;
+	}
+
+	.home_bottom_item {
+		margin: 30rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: baseline;
+	}
+
+	.home_right_icon {
+		width: 44rpx;
+		height: 44rpx;
+		background-color: #e7e6e4;
+		border-radius: 50%;
+	}
+
+	.home_icon_image {
+		font-size: 70rpx;
+	}
+</style>

+ 169 - 0
components/x-steps.vue

@@ -0,0 +1,169 @@
+<template>
+	<!-- 获取一个数组,结构为
+  [{
+    nodeName:"流程发起"
+    isAudit:false
+    time:"2024-02-04 14:27:35"
+    otherData:{
+      assignee:{
+      userId:"465"
+      name:"XXX"
+      company:"测试产业单位1"
+      tenantId:"140"
+    }
+  }] -->
+	<view class="bg">
+		<view class="steps">
+			<view class="steps_item" v-for="(i, index) in infoList" :key="index">
+				<view class="s_r">
+					<view class="line" :style="{ backgroundColor: index != 0 ? '#EAEAEA' : 'rgba(0,0,0,0)' }"></view>
+					<view class="index" :style="{ backgroundColor: backgroundColor, color: color }"></view>
+					<view class="line"
+						:style="{ backgroundColor: index != infoList.length - 1 ? '#EAEAEA' : 'rgba(0,0,0,0)' }"></view>
+				</view>
+				<view class="s_l">
+					<view class="info_item">
+						<!-- 真是节点名称、时间 -->
+						<view class="top_info">
+							<view class="title">{{ i.text }}</view>
+							<view class="date">{{ i.createdAt || '测试产业单位'}}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'XSteps',
+		props: {
+			infoList: {
+				type: Array,
+				default: [],
+			},
+			color: {
+				type: String,
+				default: '#fff',
+			},
+			backgroundColor: {
+				type: String,
+				default: '#2979ff',
+			},
+			lineNum: {
+				type: Number,
+				default: 0,
+			},
+		},
+		methods: {
+			// 审核状态
+			auditStatus(i) {
+				if (i == 2) {
+					return {
+						text: '通过',
+						color: '#00D288',
+						bgColor: '#EAFFF8',
+					}
+				} else if (i == 3) {
+					return {
+						text: '驳回',
+						color: '#FF4141',
+						bgColor: '#FFDCD5',
+					}
+				}
+			},
+			handlePreview(url) {
+				uni.previewImage({
+					urls: [url]
+				})
+			},
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.steps {
+		display: flex;
+		flex-direction: column;
+
+		.steps_item {
+			display: flex;
+
+			.s_r {
+				padding: 0 20rpx;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+
+				.line {
+					flex: 1;
+					width: 5rpx;
+				}
+
+				.index {
+					width: 24rpx;
+					height: 24rpx;
+					border-radius: 50rpx;
+					border: 4rpx solid #e3eeff;
+					box-sizing: border-box;
+				}
+			}
+
+			.s_l {
+				display: flex;
+				flex-direction: column;
+				padding: 20rpx 0;
+				flex: 1;
+
+				.info_item {
+					background-color: #ffffff;
+					margin-right: 30rpx;
+					border-radius: 10rpx;
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+
+					.top_info {
+						display: flex;
+						flex-direction: column;
+					}
+
+					text {
+						font-size: 24rpx;
+						font-weight: 500;
+						color: rgba(51, 51, 51, 1);
+					}
+
+					.title {
+						width: 100%;
+						font-size: 28rpx;
+						font-weight: 500;
+						color: rgba(102, 102, 102, 1);
+						overflow: hidden;
+						text-overflow: ellipsis;
+						display: -webkit-box;
+						flex-direction: column;
+					}
+
+					.date {
+						font-size: 23rpx;
+						color: #afb4be;
+					}
+				}
+
+				.info_item:active {
+					background-color: #f4f4f4;
+				}
+			}
+		}
+	}
+
+	.ml5 {
+		margin-left: 10rpx;
+	}
+
+	.mt10 {
+		margin-top: 20rpx;
+	}
+</style>

+ 20 - 0
index.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <script>
+      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
+        CSS.supports('top: constant(a)'))
+      document.write(
+        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+    </script>
+    <title></title>
+    <!--preload-links-->
+    <!--app-context-->
+  </head>
+  <body>
+    <div id="app"><!--app-html--></div>
+    <script type="module" src="/main.js"></script>
+  </body>
+</html>

+ 33 - 0
main.js

@@ -0,0 +1,33 @@
+import App from './App'
+
+// 引入全局uView
+import uView from 'uview-ui';
+Vue.use(uView);
+
+import request from './utils/request.js'
+import Storage from './store/storage.js'
+Vue.prototype.$api = request
+Vue.prototype.$cache = Storage
+
+// #ifndef VUE3
+import Vue from 'vue'
+import './uni.promisify.adaptor'
+Vue.config.productionTip = false
+App.mpType = 'app'
+const app = new Vue({
+	...App
+})
+app.$mount()
+// #endif
+
+// #ifdef VUE3
+import {
+	createSSRApp
+} from 'vue'
+export function createApp() {
+	const app = createSSRApp(App)
+	return {
+		app
+	}
+}
+// #endif

+ 131 - 0
manifest.json

@@ -0,0 +1,131 @@
+{
+    "name" : "宝智达冷链物流",
+    "appid" : "__UNI__92DFF97",
+    "description" : "",
+    "versionName" : "1.0.2",
+    "versionCode" : 300,
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        /* 模块配置 */
+        "modules" : {
+            "Maps" : {},
+            "Bluetooth" : {}
+        },
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {
+                "dSYMs" : false
+            },
+            /* SDK配置 */
+            "sdkConfigs" : {
+                "geolocation" : {},
+                "maps" : {
+                    "amap" : {
+                        "name" : "amapzQIiQLSo",
+                        "appkey_ios" : "1",
+                        "appkey_android" : "042f12d3f6f07494669e8eef6ebd301a"
+                    }
+                },
+                "ad" : {}
+            },
+            "icons" : {
+                "android" : {
+                    "hdpi" : "unpackage/res/icons/72x72.png",
+                    "xhdpi" : "unpackage/res/icons/96x96.png",
+                    "xxhdpi" : "unpackage/res/icons/144x144.png",
+                    "xxxhdpi" : "unpackage/res/icons/192x192.png"
+                },
+                "ios" : {
+                    "appstore" : "unpackage/res/icons/1024x1024.png",
+                    "ipad" : {
+                        "app" : "unpackage/res/icons/76x76.png",
+                        "app@2x" : "unpackage/res/icons/152x152.png",
+                        "notification" : "unpackage/res/icons/20x20.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "proapp@2x" : "unpackage/res/icons/167x167.png",
+                        "settings" : "unpackage/res/icons/29x29.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "spotlight" : "unpackage/res/icons/40x40.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png"
+                    },
+                    "iphone" : {
+                        "app@2x" : "unpackage/res/icons/120x120.png",
+                        "app@3x" : "unpackage/res/icons/180x180.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "notification@3x" : "unpackage/res/icons/60x60.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "settings@3x" : "unpackage/res/icons/87x87.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png",
+                        "spotlight@3x" : "unpackage/res/icons/120x120.png"
+                    }
+                }
+            }
+        }
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "usingComponents" : true,
+        "permission" : {}
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "vueVersion" : "2",
+    "h5" : {
+        "sdkConfigs" : {
+            "maps" : {
+                "amap" : {
+                    "key" : "7c0390cf6ae1cd6afeef85becf6fa515",
+                    "securityJsCode" : "fb3133f64cddac06df9888ec1a4b3ad5",
+                    "serviceHost" : ""
+                }
+            }
+        }
+    }
+}

+ 66 - 0
node_modules/.package-lock.json

@@ -0,0 +1,66 @@
+{
+  "name": "baozhida-logistics-app",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {
+    "node_modules/array-parallel": {
+      "version": "0.1.3",
+      "resolved": "https://registry.npmmirror.com/array-parallel/-/array-parallel-0.1.3.tgz",
+      "integrity": "sha512-TDPTwSWW5E4oiFiKmz6RGJ/a80Y91GuLgUYuLd49+XBS75tYo8PNgaT2K/OxuQYqkoI852MDGBorg9OcUSTQ8w=="
+    },
+    "node_modules/array-series": {
+      "version": "0.1.5",
+      "resolved": "https://registry.npmmirror.com/array-series/-/array-series-0.1.5.tgz",
+      "integrity": "sha512-L0XlBwfx9QetHOsbLDrE/vh2t018w9462HM3iaFfxRiK83aJjAt/Ja3NMkOW7FICwWTlQBa3ZbL5FKhuQWkDrg=="
+    },
+    "node_modules/barcode": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmmirror.com/barcode/-/barcode-0.1.0.tgz",
+      "integrity": "sha512-GslbXakjG61fwHnIN/vrUkPsa61WVAJDnb7jAwmbjRW5bZdwINymo1+FgjYJrGf2MDHxAt3bUWgmEMF8ETZxHQ==",
+      "dependencies": {
+        "gm": "1.16.0"
+      }
+    },
+    "node_modules/debug": {
+      "version": "0.7.0",
+      "resolved": "https://registry.npmmirror.com/debug/-/debug-0.7.0.tgz",
+      "integrity": "sha512-UWZnvGiX9tQgtrsA+mhGLKnUFvr1moempl9IvqQKyFnEgN0T4kpCE+KJcqTLcVxQjRVRnLF3VSE1Hchki5N98g==",
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/gm": {
+      "version": "1.16.0",
+      "resolved": "https://registry.npmmirror.com/gm/-/gm-1.16.0.tgz",
+      "integrity": "sha512-b5oVGr8wCI7VNfjzeXiFocCZrcpkRUxSoVYfksBMEp/jo2nYwRKhcfOURarxFwjXyW1GvEY2EmmupVLnh0vXjg==",
+      "dependencies": {
+        "array-parallel": "~0.1.0",
+        "array-series": "~0.1.0",
+        "debug": "0.7.0",
+        "stream-to-buffer": "~0.0.1",
+        "through": "~2.3.1"
+      },
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/jsbarcode": {
+      "version": "3.11.6",
+      "resolved": "https://registry.npmmirror.com/jsbarcode/-/jsbarcode-3.11.6.tgz",
+      "integrity": "sha512-G5TKGyKY1zJo0ZQKFM1IIMfy0nF2rs92BLlCz+cU4/TazIc4ZH+X1GYeDRt7TKjrYqmPfTjwTBkU/QnQlsYiuA=="
+    },
+    "node_modules/stream-to-buffer": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmmirror.com/stream-to-buffer/-/stream-to-buffer-0.0.1.tgz",
+      "integrity": "sha512-LsvisgE3iThboRqA+XLmtnY9ktPLVPOj3zZxXMhlezeCcAh0RhomquXJgB8H+lb/RR/pPcbNVGHVKFUwjpoRtw==",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/through": {
+      "version": "2.3.8",
+      "resolved": "https://registry.npmmirror.com/through/-/through-2.3.8.tgz",
+      "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
+    }
+  }
+}

+ 58 - 0
node_modules/array-parallel/.npmignore

@@ -0,0 +1,58 @@
+# Compiled source #
+###################
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+
+# Packages #
+############
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases #
+######################
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+######################
+.DS_Store*
+ehthumbs.db
+Icon?
+Thumbs.db
+
+# Node.js #
+###########
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+node_modules
+npm-debug.log
+
+# Components #
+##############
+
+/build
+/components

+ 6 - 0
node_modules/array-parallel/.travis.yml

@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+  - "0.4"
+  - "0.6"
+  - "0.8"
+  - "0.10"

+ 78 - 0
node_modules/array-parallel/README.md

@@ -0,0 +1,78 @@
+# Array Series [![Build Status](https://travis-ci.org/component/array-parallel.png)](https://travis-ci.org/component/array-parallel)
+
+Call an array of asynchronous functions in parallel
+
+### API
+
+#### parallel(fns[, context[, callback]])
+
+```js
+var parallel = require('array-parallel')
+
+parallel([
+  function (done) {
+    done()
+  }
+], this, function (err) {
+
+})
+```
+
+#### fns
+
+`fns` is an array of functions to call in parallel.
+The argument signature should be:
+
+```js
+function (done) {
+  done(new Error())
+  // or
+  done(null, result)
+}
+```
+
+That is, each function should only take a `done` as an argument.
+Each callback should only take an `Error` as the first argument,
+or a value as the second.
+
+#### context
+
+Optional context to pass to each `fn`.
+Basically `fn.call(context, done)`.
+
+#### callback(err, results)
+
+```js
+function (err, results) {
+
+}
+```
+
+Only argument is an `Error` argument.
+It will be the first error retrieved from all the `fns`.
+`results` will be an array of results from each `fn`,
+thus this could be considered an asynchronous version of `[].map`.
+
+### License
+
+The MIT License (MIT)
+
+Copyright (c) 2013 Jonathan Ong me@jongleberry.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.

+ 11 - 0
node_modules/array-parallel/component.json

@@ -0,0 +1,11 @@
+{
+  "name": "array-parallel",
+  "description": "Call an array of asynchronous functions in parallel",
+  "repo": "array-parallel",
+  "version": "0.1.3",
+  "main": "index.js",
+  "scripts": [
+    "index.js"
+  ],
+  "license": "MIT"
+}

+ 40 - 0
node_modules/array-parallel/index.js

@@ -0,0 +1,40 @@
+module.exports = function parallel(fns, context, callback) {
+  if (!callback) {
+    if (typeof context === 'function') {
+      callback = context
+      context = null
+    } else {
+      callback = noop
+    }
+  }
+
+  var pending = fns && fns.length
+  if (!pending) return callback(null, []);
+
+  var finished = false
+  var results = new Array(pending)
+
+  fns.forEach(context ? function (fn, i) {
+    fn.call(context, maybeDone(i))
+  } : function (fn, i) {
+    fn(maybeDone(i))
+  })
+
+  function maybeDone(i) {
+    return function (err, result) {
+      if (finished) return;
+
+      if (err) {
+        callback(err, results)
+        finished = true
+        return
+      }
+
+      results[i] = result
+
+      if (!--pending) callback(null, results);
+    }
+  }
+}
+
+function noop() {}

+ 23 - 0
node_modules/array-parallel/package.json

@@ -0,0 +1,23 @@
+{
+  "name": "array-parallel",
+  "description": "Call an array of asynchronous functions in parallel",
+  "version": "0.1.3",
+  "scripts": {
+    "test": "node test"
+  },
+  "author": {
+    "name": "Jonathan Ong",
+    "email": "me@jongleberry.com",
+    "url": "http://jongleberry.com",
+    "twitter": "https://twitter.com/jongleberry"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/component/array-parallel.git"
+  },
+  "bugs": {
+    "url": "https://github.com/component/array-parallel/issues",
+    "email": "me@jongleberry.com"
+  },
+  "license": "MIT"
+}

+ 62 - 0
node_modules/array-parallel/test.js

@@ -0,0 +1,62 @@
+var assert = require('assert')
+var parallel = require('./')
+
+var a, b, c
+parallel([
+  function (done) {
+    setTimeout(function () {
+      done(null, a = 0)
+    }, 5)
+  },
+  function (done) {
+    setTimeout(function () {
+      done(null, b = 1)
+    }, 10)
+  },
+  function (done) {
+    setTimeout(function () {
+      done(null, c = 2)
+    }, 15)
+  }
+], function (err, results) {
+  assert.equal(a, 0)
+  assert.equal(b, 1)
+  assert.equal(c, 2)
+
+  assert.deepEqual(results, [0, 1, 2])
+})
+
+var d, e
+parallel([
+  function (done) {
+    setTimeout(function () {
+      d = 1
+      done(new Error('message'))
+    }, 5)
+  },
+  function (done) {
+    setTimeout(function () {
+      e = 2
+      done()
+    }, 10)
+  }
+], function (err) {
+  assert.equal(err.message, 'message')
+  assert.equal(d, 1)
+  assert.equal(e, undefined)
+})
+
+var context = 'hello'
+parallel([function (done) {
+  assert.equal(this, context)
+}], context)
+
+var f
+parallel([function (done) {
+  f = true
+  done()
+}])
+
+process.nextTick(function () {
+  assert.equal(f, true)
+})

+ 58 - 0
node_modules/array-series/.npmignore

@@ -0,0 +1,58 @@
+# Compiled source #
+###################
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+
+# Packages #
+############
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases #
+######################
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+######################
+.DS_Store*
+ehthumbs.db
+Icon?
+Thumbs.db
+
+# Node.js #
+###########
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+node_modules
+npm-debug.log
+
+# Components #
+##############
+
+/build
+/components

+ 4 - 0
node_modules/array-series/.travis.yml

@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - "0.8"
+  - "0.10"

+ 76 - 0
node_modules/array-series/README.md

@@ -0,0 +1,76 @@
+# Array Series [![Build Status](https://travis-ci.org/component/array-series.png)](https://travis-ci.org/component/array-series)
+
+Call an array of asynchronous functions in series
+
+### API
+
+#### series(fns[, context[, callback]])
+
+```js
+var series = require('array-series')
+
+series([
+  function (done) {
+    done()
+  }
+], this, function (err) {
+
+})
+```
+
+#### fns
+
+`fns` is an array of functions to call in series.
+The argument signature should be:
+
+```js
+function (done) {
+  done(new Error())
+  // or
+  done()
+}
+```
+
+That is, each function should only take a `done` as an argument.
+Each callback should only take an optional `Error` as an argument.
+
+#### context
+
+Optional context to pass to each `fn`.
+Basically `fn.call(context, done)`.
+
+#### callback(err)
+
+```js
+function (err) {
+
+}
+```
+
+Only argument is an `Error` argument.
+It will return the first error in the series of functions that returns an error,
+and no function after will be called.
+
+### License
+
+The MIT License (MIT)
+
+Copyright (c) 2013 Jonathan Ong me@jongleberry.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.

+ 11 - 0
node_modules/array-series/component.json

@@ -0,0 +1,11 @@
+{
+  "name": "array-series",
+  "description": "Call an array of asynchronous functions in series",
+  "repo": "component/array-series",
+  "version": "0.1.5",
+  "main": "index.js",
+  "scripts": [
+    "index.js"
+  ],
+  "license": "MIT"
+}

+ 34 - 0
node_modules/array-series/index.js

@@ -0,0 +1,34 @@
+module.exports = function series(fns, context, callback) {
+  if (!callback) {
+    if (typeof context === 'function') {
+      callback = context
+      context = null
+    } else {
+      callback = noop
+    }
+  }
+
+  if (!(fns && fns.length)) return callback();
+
+  fns = fns.slice(0)
+
+  var call = context
+  ? function () {
+    fns.length
+      ? fns.shift().call(context, next)
+      : callback()
+  }
+  : function () {
+    fns.length
+      ? fns.shift()(next)
+      : callback()
+  }
+
+  call()
+
+  function next(err) {
+    err ? callback(err) : call()
+  }
+}
+
+function noop() {}

+ 23 - 0
node_modules/array-series/package.json

@@ -0,0 +1,23 @@
+{
+  "name": "array-series",
+  "description": "Call an array of asynchronous functions in series",
+  "version": "0.1.5",
+  "scripts": {
+    "test": "node test"
+  },
+  "author": {
+    "name": "Jonathan Ong",
+    "email": "me@jongleberry.com",
+    "url": "http://jongleberry.com",
+    "twitter": "https://twitter.com/jongleberry"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/component/array-series.git"
+  },
+  "bugs": {
+    "url": "https://github.com/component/array-series/issues",
+    "email": "me@jongleberry.com"
+  },
+  "license": "MIT"
+}

+ 88 - 0
node_modules/array-series/test.js

@@ -0,0 +1,88 @@
+var assert = require('assert')
+var series = require('./')
+
+var a, b, c
+
+series([
+  function (done) {
+    a = 1
+    process.nextTick(done)
+    check('a')
+  },
+  function (done) {
+    b = 2
+    process.nextTick(done)
+    check('b')
+  },
+  function (done) {
+    c = 3
+    process.nextTick(done)
+    check('c')
+  }
+], function (err) {
+  assert.ifError(err)
+  assert.equal(a, 1)
+  assert.equal(b, 2)
+  assert.equal(c, 3)
+})
+
+function check(x) {
+  switch (x) {
+    case 'a':
+      assert.equal(a, 1)
+      assert.equal(b, undefined)
+      assert.equal(c, undefined)
+      break
+    case 'b':
+      assert.equal(a, 1)
+      assert.equal(b, 2)
+      assert.equal(c, undefined)
+      break
+    case 'c':
+      assert.equal(a, 1)
+      assert.equal(b, 2)
+      assert.equal(c, 3)
+      break
+  }
+}
+
+var context = 'hello'
+series([function (done) {
+  assert.equal(this, context)
+  done()
+}], context)
+
+var finished
+series([], function (err) {
+  finished = true
+})
+
+process.nextTick(function () {
+  if (!finished)
+    throw new Error('Failed with no functions.');
+})
+
+var r, d, o
+series([
+  function (done) {
+    r = 1
+    process.nextTick(done)
+  },
+  function (done) {
+    d = 0
+    process.nextTick(function () {
+      done(new Error('message'))
+    })
+  },
+  function (done) {
+    o = 0
+    process.nextTick(done)
+  }
+], function (err) {
+  assert.equal(err.message, 'message')
+  assert.equal(r, 1)
+  assert.equal(d, 0)
+  assert.equal(o, undefined)
+})
+
+console.log('Array series tests pass!')

+ 2 - 0
node_modules/barcode/.npmignore

@@ -0,0 +1,2 @@
+.travis.yml
+test/

+ 20 - 0
node_modules/barcode/LICENSE

@@ -0,0 +1,20 @@
+The MIT License (MIT)
+Copyright (c) 2014 Sam Thompson
+
+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.

+ 113 - 0
node_modules/barcode/README.md

@@ -0,0 +1,113 @@
+# barcode generator [![Build Status](https://secure.travis-ci.org/samt/barcode.png)](http://travis-ci.org/samt/barcode)
+
+Generate 1D and 2D barcodes
+
+## Supported 1D types
+
+* [Code39](http://en.wikipedia.org/wiki/Code39)
+* [Codabar](http://en.wikipedia.org/wiki/Codabar)
+* [Code128](http://en.wikipedia.org/wiki/Code128)
+* [UPC-A](http://en.wikipedia.org/wiki/Universal_Product_Code)
+* [UPC-E](http://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E)
+* [EAN-13](http://en.wikipedia.org/wiki/EAN)
+
+
+## Supported 2D types
+
+* [QR Code](http://en.wikipedia.org/wiki/QR_Code) (comming soon)
+* [DataMatrix](http://en.wikipedia.org/wiki/DataMatrix) (comming soon)
+* [PDF417](http://en.wikipedia.org/wiki/PDF417) (comming soon)
+
+## Requirements
+
+- A working installation of [GraphicsMagick](http://www.graphicsmagick.org/).
+- node >= 0.10.0
+
+## Installing
+
+	npm install barcode
+
+## Usage
+
+Set it up and specify your type and options. The following 3 are the only
+required ones.
+
+```javascript
+var barcode = require('barcode');
+var code39 = barcode('code39', {
+	data: "it works",
+	width: 400,
+	height: 100,
+});
+```
+
+Next choose from the three methods below how you want to output your barcode.
+
+**Stream**
+
+Get a stream of the final image data. you can collect this and save out a new
+PNG (default type), pipe it elsewhere, or save it to a CDN.
+
+```javascript
+code39.getStream(function (err, readStream) {
+	if (err) throw err;
+
+	// 'readStream' is an instance of ReadableStream
+	readStream.pipe(CdnWriteStream);
+});
+```
+
+**File to disk**
+
+Save an image out to the file system, pretty simple. Just be sure to specify
+your outfile.
+
+```javascript
+var outfile = path.join(__dirname, 'imgs', 'mycode.png')
+code39.saveImage(outfile, function (err) {
+	if (err) throw err;
+
+	console.log('File has been written!');
+});
+```
+
+**Base64 encoded `img` src**
+
+Often times, barcodes are single use for a single print or whatever. With this
+method, we can create one on the fly and just send the base64 encoded image to
+the browser through the HTML.
+
+```javascript
+code39.getBase64(function (err, imgsrc) {
+	if (err) throw err;
+
+	// if we're using HTTP or another framework
+	res.end('<img src="' + imgsrc + '">');
+});
+```
+
+## Rewrite
+
+Much of this will be due for a rewrite in the near future. 2.0 might make some
+API changes, but I will keep it as close to the original as possible.
+
+Some goals for the rewrite:
+
+- Externalize as much as possible
+	- checksum calculations
+	- error correcting calculations
+- Abstract the drawing part
+	- Allow for the 3 ways to accept the data currently implemented
+	- Be able to print numbers below barcodes
+- Break the process up into more defined and testable steps
+	- Check for issues with settings
+	- Calculate checksums (if applicable)
+	- Create pattern in a data structure
+	- Send the pattern to the drawer
+
+I hope to eventually make it more maintainable this way instead of the endless
+amounts of spaghetti code.
+
+## License
+
+[The MIT License (MIT)](http://opensource.org/licenses/mit-license.php)

+ 68 - 0
node_modules/barcode/index.js

@@ -0,0 +1,68 @@
+/*
+ * barcode generator
+ */
+
+var fs = require('fs'),
+  path = require('path');
+
+module.exports = function (moduleName, options) {
+  options.data = options.data || '';
+  options.barcolor = options.barcolor || '#000';
+  options.bgcolor = options.bgcolor || '#FFF';
+  options.w = options.width || 0;
+  options.h = options.height || 0;
+  options.type = (options.type) ? options.type.toUpperCase().trim() : 'PNG';
+
+  return new Barcode(moduleName, options);
+}
+
+function Barcode(moduleName, options) {
+  this.barcode = require('./lib/' + moduleName.toLowerCase());
+  this.options = options;
+}
+
+Barcode.prototype.getStream = function (callback) {
+  this.barcode.createCode(this.options, function (err, stream) {
+    callback(err, stream);
+  });
+}
+
+Barcode.prototype.saveImage = function (outfile, callback) {
+  this.getStream(function (err, stream) {
+    if (err) return callback(err, '');
+
+    var ws = fs.createWriteStream(outfile);
+    stream.pipe(ws);
+
+    stream.on('end', function () {
+      callback(false, outfile);
+    });
+
+    stream.on('error', function (err) {
+      callback(err, '');
+    });
+  });
+}
+
+Barcode.prototype.getBase64 = function (callback) {
+  var type = this.options.type || 'PNG';
+
+  this.getStream(function (err, stream) {
+    if (err) return callback(err, '');
+
+    var imgBufs = [];
+    stream.on('data', function (chunk) {
+      imgBufs.push(chunk);
+    });
+
+    stream.on('end', function () {
+      var src = 'data:image/' + type + ';base64,';
+      src += Buffer.concat(imgBufs).toString('base64');
+      callback(false, src);
+    });
+
+    stream.on('error', function (err) {
+      callback(err, '')
+    });
+  });
+}

+ 102 - 0
node_modules/barcode/lib/codabar.js

@@ -0,0 +1,102 @@
+/*
+ * barcode generator - codabar
+ */
+
+var gm = require('gm');
+
+var bmap = {
+	'0': [0,0,0,0,0,1,1],
+	'1': [0,0,0,0,1,1,0],
+	'4': [0,0,1,0,0,1,0],
+	'5': [1,0,0,0,0,1,0],
+	'2': [0,0,0,1,0,0,1],
+	'-': [0,0,0,1,1,0,0],
+	'$': [0,0,1,1,0,0,0],
+	'9': [1,0,0,1,0,0,0],
+	'6': [0,1,0,0,0,0,1],
+	'7': [0,1,0,0,1,0,0],
+	'8': [0,1,1,0,0,0,0],
+	'3': [1,1,0,0,0,0,0],
+	'C': [0,0,0,1,0,1,1],
+	'*': [0,0,0,1,0,1,1],
+	'A': [0,0,1,1,0,1,0],
+	'T': [0,0,1,1,0,1,0],
+	'D': [0,0,0,1,1,1,0],
+	'E': [0,0,0,1,1,1,0],
+	'B': [0,1,0,1,0,0,1],
+	'N': [0,1,0,1,0,0,1],
+	'.': [1,0,1,0,1,0,0],
+	'/': [1,0,1,0,0,0,1],
+	':': [1,0,0,0,1,0,1],
+	'+': [0,0,1,0,1,0,1],
+};
+
+const NARROW_RATIO = 10;
+const WIDE_RATIO = 25;
+
+module.exports.createCode = function (options, callback) {
+  options.start = options.start || 'A';
+  options.stop = options.stop || 'B';
+
+	if (!options.w || !options.h) {
+		return callback(new Error('Width and Height must be non-zero'), {});
+	}
+
+  options.data = (options.start + options.data + options.stop)
+    .toUpperCase().replace(/[^0-9A-ENT*:+\/\.\$\-]/g, '').trim();
+
+	if (!options.data) {
+		return callback(new Error('No data given'), {});
+	}
+
+  var wideBars = 0,
+    narrowBars = 0,
+    wideBarTmp;
+  for (var i in options.data) {
+    wideBarTmp = bmap[options.data[i]].join().match(/1/g).length % 2 ? 3 : 2;
+    wideBars += wideBarTmp;
+    narrowBars += 7 - wideBarTmp;
+
+    if (i) narrowBars++;
+  }
+
+  var wQuotient = options.w / (narrowBars * NARROW_RATIO + wideBars * WIDE_RATIO);
+  var nBarWidth = NARROW_RATIO * wQuotient >> 0;
+  var wBarWidth = WIDE_RATIO * wQuotient >> 0;
+
+  if (nBarWidth < 1 || wBarWidth == nBarWidth) {
+    return callback(new Error('Current settings will result in a ' +
+      'degenerate barcode'), {});
+  }
+
+  var img = gm(options.w, options.h, options.bgcolor),
+    count = 0,
+    pos = 0,
+    ch,
+    w;
+
+  img.stroke(options.barcolor, 1);
+
+  for (var i in options.data) {
+    if (count++) {
+      pos += nBarWidth;
+    }
+
+    ch = bmap[options.data[i]] || bmap['-'];
+    for (var k in ch) {
+      w = ch[k] ? wBarWidth : nBarWidth;
+
+      if ( !(k % 2) ) {
+        for (var j = 0; j < w; j++) {
+          img.drawLine(pos + j, 0, pos + j, options.h);
+        }
+      }
+
+      pos += w;
+    }
+  }
+
+  img.stream(options.type, function (err, stdout, stderr) {
+    callback(err, stdout);
+  });
+}

+ 151 - 0
node_modules/barcode/lib/code128.js

@@ -0,0 +1,151 @@
+/*
+ * barcode generator - code128
+ */
+
+var gm = require('gm');
+
+const BARMAP = [
+  [2,1,2,2,2,2], [2,2,2,1,2,2], [2,2,2,2,2,1], [1,2,1,2,2,3], [1,2,1,3,2,2],
+  [1,3,1,2,2,2], [1,2,2,2,1,3], [1,2,2,3,1,2], [1,3,2,2,1,2], [2,2,1,2,1,3],
+  [2,2,1,3,1,2], [2,3,1,2,1,2], [1,1,2,2,3,2], [1,2,2,1,3,2], [1,2,2,2,3,1],
+  [1,1,3,2,2,2], [1,2,3,1,2,2], [1,2,3,2,2,1], [2,2,3,2,1,1], [2,2,1,1,3,2],
+  [2,2,1,2,3,1], [2,1,3,2,1,2], [2,2,3,1,1,2], [3,1,2,1,3,1], [3,1,1,2,2,2],
+  [3,2,1,1,2,2], [3,2,1,2,2,1], [3,1,2,2,1,2], [3,2,2,1,1,2], [3,2,2,2,1,1],
+  [2,1,2,1,2,3], [2,1,2,3,2,1], [2,3,2,1,2,1], [1,1,1,3,2,3], [1,3,1,1,2,3],
+  [1,3,1,3,2,1], [1,1,2,3,1,3], [1,3,2,1,1,3], [1,3,2,3,1,1], [2,1,1,3,1,3],
+  [2,3,1,1,1,3], [2,3,1,3,1,1], [1,1,2,1,3,3], [1,1,2,3,3,1], [1,3,2,1,3,1],
+  [1,1,3,1,2,3], [1,1,3,3,2,1], [1,3,3,1,2,1], [3,1,3,1,2,1], [2,1,1,3,3,1],
+  [2,3,1,1,3,1], [2,1,3,1,1,3], [2,1,3,3,1,1], [2,1,3,1,3,1], [3,1,1,1,2,3],
+  [3,1,1,3,2,1], [3,3,1,1,2,1], [3,1,2,1,1,3], [3,1,2,3,1,1], [3,3,2,1,1,1],
+  [3,1,4,1,1,1], [2,2,1,4,1,1], [4,3,1,1,1,1], [1,1,1,2,2,4], [1,1,1,4,2,2],
+  [1,2,1,1,2,4], [1,2,1,4,2,1], [1,4,1,1,2,2], [1,4,1,2,2,1], [1,1,2,2,1,4],
+  [1,1,2,4,1,2], [1,2,2,1,1,4], [1,2,2,4,1,1], [1,4,2,1,1,2], [1,4,2,2,1,1],
+  [2,4,1,2,1,1], [2,2,1,1,1,4], [4,1,3,1,1,1], [2,4,1,1,1,2], [1,3,4,1,1,1],
+  [1,1,1,2,4,2], [1,2,1,1,4,2], [1,2,1,2,4,1], [1,1,4,2,1,2], [1,2,4,1,1,2],
+  [1,2,4,2,1,1], [4,1,1,2,1,2], [4,2,1,1,1,2], [4,2,1,2,1,1], [2,1,2,1,4,1],
+  [2,1,4,1,2,1], [4,1,2,1,2,1], [1,1,1,1,4,3], [1,1,1,3,4,1], [1,3,1,1,4,1],
+  [1,1,4,1,1,3], [1,1,4,3,1,1], [4,1,1,1,1,3], [4,1,1,3,1,1], [1,1,3,1,4,1],
+  [1,1,4,1,3,1], [3,1,1,1,4,1], [4,1,1,1,3,1], [2,1,1,4,1,2], [2,1,1,2,1,4],
+  [2,1,1,2,3,2], [2,3,3,1,1,1,2], [2,1,1,1,3,3]
+];
+
+const CODEMAPS = {
+  'A': [
+    ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.',
+    '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
+    '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
+    'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[',
+    '\\', ']', '^', '_', 'NUL', 'SOH', 'STX', 'ETX', 'EOT', 'ENQ', 'ACK', 'BEL',
+    'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'SO', 'SI', 'DLE', 'DC1', 'DC2', 'DC3',
+    'DC4', 'NAK', 'SYN', 'ETB', 'CAN', 'EM', 'SUB', 'ESC', 'FS', 'GS', 'RS', 'US',
+    'FNC3', 'FNC3', 'SHIFTB', 'CODEC', 'CODEB', 'FNC4', 'FNC1'
+  ],
+  'B': [
+    ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.',
+    '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
+    '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
+    'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[',
+    '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+    'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
+    'z', '{', '|', '}', '~', 'DEL', 'FNC3', 'FNC2', 'SHIFTA', 'CODEC', 'FNC4',
+    'CODEA', 'FNC1'
+  ],
+  'C': [
+    '00', '01', '02', '03', '04', '05', '06', '07', '08', '09',
+    '10', '11', '12', '13', '14', '15', '16', '17', '18', '19',
+    '20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
+    '30', '31', '32', '33', '34', '35', '36', '37', '38', '39',
+    '40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
+    '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
+    '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
+    '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
+    '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
+    '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
+    'CODEB', 'CODEA', 'FNC1',
+  ]
+};
+
+const STARTA = BARMAP[103];
+const STARTB = BARMAP[104];
+const STARTC = BARMAP[105];
+const STOP   = BARMAP[106];
+
+const START = {
+  'A': STARTA,
+  'B': STARTB,
+  'C': STARTC
+};
+
+function getVal(mode, ch) {
+  return i = mode.toUpperCase() in CODEMAPS &&
+    CODEMAPS[mode.toUpperCase()].indexOf(ch) ||
+    0;
+}
+
+module.exports.createCode = function (options, callback) {
+  if (!options.data) {
+    return callback(new Error('No data given'), {});
+  }
+
+  if (!options.w || !options.h) {
+    return callback(new Error('Width and Height must be non-zero'), {});
+  }
+
+
+  // @todo refactor ------------------------------------------------------------
+  // we want to detect and optimize the best mode switching for the shortest
+  // code and the best space utilization.
+
+  var mode = options.mode || 'B';
+
+  // START + CHECK + END + DATA
+  var baseWidth = 11 + 11 + 13 + options.data.length * 11;
+  var barWidth = options.w / baseWidth >> 0;
+
+  if (!barWidth) {
+    return callback(new Error('Width will result in a degenerate barcode'), {});
+  }
+
+  // encode
+  var encoded = [ START[mode] ];
+  var checkSum = (mode == 'A') ? 103 : (mode == 'B' ? 104 : 105);
+  for(var i in options.data) {
+    i = parseInt(i); // shoudn't i already be a number? It's not.
+    var val = getVal(mode, options.data[i] );
+    encoded.push( BARMAP[val] );
+    checkSum += (i + 1) * val;
+  }
+
+  // add on check digit
+  encoded.push(BARMAP[ checkSum % 103 ]);
+  encoded.push(STOP);
+
+  // @todo end -----------------------------------------------------------------
+
+  var img = gm(options.w, options.h, options.bgcolor),
+    count = 0,
+    pos = 0,
+    w;
+
+  img.stroke(options.barcolor, 1);
+  pos = (options.w - baseWidth * barWidth) / 2 >> 0;
+
+  for (var i in encoded) {
+
+    for (var k in encoded[i]) {
+      w = encoded[i][k] * barWidth;
+      // only draw even indecies
+      if ( ! (k % 2) ) {
+        for (var m = 0; m < w; m++) {
+          img.drawLine(pos + m, 0, pos + m, options.h);
+        }
+      }
+
+      pos += w;
+    }
+  }
+
+  img.stream(options.type, function (err, stdout, stderr) {
+    callback(err, stdout);
+  });
+};

+ 114 - 0
node_modules/barcode/lib/code39.js

@@ -0,0 +1,114 @@
+/*
+ * barcode generator - code39
+ */
+
+var gm = require('gm');
+
+const bmap = {
+	' ': [0,1,1,0,0,0,1,0,0],
+	'$': [0,1,0,1,0,1,0,0,0],
+	'%': [0,0,0,1,0,1,0,1,0],
+	'*': [0,1,0,0,1,0,1,0,0], // Start/stop marker
+	'+': [0,1,0,0,0,1,0,1,0],
+	'|': [0,1,0,0,0,0,1,0,1],
+	'.': [1,1,0,0,0,0,1,0,0],
+	'/': [0,1,0,1,0,0,0,1,0],
+	'-': [0,1,0,0,0,0,1,0,1],
+	'0': [0,0,0,1,1,0,1,0,0],
+	'1': [1,0,0,1,0,0,0,0,1],
+	'2': [0,0,1,1,0,0,0,0,1],
+	'3': [1,0,1,1,0,0,0,0,0],
+	'4': [0,0,0,1,1,0,0,0,1],
+	'5': [1,0,0,1,1,0,0,0,0],
+	'6': [0,0,1,1,1,0,0,0,0],
+	'7': [0,0,0,1,0,0,1,0,1],
+	'8': [1,0,0,1,0,0,1,0,0],
+	'9': [0,0,1,1,0,0,1,0,0],
+	'A': [1,0,0,0,0,1,0,0,1],
+	'B': [0,0,1,0,0,1,0,0,1],
+	'C': [1,0,1,0,0,1,0,0,0],
+	'D': [0,0,0,0,1,1,0,0,1],
+	'E': [1,0,0,0,1,1,0,0,0],
+	'F': [0,0,1,0,1,1,0,0,0],
+	'G': [0,0,0,0,0,1,1,0,1],
+	'H': [1,0,0,0,0,1,1,0,0],
+	'I': [0,0,1,0,0,1,1,0,0],
+	'J': [0,0,0,0,1,1,1,0,0],
+	'K': [1,0,0,0,0,0,0,1,1],
+	'L': [0,0,1,0,0,0,0,1,1],
+	'M': [1,0,1,0,0,0,0,1,0],
+	'N': [0,0,0,0,1,0,0,1,1],
+	'O': [1,0,0,0,1,0,0,1,0],
+	'P': [0,0,1,0,1,0,0,1,0],
+	'Q': [0,0,0,0,0,0,1,1,1],
+	'R': [1,0,0,0,0,0,1,1,0],
+	'S': [0,0,1,0,0,0,1,1,0],
+	'T': [0,0,0,0,1,0,1,1,0],
+	'U': [1,1,0,0,0,0,0,0,1],
+	'V': [0,1,1,0,0,0,0,0,1],
+	'W': [1,1,1,0,0,0,0,0,0],
+	'X': [0,1,0,0,1,0,0,0,1],
+	'Y': [1,1,0,0,1,0,0,0,0],
+	'Z': [0,1,1,0,1,0,0,0,0]
+};
+
+const NARROW_BAR = 20;
+const WIDE_BAR = 55;
+const QUIET_BAR = 35;
+const SYM_LEN = 6 * NARROW_BAR + 3 * WIDE_BAR + QUIET_BAR;
+
+module.exports.createCode = function (options, callback) {
+
+  if (!options.w || !options.h) {
+    return callback(new Error('Width and Height must be non-zero'), {});
+  }
+
+	options.data = options.data.trim();
+	if (!options.data) {
+		return callback(new Error('No data given'), {});
+	}
+
+  options.data = ('*' + options.data + '*').toUpperCase();
+  var wQuotient = options.w / (options.data.length * SYM_LEN - QUIET_BAR);
+
+  var nBarWidth = NARROW_BAR * wQuotient >> 0;
+  var wBarWidth = WIDE_BAR * wQuotient >> 0;
+  var qBarWidth = QUIET_BAR * wQuotient >> 0;
+
+  if (nBarWidth < 1 || qBarWidth == nBarWidth) {
+    return callback(new Error('Current settings will result in a ' +
+      'degenerate barcode'), {});
+  }
+
+  var img = gm(options.w, options.h, options.bgcolor),
+    count = 0,
+    pos = 0,
+    ch,
+    w;
+
+  img.stroke(options.barcolor, 1);
+
+  for(var k in options.data) {
+    if (count++) {
+      pos += qBarWidth;
+    }
+
+    ch = bmap[options.data[k]] || bmap[' '];
+    for(var j in ch) {
+      w = ch[j] ? wBarWidth : nBarWidth;
+
+      if ( !(j % 2) ) {
+        // workaround for GM - cannot set gravity on stroke
+        for (var m = 0; m < w; m++) {
+          img.drawLine(pos + m, 0, pos + m, options.h);
+        }
+      }
+
+      pos += w;
+    }
+  }
+
+  img.stream(options.type, function (err, stdout, stderr) {
+    callback(err, stdout);
+  });
+};

+ 105 - 0
node_modules/barcode/lib/ean13.js

@@ -0,0 +1,105 @@
+/*
+ * barcode generator - EAN13 (ISBN)
+ */
+
+var gm = require('gm'),
+  getCheckDigit = require('./utils/checksums').weight3even10,
+  Barcode1D = require('./utils/draw1D');
+
+const START  = [1,1,1];
+const MIDDLE = [1,1,1,1,1];
+const END    = [1,1,1];
+
+const LEFT = 0;
+const RIGHT = 0;
+const GCODE = 1;
+const BARMAP = [
+  [
+    [3,2,1,1], [2,2,2,1], [2,1,2,2], [1,4,1,1], [1,1,3,2], // L/R
+    [1,2,3,1], [1,1,1,4], [1,3,1,2], [1,2,1,3], [3,1,1,2]
+  ],
+  [
+    [1,1,2,3], [1,2,2,2], [2,2,1,2], [1,1,4,1], [2,3,1,1], // G
+    [1,3,2,1], [4,1,1,1], [2,1,3,1], [3,1,2,1], [2,1,1,3]
+  ]
+];
+
+const ENCODE_GROUPS = [
+  [0,0,0,0,0,0],
+  [0,0,1,0,1,1],
+  [0,0,1,1,0,1],
+  [0,0,1,1,1,0],
+  [0,1,0,0,1,1],
+  [0,1,1,0,0,1],
+  [0,1,1,1,0,0],
+  [0,1,0,1,0,1],
+  [0,1,0,1,1,0],
+  [0,1,1,0,1,0]
+];
+
+/*
+ EAN13 has the same format, which happens to be the same as UPC.
+ This is also one of the reasons why EAN13 codes starting with 0 are also valid
+ UPC codes.
+
+ Start - 3 wide
+ Data (x6) - 7 wide
+ Middle - 5 wide)
+ Data (x5) - 7 wide
+ Check - 7 wide
+ End - 3 wide
+*/
+const MODULE_WIDTH = 95;
+
+/*
+ * generate ean13 sequence
+ *
+ * @param String seq - sequence
+ * @param Int|String check - check digit
+ * @return Array<Number> - array of barwidth
+ */
+function generateSequence(seq, check) {
+  seq = seq.substr(0,12) + '' + check;
+
+  var first = seq.substr(0,1),
+    group1 = seq.substr(1,6),
+    group2 = seq.substr(7);
+
+  var left = [],
+    right = [],
+    enc = ENCODE_GROUPS[parseInt(first)],
+    dInt;
+
+  for (var i = 0; i < 6; i++) {
+    dInt = parseInt(group1[i]);
+    left = left.concat( BARMAP[ enc[i] ][ dInt ] );
+  }
+
+  for (var i = 0; i < 6; i++) {
+    dInt = parseInt(group2[i])
+    right = right.concat( BARMAP[RIGHT][ dInt ]   );
+  }
+
+  return [].concat(START, left, MIDDLE, right, END);
+}
+
+function createCode(options, callback) {
+  if (!options.data) {
+    return callback(new Error('No data given'), {});
+  }
+
+  if (!options.w || !options.h) {
+    return callback(new Error('Width and Height must be non-zero'), {});
+  }
+
+  var check = getCheckDigit(options.data.substr(0,12));
+  var sequence = generateSequence(options.data, check);
+
+  new Barcode1D().setWidth(options.w)
+    .setHeight(options.h)
+    .setModuleWidth(MODULE_WIDTH)
+    .draw(sequence, callback);
+}
+
+module.exports.generateSequence = generateSequence;
+module.exports.createCode = createCode;

+ 91 - 0
node_modules/barcode/lib/upc-a.js

@@ -0,0 +1,91 @@
+/*
+ * barcode generator - UPC-A
+ */
+
+var gm = require('gm'),
+  getCheckDigit = require('./utils/checksums').weight3odd10,
+  Barcode1D = require('./utils/draw1D');
+
+const START  = [1,1,1];
+const MIDDLE = [1,1,1,1,1];
+const END    = [1,1,1];
+const BARMAP = [
+  [3,2,1,1], [2,2,2,1], [2,1,2,2], [1,4,1,1], [1,1,3,2],
+  [1,2,3,1], [1,1,1,4], [1,3,1,2], [1,2,1,3], [3,1,1,2]
+];
+
+/*
+ This is because UPC always has the same formula:
+ Start - 3 wide
+ Data (x6) - 7 wide
+ Middle - 5 wide)
+ Data (x5) - 7 wide
+ Check - 7 wide
+ End - 3 wide
+*/
+const MODULE_WIDTH = 95;
+const FULL_DATA_LEN = 12
+const REG_DATA_LEN = 11;
+
+module.exports.createCode = function (options, callback) {
+  if (!options.data) {
+    return callback(new Error('No data given'), {});
+  }
+
+  var userCheckDigit = false;
+  options.data = ('' + options.data).replace(/[^0-9]/g, ''); // force to string
+
+  if (options.data.length === FULL_DATA_LEN) {
+    userCheckDigit = parseInt(options.data.substr(-1));
+    options.data = options.data.substr(0, REG_DATA_LEN)
+  }
+  else if (options.data.length !== REG_DATA_LEN) {
+    return callback(new Error('Data must be 11 digits (0-9) long for UPC-A'), {});
+  }
+
+  if (!options.w || !options.h) {
+    return callback(new Error('Width and Height must be non-zero'), {});
+  }
+
+  var barWidth = options.w / MODULE_WIDTH >> 0;
+
+  if (!barWidth) {
+    return callback(new Error('Width will result in a degenerate barcode'), {});
+  }
+
+  // @todo externalize this to a function that generates the sequence
+  var digit, encoding = [START];
+  for (var i = 0; i < options.data.length; i++) {
+    // Between position 6 and 7
+    if (i == 6) {
+      encoding.push(MIDDLE);
+    }
+
+    digit = parseInt(options.data[i]);
+    encoding.push( BARMAP[ digit ] );
+  }
+
+  var checkDigit = getCheckDigit(options.data);
+
+  // we're doing them a service by verifying it for them, the UPC wont work
+  // otherwise, and they might have bad data.
+  if (userCheckDigit !== false && checkDigit !== userCheckDigit) {
+    return callback(new Error('Supplied check digit (digit 12: ' +
+      userCheckDigit + ') is incorrect. Correct: ' + checkDigit), {} );
+  }
+
+  encoding.push(BARMAP[checkDigit]);
+  encoding.push(END);
+
+  // @todo make pattern generation function that ouputs a flat array instead
+  // of a 2d array with each digit separate
+  var flatPattern = [];
+  for(var i=0; i<encoding.length; ++i) {
+    flatPattern = flatPattern.concat(encoding[i]);
+  }
+
+  new Barcode1D().setWidth(options.w)
+    .setHeight(options.h)
+    .setModuleWidth(MODULE_WIDTH)
+    .draw(flatPattern, callback);
+}

+ 145 - 0
node_modules/barcode/lib/upc-e.js

@@ -0,0 +1,145 @@
+/*
+ * barcode generator - UPC-E
+ */
+
+var Barcode1D = require('./utils/draw1D'),
+  getCheckDigit = require('./utils/checksums').weight3odd10;
+
+// BARMAP[parity][digit]
+const BARMAP = [
+  [
+    [1,1,2,3], [1,2,2,2], [2,2,1,2], [1,1,4,1], [2,3,1,1],
+    [1,3,2,1], [4,1,1,1], [2,1,3,1], [3,1,2,1], [2,1,1,3]
+  ],
+  [
+    [3,2,1,1], [2,2,2,1], [2,1,2,2], [1,4,1,1], [1,1,3,2],
+    [1,2,3,1], [1,1,1,4], [1,3,1,2], [1,2,1,3], [3,1,1,2]
+  ]
+];
+
+// PAIRITYMAP[check][lead]
+const PAIRITYMAP = [
+  [ [0,0,0,1,1,1],[1,1,1,0,0,0] ],
+  [ [0,0,1,0,1,1],[1,1,0,1,0,0] ],
+  [ [0,0,1,1,0,1],[1,1,0,0,1,0] ],
+  [ [0,0,1,1,1,0],[1,1,0,0,0,1] ],
+  [ [0,1,0,0,1,1],[1,0,1,1,0,0] ],
+  [ [0,1,1,0,0,1],[1,0,0,1,1,0] ],
+  [ [0,1,1,1,0,0],[1,0,0,0,1,1] ],
+  [ [0,1,0,1,0,1],[1,0,1,0,1,0] ],
+  [ [0,1,0,1,1,0],[1,0,1,0,0,1] ],
+  [ [0,1,1,0,1,0],[1,0,0,1,0,1] ]
+];
+
+const START = [1,1,1];
+const END = [1,1,1,1,1,1]
+
+/*
+ * This will be the same with all UPC-Es
+ *    3  Start
+ *   42  Data (6x7)
+ * +  6  End
+ * ---------------
+ *   51  Fixed width
+ */
+const MODULE_WIDTH = 51;
+
+/*
+ * Get a valid UPC-E pattern from UPC-A
+ * NOTE: This gets the pattern only! It does not provide you with parity data
+ * nor does it provide you with check digits, it ignores all that in the input
+ *
+ * @param String - UPC-A String
+ * @return String - UPC-E code pattern. Empty string if invalid
+ */
+function fromUpcA(upcastr) {
+  var upca = upcastr.split('');
+
+  if (upca.length == 12) {
+    upca.pop();
+  }
+
+  var first = upca.shift();
+  if (upca.length != 10 || first != 1 && first != 0) {
+    return '';
+  }
+
+  var upcamask = upca.join(''),
+    match = null,
+    upce = '';
+
+  // case 0-2
+  if (match = upcamask.match(/^([0-9]{2})([0-2])0{4}([0-9]{3})$/ )) {
+    upce = match[1] + match[3] + match[2];
+  }
+  // case 3
+  else if (match = upcamask.match(/^([0-9]{3})0{5}([0-9]{2})$/)) {
+    upce = match[1] + match[2] + '3';
+  }
+  // case 4
+  else if (match = upcamask.match(/^([0-9]{4})0{5}([0-9])$/)) {
+    upce = match[1] + match[2] + '4';
+  }
+  // case 5-9
+  else if (match = upcamask.match(/^([0-9]{5})0{4}([5-9])$/)) {
+    upce = match[1] + match[2];
+  }
+
+  return upce;
+}
+
+/*
+ * generate sequence
+ * @param String pattern
+ * @param Number parity
+ * @param Number check
+ */
+function generateSequence(pattern, parity, check) {
+  if (pattern.length !== 6) {
+    return null;
+  }
+
+  check = parseInt(check);
+  parity = parseInt(parity);
+
+  var p = PAIRITYMAP[check][parity],
+    seq = START;
+
+  for (var i = 0; i < 6; i++) {
+    seq = seq.concat( BARMAP[ p[i] ][ parseInt(pattern[i]) ] );
+  }
+
+  return seq.concat(END);
+}
+
+function createCode(options, callback) {
+
+  if (!options.w || !options.h) {
+    return callback(new Error('Width and Height must be non-zero'), {});
+  }
+
+  var barWidth = options.w / MODULE_WIDTH >> 0;
+  if (!barWidth) {
+    return callback(new Error('Width will result in a degenerate barcode'), {});
+  }
+
+  var pattern = fromUpcA(options.data),
+    parity = parseInt(options.data.substr(0,1));
+  var check = getCheckDigit(options.data.substr(0,11));
+
+  if (!pattern || parity > 1) {
+    return callback(new Error('UPC-E Requires a valid UPC-A code starting with 0 or 1'), {});
+  }
+
+  // NOTE: Sequence is just one long array, not an array of arrays.
+  var seq = generateSequence(pattern, parity, check);
+
+  new Barcode1D().setWidth(options.w)
+    .setHeight(options.h)
+    .setModuleWidth(MODULE_WIDTH)
+    .draw(seq, callback);
+}
+
+module.exports.generateSequence = generateSequence;
+module.exports.createCode = createCode;
+module.exports.fromUpcA = fromUpcA;

+ 55 - 0
node_modules/barcode/lib/utils/checksums.js

@@ -0,0 +1,55 @@
+/*
+ * Various checksum calculations
+ *
+ */
+
+/*
+ * weight3odd10
+ *
+ * Calculates the checksum, odds have a weight of 3, then MOD 10.
+ *
+ * @param String seq - Sequence of int to find the checksum of
+ * @param Number - Checksum
+ *
+ * Used by:
+ * - UPC-A
+ * - UPC-E
+ * - EAN8
+ */
+function weight3odd10(seq) {
+  var dInt, ret = 0;
+
+  // Using a 1-index for this simply because we can match the position in the
+  // sequence with our counter variable.
+  for (var i = 1; i <= seq.length; i++) {
+    dInt = parseInt(seq[i - 1]);
+    ret += (i & 1) ? dInt * 3 : dInt;
+  }
+
+  return (10 - ret % 10) % 10;
+}
+
+
+/*
+ * weight3even10
+ *
+ * Calculates the checksum, evens have a weight of 3, then MOD 10.
+ * What's funny about this is that we can simply prepend a 0 to the sequence
+ * to shift the odds to the evens then pass it weight3odd().
+ *
+ * @param String seq - Sequence of ints to find the checksum of
+ * @param Number - Checksum
+ *
+ * Used by:
+ * - EAN13
+ */
+function weight3even10(seq) {
+  return weight3odd10('0' + seq);
+}
+
+
+/*
+ * Our exports
+ */
+module.exports.weight3odd10 = weight3odd10;
+module.exports.weight3even10 = weight3even10;

+ 148 - 0
node_modules/barcode/lib/utils/draw1D.js

@@ -0,0 +1,148 @@
+/*
+ * Generic barcode drawing functions
+ */
+
+var gm = require('gm');
+
+const MODE_BINARY = 0;
+const MODE_BARWIDTH = 1;
+
+// constructor
+// with defaults
+function Barcode1D() {
+  this.mode = MODE_BARWIDTH;
+  this.width = 0;
+  this.height = 0;
+  this.background = '#FFF';
+  this.barcolor = '#000';
+  this.type = 'PNG';
+  this.offset = 0;
+  this.modulewidth = 1;
+}
+
+Barcode1D.MODE_BINARY = MODE_BINARY;
+Barcode1D.MODE_BARWIDTH = MODE_BARWIDTH;
+
+/*
+ * Convert binary to barwidth (static)
+ * This is for compatiblity purposes,
+ *
+ * @param Sring|Array pattern - binary pattern [1,1,1,0,0,1,0]
+ * @return Array - barwidth pattern [3,2,1,1]
+ */
+Barcode1D.convertToBarwidth = function (pattern) {
+  if (!pattern.length) {
+    return [];
+  }
+
+  var count = 0,
+    current = pattern[0],
+    ret = [];
+
+  for(var i = 0; i < pattern.length; i++, count++) {
+    if (current !== (current = pattern[i])) {
+      ret.push(count);
+      count = 0;
+    }
+  }
+
+  ret.push(count);
+  return ret;
+}
+
+/*
+ * set the pattern mode to bar width
+ * @return Object (this)
+ */
+Barcode1D.prototype.modeBarwidth = function () {
+  this.mode = MODE_BARWIDTH;
+  return this;
+};
+
+/*
+ * set the pattern mode to binary
+ * @return Object (this)
+ */
+Barcode1D.prototype.modeBinary = function () {
+  this.mode = MODE_BINARY;
+  return this;
+};
+
+/*
+ * set the type for output
+ * @param String type - file extention of the type
+ * @return Object (this)
+ */
+Barcode1D.prototype.setType = function (type) {
+  this.type = type;
+  return this;
+};
+
+/*
+ * set the type for output
+ * @param Int width - width of the image
+ * @return Object (this)
+ */
+Barcode1D.prototype.setWidth = function (width) {
+  this.width = width;
+  return this;
+};
+
+/*
+ * set the type for output
+ * @param Int height - height of the image
+ * @return Object (this)
+ */
+Barcode1D.prototype.setHeight = function (height) {
+  this.height = height;
+  return this;
+};
+
+/*
+ * set the pixel width of a single barcode module
+ * also calcualtes and sets the offset
+ * @param Int basewidth - the width of barcode if the module width was 1px
+ * @return Object (this)
+ */
+Barcode1D.prototype.setModuleWidth = function (basewidth) {
+  // bit shift 0 is just a quick way to turn it into an integer
+  this.modulewidth = this.width / basewidth >> 0;
+  this.offset = this.width % basewidth / 2 >> 0;
+
+  return this;
+};
+
+/*
+ * Draw using 1d barwiths
+ * @param Array pattern = Array of barwidths, alternating between black and white
+ * @param function callback
+ */
+Barcode1D.prototype.draw = function (pattern, callback) {
+  var img = gm(this.width, this.height, this.background),
+    pos = this.offset,
+    draw = true,
+    w;
+
+  img.stroke(this.barcolor, 0);
+
+  for (var i = 0; i < pattern.length; i++) {
+    //console.log(pattern[i] + ' ' + this.modulewidth);
+    w = pattern[i] * this.modulewidth;
+
+    if (draw) {
+      // subtract 1 from the x2 pos because drawRectangle adds another pixel on
+      // to the end of it, no idea why. The positioning otherwise is fine, i.e.
+      // you don't need it in the `w` var.
+      img.drawRectangle(pos, 0, pos + w - 1, this.height);
+    }
+
+    pos += w;
+    draw ^= true;
+  }
+
+  img.stream(this.type, function (err, stdout, strerr) {
+    callback(err, stdout);
+  });
+};
+
+module.exports = Barcode1D;

+ 34 - 0
node_modules/barcode/package.json

@@ -0,0 +1,34 @@
+{
+  "name": "barcode",
+  "description": "Generate 1D and 2D barcodes",
+  "author": {
+    "name": "Sam Thompson",
+    "email": "contact@samt.us"
+  },
+  "keywords": [
+    "barcode",
+    "datamatrix",
+    "code39",
+    "code128",
+    "codabar",
+    "qr code",
+    "qr",
+    "code",
+    "upc",
+    "upc-a",
+    "upc-e"
+  ],
+  "bugs": "https://github.com/samt/barcode/issues",
+  "version": "0.1.0",
+  "main": "index",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/samt/barcode.git"
+  },
+  "dependencies": {
+    "gm": "1.16.0"
+  },
+  "devDependencies": {
+    "mocha": "^1.21.4"
+  }
+}

+ 4 - 0
node_modules/debug/.npmignore

@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock

+ 47 - 0
node_modules/debug/History.md

@@ -0,0 +1,47 @@
+
+0.7.0 / 2012-05-04 
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16 
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate] 
+
+0.5.0 / 2012-02-02 
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01 
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26 
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22 
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02 
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release

+ 4 - 0
node_modules/debug/Makefile

@@ -0,0 +1,4 @@
+
+debug.component.js: head.js debug.js tail.js
+	cat $^ > $@
+

+ 130 - 0
node_modules/debug/Readme.md

@@ -0,0 +1,130 @@
+
+# debug
+
+  tiny node.js debugging utility.
+
+## Installation
+
+```
+$ npm install debug
+```
+
+## Example
+
+  This module is modelled after node core's debugging technique, allowing you to enable one or more topic-specific debugging functions, for example core does the following within many modules:
+
+```js
+var debug;
+if (process.env.NODE_DEBUG && /cluster/.test(process.env.NODE_DEBUG)) {
+  debug = function(x) {
+    var prefix = process.pid + ',' +
+        (process.env.NODE_WORKER_ID ? 'Worker' : 'Master');
+    console.error(prefix, x);
+  };
+} else {
+  debug = function() { };
+}
+```
+
+ This concept is extremely simple but it works well. With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.
+ 
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+  
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+ If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". 
+
+## Wildcards
+
+  The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:".
+
+## Browser support
+
+ Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. 
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  a('doing some work');
+}, 1200);
+```
+
+## License 
+
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+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.

+ 120 - 0
node_modules/debug/debug.component.js

@@ -0,0 +1,120 @@
+;(function(){
+
+/**
+ * Create a debugger with the given `name`.
+ *
+ * @param {String} name
+ * @return {Type}
+ * @api public
+ */
+
+function debug(name) {
+  if (!debug.enabled(name)) return function(){};
+
+  return function(fmt){
+    var curr = new Date;
+    var ms = curr - (debug[name] || curr);
+    debug[name] = curr;
+
+    fmt = name
+      + ' '
+      + fmt
+      + ' +' + debug.humanize(ms);
+
+    // This hackery is required for IE8
+    // where `console.log` doesn't have 'apply'
+    window.console
+      && console.log
+      && Function.prototype.apply.call(console.log, console, arguments);
+  }
+}
+
+/**
+ * The currently active debug mode names.
+ */
+
+debug.names = [];
+debug.skips = [];
+
+/**
+ * Enables a debug mode by name. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+debug.enable = function(name) {
+  localStorage.debug = name;
+
+  var split = (name || '').split(/[\s,]+/)
+    , len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    name = split[i].replace('*', '.*?');
+    if (name[0] === '-') {
+      debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
+    }
+    else {
+      debug.names.push(new RegExp('^' + name + '$'));
+    }
+  }
+};
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+debug.disable = function(){
+  debug.enable('');
+};
+
+/**
+ * Humanize the given `ms`.
+ *
+ * @param {Number} m
+ * @return {String}
+ * @api private
+ */
+
+debug.humanize = function(ms) {
+  var sec = 1000
+    , min = 60 * 1000
+    , hour = 60 * min;
+
+  if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
+  if (ms >= min) return (ms / min).toFixed(1) + 'm';
+  if (ms >= sec) return (ms / sec | 0) + 's';
+  return ms + 'ms';
+};
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+debug.enabled = function(name) {
+  for (var i = 0, len = debug.skips.length; i < len; i++) {
+    if (debug.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (var i = 0, len = debug.names.length; i < len; i++) {
+    if (debug.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+};
+
+// persist
+
+if (window.localStorage) debug.enable(localStorage.debug);
+  module.exports = debug;
+
+})();

+ 116 - 0
node_modules/debug/debug.js

@@ -0,0 +1,116 @@
+
+/**
+ * Create a debugger with the given `name`.
+ *
+ * @param {String} name
+ * @return {Type}
+ * @api public
+ */
+
+function debug(name) {
+  if (!debug.enabled(name)) return function(){};
+
+  return function(fmt){
+    var curr = new Date;
+    var ms = curr - (debug[name] || curr);
+    debug[name] = curr;
+
+    fmt = name
+      + ' '
+      + fmt
+      + ' +' + debug.humanize(ms);
+
+    // This hackery is required for IE8
+    // where `console.log` doesn't have 'apply'
+    window.console
+      && console.log
+      && Function.prototype.apply.call(console.log, console, arguments);
+  }
+}
+
+/**
+ * The currently active debug mode names.
+ */
+
+debug.names = [];
+debug.skips = [];
+
+/**
+ * Enables a debug mode by name. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+debug.enable = function(name) {
+  localStorage.debug = name;
+
+  var split = (name || '').split(/[\s,]+/)
+    , len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    name = split[i].replace('*', '.*?');
+    if (name[0] === '-') {
+      debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
+    }
+    else {
+      debug.names.push(new RegExp('^' + name + '$'));
+    }
+  }
+};
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+debug.disable = function(){
+  debug.enable('');
+};
+
+/**
+ * Humanize the given `ms`.
+ *
+ * @param {Number} m
+ * @return {String}
+ * @api private
+ */
+
+debug.humanize = function(ms) {
+  var sec = 1000
+    , min = 60 * 1000
+    , hour = 60 * min;
+
+  if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
+  if (ms >= min) return (ms / min).toFixed(1) + 'm';
+  if (ms >= sec) return (ms / sec | 0) + 's';
+  return ms + 'ms';
+};
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+debug.enabled = function(name) {
+  for (var i = 0, len = debug.skips.length; i < len; i++) {
+    if (debug.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (var i = 0, len = debug.names.length; i < len; i++) {
+    if (debug.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+};
+
+// persist
+
+if (window.localStorage) debug.enable(localStorage.debug);

+ 19 - 0
node_modules/debug/example/app.js

@@ -0,0 +1,19 @@
+
+var debug = require('../')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');

+ 24 - 0
node_modules/debug/example/browser.html

@@ -0,0 +1,24 @@
+<html>
+  <head>
+    <title>debug()</title>
+    <script src="../debug.js"></script>
+    <script>
+      // type debug.enable('*') in
+      // the console and refresh :)
+
+      a = debug('worker:a');
+      b = debug('worker:b');
+
+      setInterval(function(){
+        a('doing some work');
+      }, 1000);
+
+      setInterval(function(){
+        a('doing some work');
+      }, 1200);
+    </script>
+  </head>
+  <body>
+    
+  </body>
+</html>

+ 10 - 0
node_modules/debug/example/wildcards.js

@@ -0,0 +1,10 @@
+
+var debug = {
+  foo: require('../')('test:foo'),
+  bar: require('../')('test:bar'),
+  baz: require('../')('test:baz')
+};
+
+debug.foo('foo')
+debug.bar('bar')
+debug.baz('baz')

+ 22 - 0
node_modules/debug/example/worker.js

@@ -0,0 +1,22 @@
+
+// DEBUG=* node example/worker
+// DEBUG=worker:* node example/worker
+// DEBUG=worker:a node example/worker
+// DEBUG=worker:b node example/worker
+
+var a = require('../')('worker:a')
+  , b = require('../')('worker:b');
+
+function work() {
+  a('doing lots of uninteresting work');
+  setTimeout(work, Math.random() * 1000);
+}
+
+work();
+
+function workb() {
+  b('doing some work');
+  setTimeout(workb, Math.random() * 2000);
+}
+
+workb();

+ 1 - 0
node_modules/debug/head.js

@@ -0,0 +1 @@
+;(function(){

+ 2 - 0
node_modules/debug/index.js

@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/debug');

+ 135 - 0
node_modules/debug/lib/debug.js

@@ -0,0 +1,135 @@
+
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+
+/**
+ * Expose `debug()` as the module.
+ */
+
+module.exports = debug;
+
+/**
+ * Enabled debuggers.
+ */
+
+var names = []
+  , skips = [];
+
+(process.env.DEBUG || '')
+  .split(/[\s,]+/)
+  .forEach(function(name){
+    name = name.replace('*', '.*?');
+    if (name[0] === '-') {
+      skips.push(new RegExp('^' + name.substr(1) + '$'));
+    } else {
+      names.push(new RegExp('^' + name + '$'));
+    }
+  });
+
+/**
+ * Colors.
+ */
+
+var colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Previous debug() call.
+ */
+
+var prev = {};
+
+/**
+ * Previously assigned color.
+ */
+
+var prevColor = 0;
+
+/**
+ * Is stdout a TTY? Colored output is disabled when `true`.
+ */
+
+var isatty = tty.isatty(2);
+
+/**
+ * Select a color.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+function color() {
+  return colors[prevColor++ % colors.length];
+}
+
+/**
+ * Humanize the given `ms`.
+ *
+ * @param {Number} m
+ * @return {String}
+ * @api private
+ */
+
+function humanize(ms) {
+  var sec = 1000
+    , min = 60 * 1000
+    , hour = 60 * min;
+
+  if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
+  if (ms >= min) return (ms / min).toFixed(1) + 'm';
+  if (ms >= sec) return (ms / sec | 0) + 's';
+  return ms + 'ms';
+}
+
+/**
+ * Create a debugger with the given `name`.
+ *
+ * @param {String} name
+ * @return {Type}
+ * @api public
+ */
+
+function debug(name) {
+  function disabled(){}
+  disabled.enabled = false;
+
+  var match = skips.some(function(re){
+    return re.test(name);
+  });
+
+  if (match) return disabled;
+
+  match = names.some(function(re){
+    return re.test(name);
+  });
+
+  if (!match) return disabled;
+  var c = color();
+
+  function colored(fmt) {
+    var curr = new Date;
+    var ms = curr - (prev[name] || curr);
+    prev[name] = curr;
+
+    fmt = '  \033[9' + c + 'm' + name + ' '
+      + '\033[3' + c + 'm\033[90m'
+      + fmt + '\033[3' + c + 'm'
+      + ' +' + humanize(ms) + '\033[0m';
+
+    console.error.apply(this, arguments);
+  }
+
+  function plain(fmt) {
+    fmt = new Date().toUTCString()
+      + ' ' + name + ' ' + fmt;
+    console.error.apply(this, arguments);
+  }
+
+  colored.enabled = plain.enabled = true;
+
+  return isatty
+    ? colored
+    : plain;
+}

+ 17 - 0
node_modules/debug/package.json

@@ -0,0 +1,17 @@
+{
+    "name": "debug"
+  , "version": "0.7.0"
+  , "description": "small debugging utility"
+  , "keywords": ["debug", "log", "debugger"]
+  , "author": "TJ Holowaychuk <tj@vision-media.ca>"
+  , "dependencies": {}
+  , "devDependencies": { "mocha": "*" }
+  , "main": "index"
+  , "browserify": "debug.component.js"
+  , "engines": { "node": "*" }
+  , "component": {
+    "scripts": {
+      "debug": "debug.component.js"
+    }
+  }
+}

+ 4 - 0
node_modules/debug/tail.js

@@ -0,0 +1,4 @@
+
+  module.exports = debug;
+
+})();

+ 2 - 0
node_modules/gm/.npmignore

@@ -0,0 +1,2 @@
+test/
+examples/

+ 7 - 0
node_modules/gm/.travis.yml

@@ -0,0 +1,7 @@
+before_install:
+  - sudo apt-get update
+  - sudo apt-get install imagemagick graphicsmagick
+language: node_js
+node_js:
+  - "0.8"
+  - "0.10"

+ 496 - 0
node_modules/gm/History.md

@@ -0,0 +1,496 @@
+
+1.16.0 / 2014-05-09
+==================
+
+ * fixed; dropped "+" when 0 passed as vertical roll amt #267 [dwtkns](https://github.com/dwtkns)
+ * added; highlight-style support #272 [fdecampredon](https://github.com/fdecampredon)
+
+1.15.0 / 2014-05-03
+===================
+
+ * changed; gm.compare logic to always run the mse comparison as expected #258 [Vokkim](https://github.com/Vokkim)
+ * added; `tolerance` to gm.compare options object #258 [Vokkim](https://github.com/Vokkim)
+ * added; option to set ImageMagick application path explicitly #250 (akreitals)
+ * fixed; gm.compare: support values like 9.51582e-05 #260 [normanrz](https://github.com/normanrz)
+ * README: add call for maintainers
+
+1.14.2 / 2013-12-24
+===================
+
+* fixed; background is now a setting #246 (PEM--)
+
+1.14.1 / 2013-12-09
+===================
+
+* fixed; identify -verbose colon behavior #240 ludow
+
+1.14.0 / 2013-12-04
+===================
+
+* added; compare method for imagemagick (longlho)
+
+1.13.3 / 2013-10-22
+===================
+
+* fixed; escape diffOptions.file in compare (dwabyick)
+
+1.13.2 / 2013-10-18
+===================
+
+* fixed; density is a setting not an operator
+
+1.13.1 / 2013-09-15
+===================
+
+* added; boolean for % crop
+
+1.13.0 / 2013-09-07
+===================
+
+* added; morph more than two images (overra)
+
+1.12.2 / 2013-08-29
+===================
+
+* fixed; fallback to through in node 0.8
+
+1.12.1 / 2013-08-29 (unpublished)
+===================
+
+* refactor; replace through with stream.PassThrough
+
+1.12.0 / 2013-08-27
+===================
+
+* added; diff image output file (chenglou)
+
+1.11.1 / 2013-08-17
+===================
+
+* added; proto.selectFrame(#)
+* fixed; getters should not ignore frame selection
+
+1.11.0 / 2013-07-23
+===================
+
+* added; optional formatting string for gm().identify(format, callback) (tornillo)
+* removed; error messages when gm/im binary is not installed
+
+1.10.0 / 2013-06-27
+===================
+
+* refactor; use native `-auto-orient` for imagemagick
+
+1.9.2 / 2013-06-12
+==================
+
+  * refactor; move `streamToBuffer` to a separate module
+  * fixed; .stream(format) without a callback
+
+1.9.1 / 2013-05-07
+==================
+
+  * fixed; gm().resize(width) always only resizes width
+  * fixed; gm('img.gif').format() returns the format of the first frame
+
+1.9.0 / 2013-04-21
+==================
+
+  * added; node v0.10 support
+  * removed; node < v0.8 support - `Buffer.concat()`
+  * tests; all tests now run on Travis
+  * added; gm().stream() returns a stream when no callback is present
+  * added; gm().toBuffer(callback)
+  * fixed; gm().size() only returns the size of the first frame of a GIF
+
+1.8.2 / 2013-03-07
+==================
+
+  * include source path in identify data #126 [soupdiver](https://github.com/soupdiver)
+
+1.8.1 / 2012-12-21
+==================
+
+  * Avoid losing already set arguments on identify #105 #113 #109 [JNissi](https://github.com/JNissi)
+  * tests; add autoOrient + thumb() test
+  * tests; add test case for #113
+  * tests; added test for #109
+  * tests; add resize on buffer test
+
+1.8.0 / 2012-12-14
+==================
+
+  * added; geometry support to scale() #98
+  * removed; incorrect/broken dissolve() method (never worked)
+  * fixed; handle child_proc error when using Buffer input #109
+  * fixed; use of Buffers with identify() #109
+  * fixed; no longer include -size arg with resize() #98
+  * fixed; remove -size arg from extent() #103
+  * fixed; magnify support
+  * fixed; autoOrient to work with all types of exif orientations [dambalah](https://github.com/dambalah) #108
+  * tests; npm test runs unit only (now compatible with travis)
+  * tests; fix magnify test on imagemagick
+  * tests; added for cmd line args
+
+1.7.0 / 2012-12-06
+==================
+
+  * added; gm.compare support
+  * added; passing Buffers directly [danmilon](https://github.com/danmilon)
+
+1.6.1 / 2012-11-13
+==================
+
+  * fixed regression; only pass additional params on error #96
+
+1.6.0 / 2012-11-10
+==================
+
+  * changed; rename internal buffer to _buffer #88 [kof](https://github.com/kof)
+  * changed; optimized identify getters (format, depth, size, color, filesize). #83 please read this for details: https://github.com/aheckmann/gm/commit/8fcf3f8f84a02cc2001da874cbebb89bf7084409
+  * added; visionmedia/debug support
+  * added; `gm convert -thumbnail` support. _differs from thumb()._ [danmilon](https://github.com/danmilon)
+  * fixed; -rotate 0 support #90
+  * fixed; multi-execution of same gm instance arguments corruption
+  * fixed; gracefully handle parser errors #94 [eldilibra](https://github.com/eldilibra)
+
+1.5.1 / 2012-10-02
+==================
+
+  * fixed; passing multiple paths to append() #77
+
+1.5.0 / 2012-09-15
+==================
+
+  * fixed; callback scope
+  * fixed; append() usage #77
+
+1.4.2 / 2012-08-17
+==================
+
+  * fixed; identify parsing for ImageMagick exif data (#58)
+  * fixed; when in imageMagick mode, complain about missing imageMagick [bcherry](https://github.com/bcherry) (#73)
+  * added; tests
+
+1.4.1 / 2012-07-31
+==================
+
+  * fixed; scenes() args
+  * fixed; accept the left-to-right arg of append()
+  * added; _subCommand
+
+## v1.4 - 07/28/2012
+
+  * added; adjoin() [Math-]
+  * added; affine() [Math-]
+  * added; append() [Math-]
+  * added; authenticate() [Math-]
+  * added; average() [Math-]
+  * added; backdrop() [Math-]
+  * added; blackThreshold() [Math-]
+  * added; bluePrimary() [Math-]
+  * added; border() [Math-]
+  * added; borderColor() [Math-]
+  * added; box() [Math-]
+  * added; channel() [Math-]
+  * added; clip() [Math-]
+  * added; coalesce() [Math-]
+  * added; colorMap() [Math-]
+  * added; compose() [Math-]
+  * added; compress() [Math-]
+  * added; convolve() [Math-]
+  * added; createDirectories() [Math-]
+  * added; deconstruct() [Math-]
+  * added; delay() [Math-]
+  * added; define() [Math-]
+  * added; displace() [Math-]
+  * added; display() [Math-]
+  * added; dispose() [Math-]
+  * added; disolve() [Math-]
+  * added; encoding() [Math-]
+  * added; endian() [Math-]
+  * added; file() [Math-]
+  * added; flatten() [Math-]
+  * added; foreground() [Math-]
+  * added; frame() [Math-]
+  * added; fuzz() [Math-]
+  * added; gaussian() [Math-]
+  * added; geometry() [Math-]
+  * added; greenPrimary() [Math-]
+  * added; highlightColor() [Math-]
+  * added; highlightStyle() [Math-]
+  * added; iconGeometry() [Math-]
+  * added; intent() [Math-]
+  * added; lat() [Math-]
+  * added; level() [Math-]
+  * added; list() [Math-]
+  * added; log() [Math-]
+  * added; map() [Math-]
+  * added; matte() [Math-]
+  * added; matteColor() [Math-]
+  * added; mask() [Math-]
+  * added; maximumError() [Math-]
+  * added; mode() [Math-]
+  * added; monitor() [Math-]
+  * added; mosaic() [Math-]
+  * added; motionBlur() [Math-]
+  * added; name() [Math-]
+  * added; noop() [Math-]
+  * added; normalize() [Math-]
+  * added; opaque() [Math-]
+  * added; operator() [Math-]
+  * added; orderedDither() [Math-]
+  * added; outputDirectory() [Math-]
+  * added; page() [Math-]
+  * added; pause() [Math-]
+  * added; pen() [Math-]
+  * added; ping() [Math-]
+  * added; pointSize() [Math-]
+  * added; preview() [Math-]
+  * added; process() [Math-]
+  * added; profile() [Math-]
+  * added; progress() [Math-]
+  * added; rawSize() [Math-]
+  * added; randomThreshold() [Math-]
+  * added; recolor() [Math-]
+  * added; redPrimary() [Math-]
+  * added; remote() [Math-]
+  * added; render() [Math-]
+  * added; repage() [Math-]
+  * added; sample() [Math-]
+  * added; samplingFactor() [Math-]
+  * added; scene() [Math-]
+  * added; scenes() [Math-]
+  * added; screen() [Math-]
+  * added; segment() [Math-]
+  * added; set() [Math-]
+  * added; shade() [Math-]
+  * added; shadow() [Math-]
+  * added; sharedMemory() [Math-]
+  * added; shave() [Math-]
+  * added; shear() [Math-]
+  * added; silent() [Math-]
+  * added; snaps() [Math-]
+  * added; stagano() [Math-]
+  * added; stereo() [Math-]
+  * added; textFont() [Math-]
+  * added; texture() [Math-]
+  * added; threshold() [Math-]
+  * added; tile() [Math-]
+  * added; transform() [Math-]
+  * added; transparent() [Math-]
+  * added; treeDepth() [Math-]
+  * added; update() [Math-]
+  * added; units() [Math-]
+  * added; unsharp() [Math-]
+  * added; usePixmap() [Math-]
+  * added; view() [Math-]
+  * added; virtualPixel() [Math-]
+  * added; visual() [Math-]
+  * added; watermark() [Math-]
+  * added; wave() [Math-]
+  * added; whitePoint() [Math-]
+  * added; whiteThreshold() [Math-]
+  * added; window() [Math-]
+  * added; windowGroup() [Math-]
+
+## v1.3.2 - 06/22/2012
+
+  * added; node >= 0.7/0.8 compat
+
+## v1.3.1 - 06/06/2012
+
+  * fixed; thumb() alignment and cropping [thomaschaaf]
+  * added; hint when graphicsmagick is not installed (#62)
+  * fixed; minify() (#59)
+
+## v1.3.0 - 04/11/2012
+
+  * added; flatten support [jwarchol]
+  * added; background support [jwarchol]
+  * fixed; identify parser error [chriso]
+
+## v1.2.0 - 03/30/2012
+
+  * added; extent and gravity support [jwarchol]
+
+## v1.1.0 - 03/15/2012
+
+  * added; filter() support [travisbeck]
+  * added; density() [travisbeck]
+  * fixed; permit either width or height in resize [dambalah]
+  * updated; docs
+
+## v1.0.5 - 02/15/2012
+
+  * added; strip() support [Math-]
+  * added; interlace() support [Math-]
+  * added; setFormat() support [Math-]
+  * fixed; regexps for image types [Math-]
+
+## v1.0.4 - 02/09/2012
+
+  * expose utils
+
+## v1.0.3 - 01/27/2012
+
+  * removed; console.log
+
+## v1.0.2 - 01/24/2012
+
+  * added; debugging info on parser errors
+  * fixed; exports.version
+
+## v1.0.1 - 01/12/2012
+
+  * fixed; use of reserved keyword `super` for node v0.5+
+
+## v1.0.0 - 01/12/2012
+
+  * added; autoOrient support [kainosnoema] (#21)
+  * added; orientation support [kainosnoema] (#21)
+  * fixed; identify parser now properly JSON formats all data output by `gm identify` such as IPTC, GPS, Make, etc (#20)
+  * added; support for running as imagemagick (#23, #29)
+  * added; subclassing support; useful for setting default constructor options like one constructor for ImageMagick, the other for GM
+  * added; more tests
+  * changed; remove redundant `orientation`, `resolution`, and `filesize` from `this.data` in `indentify()`. Use their uppercase equivalents.
+
+## v0.6.0 - 12/14/2011
+
+  * added; stream support [kainosnoema] (#22)
+
+## v0.5.0 - 07/07/2011
+
+  * added; gm#trim() support [lepokle]
+  * added; gm#inputIs() support
+  * fixed; 'geometry does not contain image' error: gh-17
+
+## v0.4.3 - 05/17/2011
+
+  * added; bunch of tests
+  * fixed; polygon, polyline, bezier drawing bug
+
+## v0.4.2 - 05/10/2011
+
+  * added; resize options support
+
+## v0.4.1 - 04/28/2011
+
+  * shell args are now escaped (thanks @visionmedia)
+  * added; gm.in()
+  * added; gm.out()
+  * various refactoring
+
+## v0.4.0 - 9/21/2010
+
+  * removed deprecated `new` method
+  * added drawing docs
+
+## v0.3.2 - 9/06/2010
+
+  * new images are now created using same gm() constructor
+
+## v0.3.1 - 9/06/2010
+
+  * can now create images from scratch
+  * add type method
+
+## v0.3.0 - 8/26/2010
+
+  * add drawing api
+
+## v0.2.2 - 8/22/2010
+
+  * add quality option to thumb()
+  * add teropa to contributors
+  * added support for colorspace()
+
+## v0.2.1 - 7/31/2010
+
+  * fixed naming conflict. depth() manipulation method renamed bitdepth()
+  * added better docs
+
+## v0.2.0 - 7/29/2010
+
+new methods
+
+  - swirl
+  - spread
+  - solarize
+  - sharpen
+  - roll
+  - sepia
+  - region
+  - raise
+  - lower
+  - paint
+  - noise
+  - negative
+  - morph
+  - median
+  - antialias
+  - limit
+  - label
+  - implode
+  - gamma
+  - enhance
+  - equalize
+  - emboss
+  - edge
+  - dither
+  - monochrome
+  - despeckle
+  - depth
+  - cycle
+  - contrast
+  - comment
+  - colors
+
+added more default args to several methods
+added more examples
+
+
+## v0.1.2 - 7/28/2010
+
+  * refactor project into separate modules
+
+
+## v0.1.1 - 7/27/2010
+
+  * add modulate method
+  * add colorize method
+  * add charcoal method
+  * add chop method
+  * bug fix in write without a callback
+
+
+## v0.1.0 - 6/27/2010
+
+  * no longer supporting mogrify
+  * add image data getter methods
+
+    * size
+    * format
+    * color
+    * res
+    * depth
+    * filesize
+    * identify
+
+  * add new convert methods
+
+    * scale
+    * resample
+    * rotate
+    * flip
+    * flop
+    * crop
+    * magnify
+    * minify
+    * quality
+    * blur
+    * thumb
+
+
+## v0.0.1 - 6/11/2010
+Initial release

+ 8 - 0
node_modules/gm/Makefile

@@ -0,0 +1,8 @@
+
+test:
+	@node test/ --integration $(TESTS)
+
+test-unit:
+	@node test/ $(TESTS)
+
+.PHONY: test test-unit

+ 560 - 0
node_modules/gm/README.md

@@ -0,0 +1,560 @@
+
+THIS REPOSITORY NEEDS A MAINTAINER. IF YOU'RE INTERESTED IN MAINTAING THIS MODULE, PLEASE LET US KNOW!
+
+# gm v1.15.0 [![Build Status](https://travis-ci.org/aheckmann/gm.png?branch=master)](https://travis-ci.org/aheckmann/gm)
+
+GraphicsMagick and ImageMagick for node
+
+## Getting started
+First download and install [GraphicsMagick](http://www.graphicsmagick.org/) or [ImageMagick](http://www.imagemagick.org/). In Mac OS X, you can simply use [Homebrew](http://mxcl.github.io/homebrew/) and do:
+
+    brew install imagemagick
+    brew install graphicsmagick
+
+If you want WebP support with ImageMagick, you must add the WebP option:
+
+    brew install imagemagick --with-webp
+
+then either use npm:
+
+    npm install gm
+
+or clone the repo:
+
+    git clone git://github.com/aheckmann/gm.git
+
+
+## Basic Usage
+
+```js
+var fs = require('fs')
+  , gm = require('./gm');
+
+// resize and remove EXIF profile data
+gm('/path/to/my/img.jpg')
+.resize(240, 240)
+.noProfile()
+.write('/path/to/resize.png', function (err) {
+  if (!err) console.log('done');
+});
+
+// obtain the size of an image
+gm('/path/to/my/img.jpg')
+.size(function (err, size) {
+  if (!err)
+    console.log(size.width > size.height ? 'wider' : 'taller than you');
+});
+
+// output all available image properties
+gm('/path/to/img.png')
+.identify(function (err, data) {
+  if (!err) console.log(data)
+});
+
+// pull out the first frame of an animated gif and save as png
+gm('/path/to/animated.gif[0]')
+.write('/path/to/firstframe.png', function (err) {
+  if (err) console.log('aaw, shucks');
+});
+
+// auto-orient an image
+gm('/path/to/img.jpg')
+.autoOrient()
+.write('/path/to/oriented.jpg', function (err) {
+  if (err) ...
+})
+
+// crazytown
+gm('/path/to/my/img.jpg')
+.flip()
+.magnify()
+.rotate('green', 45)
+.blur(7, 3)
+.crop(300, 300, 150, 130)
+.edge(3)
+.write('/path/to/crazy.jpg', function (err) {
+  if (!err) console.log('crazytown has arrived');
+})
+
+// annotate an image
+gm('/path/to/my/img.jpg')
+.stroke("#ffffff")
+.drawCircle(10, 10, 20, 10)
+.font("Helvetica.ttf", 12)
+.drawText(30, 20, "GMagick!")
+.write("/path/to/drawing.png", function (err) {
+  if (!err) console.log('done');
+});
+
+// creating an image
+gm(200, 400, "#ddff99f3")
+.drawText(10, 50, "from scratch")
+.write("/path/to/brandNewImg.jpg", function (err) {
+  // ...
+});
+```
+
+## Streams
+
+```js
+// passing a stream
+var readStream = fs.createReadStream('/path/to/my/img.jpg');
+gm(readStream, 'img.jpg')
+.write('/path/to/reformat.png', function (err) {
+  if (!err) console.log('done');
+});
+
+// can also stream output to a ReadableStream
+// (can be piped to a local file or remote server)
+gm('/path/to/my/img.jpg')
+.resize('200', '200')
+.stream(function (err, stdout, stderr) {
+  var writeStream = fs.createWriteStream('/path/to/my/resized.jpg');
+  stdout.pipe(writeStream);
+});
+
+// without a callback, .stream() returns a stream
+// this is just a convenience wrapper for above.
+var writeStream = fs.createWriteStream('/path/to/my/resized.jpg');
+gm('/path/to/my/img.jpg')
+.resize('200', '200')
+.stream()
+.pipe(writeStream);
+
+// pass a format or filename to stream() and
+// gm will provide image data in that format
+gm('/path/to/my/img.jpg')
+.stream('png', function (err, stdout, stderr) {
+  var writeStream = fs.createWriteStream('/path/to/my/reformated.png');
+  stdout.pipe(writeStream);
+});
+
+// or without the callback
+var writeStream = fs.createWriteStream('/path/to/my/reformated.png');
+gm('/path/to/my/img.jpg')
+.stream('png')
+.pipe(writeStream);
+
+// combine the two for true streaming image processing
+var readStream = fs.createReadStream('/path/to/my/img.jpg');
+gm(readStream, 'img.jpg')
+.resize('200', '200')
+.stream(function (err, stdout, stderr) {
+  var writeStream = fs.createWriteStream('/path/to/my/resized.jpg');
+  stdout.pipe(writeStream);
+});
+
+// GOTCHA:
+// when working with input streams and any 'identify'
+// operation (size, format, etc), you must pass "{bufferStream: true}" if
+// you also need to convert (write() or stream()) the image afterwards
+// NOTE: this buffers the readStream in memory!
+var readStream = fs.createReadStream('/path/to/my/img.jpg');
+gm(readStream, 'img.jpg')
+.size({bufferStream: true}, function(err, size) {
+  this.resize(size.width / 2, size.height / 2)
+  this.write('/path/to/resized.jpg', function (err) {
+    if (!err) console.log('done');
+  });
+});
+
+```
+
+## Buffers
+
+```js
+// A buffer can be passed instead of a filepath as well
+var buf = require('fs').readFileSync('/path/to/image.jpg');
+
+gm(buf, 'image.jpg')
+.noise('laplacian')
+.write('/path/to/out.jpg', function (err) {
+  if (err) return handle(err);
+  console.log('Created an image from a Buffer!');
+});
+
+// A buffer can also be returned instead of a stream
+gm('img.jpg')
+.resize(100, 100)
+.toBuffer(function (err, buffer) {
+  if (err) return handle(err);
+  console.log('done!');
+})
+```
+
+## Custom Arguments
+
+If `gm` does not supply you with a method you need or does not work as you'd like, you can simply use `gm().in()` or `gm().out()` to set your own arguments.
+
+- `gm().command()` - Custom command such as `identify` or `convert`
+- `gm().in()` - Custom input arguments
+- `gm().out()` - Custom output arguments
+
+The command will be formatted in the following order:
+
+1. `command` - ie `convert`
+2. `in` - the input arguments
+3. `source` - stdin or an image file
+4. `out` - the output arguments
+5. `output` - stdout or the image file to write to
+
+For example, suppose you want the following command:
+
+```bash
+gm "convert" "label:Offline" "PNG:-"
+```
+
+However, using `gm().label()` may not work as intended for you:
+
+```js
+gm()
+.label('Offline')
+.stream();
+```
+
+would yield:
+
+```bash
+gm "convert" "-label" "\"Offline\"" "PNG:-"
+```
+
+Instead, you can use `gm().out()`:
+
+```js
+gm()
+.out('label:Offline')
+.stream();
+```
+
+which correctly yields:
+
+```bash
+gm "convert" "label:Offline" "PNG:-"
+```
+
+### Custom Identify Format String
+
+When identifying an image, you may want to use a custom formatting string instead of using `-verbose`, which is quite slow.
+You can use your own [formatting string](http://www.imagemagick.org/script/escape.php) when using `gm().identify(format, callback)`.
+For example,
+
+```js
+gm('img.png').format(function (err, format) {
+
+})
+
+// is equivalent to
+
+gm('img.png').identify('%m', function (err, format) {
+
+})
+```
+
+since `%m` is the format option for getting the image file format.
+
+## Platform differences
+
+Please document and refer to any [platform or ImageMagick/GraphicsMagick issues/differences here](https://github.com/aheckmann/gm/wiki/GraphicsMagick-and-ImageMagick-versions).
+
+## Examples:
+
+  Check out the [examples](http://github.com/aheckmann/gm/tree/master/examples/) directory to play around.
+  Also take a look at the [extending gm](http://wiki.github.com/aheckmann/gm/extending-gm)
+  page to see how to customize gm to your own needs.
+
+## Constructor:
+
+  There are a few ways you can use the `gm` image constructor.
+
+  - 1) `gm(path)` When you pass a string as the first argument it is interpreted as the path to an image you intend to manipulate.
+  - 2) `gm(stream || buffer, [filename])` You may also pass a ReadableStream or Buffer as the first argument, with an optional file name for format inference.
+  - 3) `gm(width, height, [color])` When you pass two integer arguments, gm will create a new image on the fly with the provided dimensions and an optional background color. And you can still chain just like you do with pre-existing images too. See [here](http://github.com/aheckmann/gm/blob/master/examples/new.js) for an example.
+
+## Methods
+
+  - getters
+    - [size](http://aheckmann.github.com/gm/docs.html#getters) - returns the size (WxH) of the image
+    - [orientation](http://aheckmann.github.com/gm/docs.html#orientation) - returns the EXIF orientation of the image
+    - [format](http://aheckmann.github.com/gm/docs.html#getters) - returns the image format (gif, jpeg, png, etc)
+    - [depth](http://aheckmann.github.com/gm/docs.html#getters) - returns the image color depth
+    - [color](http://aheckmann.github.com/gm/docs.html#getters) - returns the number of colors
+    - [res](http://aheckmann.github.com/gm/docs.html#getters)   - returns the image resolution
+    - [filesize](http://aheckmann.github.com/gm/docs.html#getters) - returns image filesize
+    - [identify](http://aheckmann.github.com/gm/docs.html#getters) - returns all image data available. Takes an optional format string.
+
+  - manipulation
+    - [adjoin](http://aheckmann.github.com/gm/docs.html#adjoin)
+    - [affine](http://aheckmann.github.com/gm/docs.html#affine)
+    - [antialias](http://aheckmann.github.com/gm/docs.html#antialias)
+    - [append](http://aheckmann.github.com/gm/docs.html#append)
+    - [authenticate](http://aheckmann.github.com/gm/docs.html#authenticate)
+    - [autoOrient](http://aheckmann.github.com/gm/docs.html#autoOrient)
+    - [average](http://aheckmann.github.com/gm/docs.html#average)
+    - [backdrop](http://aheckmann.github.com/gm/docs.html#backdrop)
+    - [bitdepth](http://aheckmann.github.com/gm/docs.html#bitdepth)
+    - [blackThreshold](http://aheckmann.github.com/gm/docs.html#blackThreshold)
+    - [bluePrimary](http://aheckmann.github.com/gm/docs.html#bluePrimary)
+    - [blur](http://aheckmann.github.com/gm/docs.html#blur)
+    - [border](http://aheckmann.github.com/gm/docs.html#border)
+    - [borderColor](http://aheckmann.github.com/gm/docs.html#borderColor)
+    - [box](http://aheckmann.github.com/gm/docs.html#box)
+    - [channel](http://aheckmann.github.com/gm/docs.html#channel)
+    - [charcoal](http://aheckmann.github.com/gm/docs.html#charcoal)
+    - [chop](http://aheckmann.github.com/gm/docs.html#chop)
+    - [clip](http://aheckmann.github.com/gm/docs.html#clip)
+    - [coalesce](http://aheckmann.github.com/gm/docs.html#coalesce)
+    - [colors](http://aheckmann.github.com/gm/docs.html#colors)
+    - [colorize](http://aheckmann.github.com/gm/docs.html#colorize)
+    - [colorMap](http://aheckmann.github.com/gm/docs.html#colorMap)
+    - [colorspace](http://aheckmann.github.com/gm/docs.html#colorspace)
+    - [comment](http://aheckmann.github.com/gm/docs.html#comment)
+    - [compose](http://aheckmann.github.com/gm/docs.html#compose)
+    - [compress](http://aheckmann.github.com/gm/docs.html#compress)
+    - [contrast](http://aheckmann.github.com/gm/docs.html#contrast)
+    - [convolve](http://aheckmann.github.com/gm/docs.html#convolve)
+    - [createDirectories](http://aheckmann.github.com/gm/docs.html#createDirectories)
+    - [crop](http://aheckmann.github.com/gm/docs.html#crop)
+    - [cycle](http://aheckmann.github.com/gm/docs.html#cycle)
+    - [deconstruct](http://aheckmann.github.com/gm/docs.html#deconstruct)
+    - [delay](http://aheckmann.github.com/gm/docs.html#delay)
+    - [define](http://aheckmann.github.com/gm/docs.html#define)
+    - [density](http://aheckmann.github.com/gm/docs.html#density)
+    - [despeckle](http://aheckmann.github.com/gm/docs.html#despeckle)
+    - [dither](http://aheckmann.github.com/gm/docs.html#dither)
+    - [displace](http://aheckmann.github.com/gm/docs.html#dither)
+    - [display](http://aheckmann.github.com/gm/docs.html#display)
+    - [dispose](http://aheckmann.github.com/gm/docs.html#dispose)
+    - [edge](http://aheckmann.github.com/gm/docs.html#edge)
+    - [emboss](http://aheckmann.github.com/gm/docs.html#emboss)
+    - [encoding](http://aheckmann.github.com/gm/docs.html#encoding)
+    - [enhance](http://aheckmann.github.com/gm/docs.html#enhance)
+    - [endian](http://aheckmann.github.com/gm/docs.html#endian)
+    - [equalize](http://aheckmann.github.com/gm/docs.html#equalize)
+    - [extent](http://aheckmann.github.com/gm/docs.html#extent)
+    - [file](http://aheckmann.github.com/gm/docs.html#file)
+    - [filter](http://aheckmann.github.com/gm/docs.html#filter)
+    - [flatten](http://aheckmann.github.com/gm/docs.html#flatten)
+    - [flip](http://aheckmann.github.com/gm/docs.html#flip)
+    - [flop](http://aheckmann.github.com/gm/docs.html#flop)
+    - [foreground](http://aheckmann.github.com/gm/docs.html#foreground)
+    - [frame](http://aheckmann.github.com/gm/docs.html#frame)
+    - [fuzz](http://aheckmann.github.com/gm/docs.html#fuzz)
+    - [gamma](http://aheckmann.github.com/gm/docs.html#gamma)
+    - [gaussian](http://aheckmann.github.com/gm/docs.html#gaussian)
+    - [geometry](http://aheckmann.github.com/gm/docs.html#geometry)
+    - [gravity](http://aheckmann.github.com/gm/docs.html#gravity)
+    - [greenPrimary](http://aheckmann.github.com/gm/docs.html#greenPrimary)
+    - [highlightColor](http://aheckmann.github.com/gm/docs.html#highlightColor)
+    - [highlightStyle](http://aheckmann.github.com/gm/docs.html#highlightStyle)
+    - [iconGeometry](http://aheckmann.github.com/gm/docs.html#iconGeometry)
+    - [implode](http://aheckmann.github.com/gm/docs.html#implode)
+    - [intent](http://aheckmann.github.com/gm/docs.html#intent)
+    - [interlace](http://aheckmann.github.com/gm/docs.html#interlace)
+    - [label](http://aheckmann.github.com/gm/docs.html#label)
+    - [lat](http://aheckmann.github.com/gm/docs.html#lat)
+    - [level](http://aheckmann.github.com/gm/docs.html#level)
+    - [list](http://aheckmann.github.com/gm/docs.html#list)
+    - [limit](http://aheckmann.github.com/gm/docs.html#limit)
+    - [log](http://aheckmann.github.com/gm/docs.html#log)
+    - [loop](http://aheckmann.github.com/gm/docs.html#loop)
+    - [lower](http://aheckmann.github.com/gm/docs.html#lower)
+    - [magnify](http://aheckmann.github.com/gm/docs.html#magnify)
+    - [map](http://aheckmann.github.com/gm/docs.html#map)
+    - [matte](http://aheckmann.github.com/gm/docs.html#matte)
+    - [matteColor](http://aheckmann.github.com/gm/docs.html#matteColor)
+    - [mask](http://aheckmann.github.com/gm/docs.html#mask)
+    - [maximumError](http://aheckmann.github.com/gm/docs.html#maximumError)
+    - [median](http://aheckmann.github.com/gm/docs.html#median)
+    - [minify](http://aheckmann.github.com/gm/docs.html#minify)
+    - [mode](http://aheckmann.github.com/gm/docs.html#mode)
+    - [modulate](http://aheckmann.github.com/gm/docs.html#modulate)
+    - [monitor](http://aheckmann.github.com/gm/docs.html#monitor)
+    - [monochrome](http://aheckmann.github.com/gm/docs.html#monochrome)
+    - [morph](http://aheckmann.github.com/gm/docs.html#morph)
+    - [mosaic](http://aheckmann.github.com/gm/docs.html#mosaic)
+    - [motionBlur](http://aheckmann.github.com/gm/docs.html#motionBlur)
+    - [name](http://aheckmann.github.com/gm/docs.html#name)
+    - [negative](http://aheckmann.github.com/gm/docs.html#negative)
+    - [noise](http://aheckmann.github.com/gm/docs.html#noise)
+    - [noop](http://aheckmann.github.com/gm/docs.html#noop)
+    - [normalize](http://aheckmann.github.com/gm/docs.html#normalize)
+    - [noProfile](http://aheckmann.github.com/gm/docs.html#profile)
+    - [opaque](http://aheckmann.github.com/gm/docs.html#opaque)
+    - [operator](http://aheckmann.github.com/gm/docs.html#operator)
+    - [orderedDither](http://aheckmann.github.com/gm/docs.html#orderedDither)
+    - [outputDirectory](http://aheckmann.github.com/gm/docs.html#outputDirectory)
+    - [paint](http://aheckmann.github.com/gm/docs.html#paint)
+    - [page](http://aheckmann.github.com/gm/docs.html#page)
+    - [pause](http://aheckmann.github.com/gm/docs.html#pause)
+    - [pen](http://aheckmann.github.com/gm/docs.html#pen)
+    - [ping](http://aheckmann.github.com/gm/docs.html#ping)
+    - [pointSize](http://aheckmann.github.com/gm/docs.html#pointSize)
+    - [preview](http://aheckmann.github.com/gm/docs.html#preview)
+    - [process](http://aheckmann.github.com/gm/docs.html#process)
+    - [profile](http://aheckmann.github.com/gm/docs.html#profile)
+    - [progress](http://aheckmann.github.com/gm/docs.html#progress)
+    - [quality](http://aheckmann.github.com/gm/docs.html#quality)
+    - [raise](http://aheckmann.github.com/gm/docs.html#raise)
+    - [rawSize](http://aheckmann.github.com/gm/docs.html#rawSize)
+    - [randomThreshold](http://aheckmann.github.com/gm/docs.html#randomThreshold)
+    - [recolor](http://aheckmann.github.com/gm/docs.html#recolor)
+    - [redPrimary](http://aheckmann.github.com/gm/docs.html#redPrimary)
+    - [region](http://aheckmann.github.com/gm/docs.html#region)
+    - [remote](http://aheckmann.github.com/gm/docs.html#remote)
+    - [render](http://aheckmann.github.com/gm/docs.html#render)
+    - [repage](http://aheckmann.github.com/gm/docs.html#repage)
+    - [resample](http://aheckmann.github.com/gm/docs.html#resample)
+    - [resize](http://aheckmann.github.com/gm/docs.html#resize)
+    - [roll](http://aheckmann.github.com/gm/docs.html#roll)
+    - [rotate](http://aheckmann.github.com/gm/docs.html#rotate)
+    - [sample](http://aheckmann.github.com/gm/docs.html#sample)
+    - [samplingFactor](http://aheckmann.github.com/gm/docs.html#samplingFactor)
+    - [scale](http://aheckmann.github.com/gm/docs.html#scale)
+    - [scene](http://aheckmann.github.com/gm/docs.html#scene)
+    - [scenes](http://aheckmann.github.com/gm/docs.html#scenes)
+    - [screen](http://aheckmann.github.com/gm/docs.html#screen)
+    - [segment](http://aheckmann.github.com/gm/docs.html#segment)
+    - [sepia](http://aheckmann.github.com/gm/docs.html#sepia)
+    - [set](http://aheckmann.github.com/gm/docs.html#set)
+    - [setFormat](http://aheckmann.github.com/gm/docs.html#setformat)
+    - [shade](http://aheckmann.github.com/gm/docs.html#shade)
+    - [shadow](http://aheckmann.github.com/gm/docs.html#shadow)
+    - [sharedMemory](http://aheckmann.github.com/gm/docs.html#sharedMemory)
+    - [sharpen](http://aheckmann.github.com/gm/docs.html#sharpen)
+    - [shave](http://aheckmann.github.com/gm/docs.html#shave)
+    - [shear](http://aheckmann.github.com/gm/docs.html#shear)
+    - [silent](http://aheckmann.github.com/gm/docs.html#silent)
+    - [solarize](http://aheckmann.github.com/gm/docs.html#solarize)
+    - [snaps](http://aheckmann.github.com/gm/docs.html#snaps)
+    - [stegano](http://aheckmann.github.com/gm/docs.html#stegano)
+    - [stereo](http://aheckmann.github.com/gm/docs.html#stereo)
+    - [strip](http://aheckmann.github.com/gm/docs.html#strip) _imagemagick only_
+    - [spread](http://aheckmann.github.com/gm/docs.html#spread)
+    - [swirl](http://aheckmann.github.com/gm/docs.html#swirl)
+    - [textFont](http://aheckmann.github.com/gm/docs.html#textFont)
+    - [texture](http://aheckmann.github.com/gm/docs.html#texture)
+    - [threshold](http://aheckmann.github.com/gm/docs.html#threshold)
+    - [thumb](http://aheckmann.github.com/gm/docs.html#thumb)
+    - [tile](http://aheckmann.github.com/gm/docs.html#tile)
+    - [transform](http://aheckmann.github.com/gm/docs.html#transform)
+    - [transparent](http://aheckmann.github.com/gm/docs.html#transparent)
+    - [treeDepth](http://aheckmann.github.com/gm/docs.html#treeDepth)
+    - [trim](http://aheckmann.github.com/gm/docs.html#trim)
+    - [type](http://aheckmann.github.com/gm/docs.html#type)
+    - [update](http://aheckmann.github.com/gm/docs.html#update)
+    - [units](http://aheckmann.github.com/gm/docs.html#units)
+    - [unsharp](http://aheckmann.github.com/gm/docs.html#unsharp)
+    - [usePixmap](http://aheckmann.github.com/gm/docs.html#usePixmap)
+    - [view](http://aheckmann.github.com/gm/docs.html#view)
+    - [virtualPixel](http://aheckmann.github.com/gm/docs.html#virtualPixel)
+    - [visual](http://aheckmann.github.com/gm/docs.html#visual)
+    - [watermark](http://aheckmann.github.com/gm/docs.html#watermark)
+    - [wave](http://aheckmann.github.com/gm/docs.html#wave)
+    - [whitePoint](http://aheckmann.github.com/gm/docs.html#whitePoint)
+    - [whiteThreshold](http://aheckmann.github.com/gm/docs.html#whiteThreshold)
+    - [window](http://aheckmann.github.com/gm/docs.html#window)
+    - [windowGroup](http://aheckmann.github.com/gm/docs.html#windowGroup)
+
+  - drawing primitives
+    - [draw](http://aheckmann.github.com/gm/docs.html#draw)
+    - [drawArc](http://aheckmann.github.com/gm/docs.html#drawArc)
+    - [drawBezier](http://aheckmann.github.com/gm/docs.html#drawBezier)
+    - [drawCircle](http://aheckmann.github.com/gm/docs.html#drawCircle)
+    - [drawEllipse](http://aheckmann.github.com/gm/docs.html#drawEllipse)
+    - [drawLine](http://aheckmann.github.com/gm/docs.html#drawLine)
+    - [drawPoint](http://aheckmann.github.com/gm/docs.html#drawPoint)
+    - [drawPolygon](http://aheckmann.github.com/gm/docs.html#drawPolygon)
+    - [drawPolyline](http://aheckmann.github.com/gm/docs.html#drawPolyline)
+    - [drawRectangle](http://aheckmann.github.com/gm/docs.html#drawRectangle)
+    - [drawText](http://aheckmann.github.com/gm/docs.html#drawText)
+    - [fill](http://aheckmann.github.com/gm/docs.html#fill)
+    - [font](http://aheckmann.github.com/gm/docs.html#font)
+    - [fontSize](http://aheckmann.github.com/gm/docs.html#fontSize)
+    - [stroke](http://aheckmann.github.com/gm/docs.html#stroke)
+    - [strokeWidth](http://aheckmann.github.com/gm/docs.html#strokeWidth)
+    - [setDraw](http://aheckmann.github.com/gm/docs.html#setDraw)
+
+  - image output
+    - **write** - writes the processed image data to the specified filename
+    - **stream** - provides a `ReadableStream` with the processed image data
+    - **toBuffer** - returns the image as a `Buffer` instead of a stream
+
+##compare
+
+Graphicsmagicks `compare` command is exposed through `gm.compare()`. This allows us to determine if two images can be considered "equal".
+
+Currently `gm.compare` only accepts file paths.
+
+    gm.compare(path1, path2 [, options], callback)
+
+```js
+gm.compare('/path/to/image1.jpg', '/path/to/another.png', function (err, isEqual, equality, raw) {
+  if (err) return handle(err);
+
+  // if the images were considered equal, `isEqual` will be true, otherwise, false.
+  console.log('The images were equal: %s', isEqual);
+
+  // to see the total equality returned by graphicsmagick we can inspect the `equality` argument.
+  console.log('Actual equality: %d', equality);
+
+  // inspect the raw output
+  console.log(raw)
+})
+```
+
+You may wish to pass a custom tolerance threshold to increase or decrease the default level of `0.4`.
+
+
+```js
+gm.compare('/path/to/image1.jpg', '/path/to/another.png', 1.2, function (err, isEqual) {
+  ...
+})
+```
+
+To output a diff image, pass a configuration object to define the diff options and tolerance.
+
+
+```js
+var options = {
+  file: '/path/to/diff.png',
+  highlightColor: 'yellow',
+  tolerance: 0.02
+}
+gm.compare('/path/to/image1.jpg', '/path/to/another.png', options, function (err, isEqual, equality, raw) {
+  ...
+})
+```
+
+## Contributors
+[https://github.com/aheckmann/gm/contributors](https://github.com/aheckmann/gm/contributors)
+
+## Inspiration
+http://github.com/quiiver/magickal-node
+
+## Plugins
+[https://github.com/aheckmann/gm/wiki](https://github.com/aheckmann/gm/wiki)
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2010 [Aaron Heckmann](aaron.heckmann+github@gmail.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.

+ 130 - 0
node_modules/gm/index.js

@@ -0,0 +1,130 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Stream = require('stream').Stream;
+var EventEmitter = require('events').EventEmitter;
+var util = require('util');
+
+util.inherits(gm, EventEmitter);
+
+/**
+ * Constructor.
+ *
+ * @param {String|Number} path - path to img source or ReadableStream or width of img to create
+ * @param {Number} [height] - optional filename of ReadableStream or height of img to create
+ * @param {String} [color] - optional hex background color of created img
+ */
+
+function gm (source, height, color) {
+  var width;
+
+  if (!(this instanceof gm)) {
+    return new gm(source, height, color);
+  }
+
+  EventEmitter.call(this);
+
+  this._options = {};
+  this.options(this.__proto__._options);
+
+  this.data = {};
+  this._in = [];
+  this._out = [];
+  this._outputFormat = null;
+  this._subCommand = 'convert';
+
+  if (source instanceof Stream) {
+    this.sourceStream = source;
+    source = height || 'unknown.jpg';
+  } else if (Buffer.isBuffer(source)) {
+    this.sourceBuffer = source;
+    source = height || 'unknown.jpg';
+  } else if (height) {
+    // new images
+    width = source;
+    source = "";
+
+    this.in("-size", width + "x" + height);
+
+    if (color) {
+      this.in("xc:"+ color);
+    }
+  }
+
+  if (typeof source === "string") {
+    // then source is a path
+
+    // parse out gif frame brackets from filename
+    // since stream doesn't use source path
+    // eg. "filename.gif[0]"
+    var frames = source.match(/(\[.+\])$/);
+    if (frames) {
+      this.sourceFrames = source.substr(frames.index, frames[0].length);
+      source = source.substr(0, frames.index);
+    }
+  }
+
+  this.source = source;
+
+  this.addSrcFormatter(function (src) {
+    // must be first source formatter
+
+    var inputFromStdin = this.sourceStream || this.sourceBuffer;
+    var ret = inputFromStdin ? '-' : this.source;
+
+    if (ret && this.sourceFrames) ret += this.sourceFrames;
+
+    src.length = 0;
+    src[0] = ret;
+  });
+}
+
+/**
+ * Subclasses the gm constructor with custom options.
+ *
+ * @param {options} options
+ * @return {gm} the subclasses gm constructor
+ */
+
+var parent = gm;
+gm.subClass = function subClass (options) {
+  function gm (source, height, color) {
+    if (!(this instanceof parent)) {
+      return new gm(source, height, color);
+    }
+
+    parent.call(this, source, height, color);
+  }
+
+  gm.prototype.__proto__ = parent.prototype;
+  gm.prototype._options = {};
+  gm.prototype.options(options);
+
+  return gm;
+}
+
+/**
+ * Augment the prototype.
+ */
+
+require("./lib/options")(gm.prototype);
+require("./lib/getters")(gm);
+require("./lib/args")(gm.prototype);
+require("./lib/drawing")(gm.prototype);
+require("./lib/convenience")(gm.prototype);
+require("./lib/command")(gm.prototype);
+require("./lib/compare")(gm.prototype);
+
+/**
+ * Expose.
+ */
+
+module.exports = exports = gm;
+module.exports.utils = require('./lib/utils');
+module.exports.compare = require('./lib/compare')();
+module.exports.version = JSON.parse(
+  require('fs').readFileSync(__dirname + '/package.json', 'utf8')
+).version;
+

+ 1064 - 0
node_modules/gm/lib/args.js

@@ -0,0 +1,1064 @@
+/**
+ * Dependencies
+ */
+
+var argsToArray = require('./utils').argsToArray;
+
+/**
+ * Extend proto
+ */
+
+module.exports = function (proto) {
+  // change the specified frame.
+  // See #202.
+  proto.selectFrame = function (frame) {
+    if (typeof frame === 'number')
+      this.sourceFrames = '[' + frame + ']';
+    return this;
+  }
+
+  // define the sub-command to use, http://www.graphicsmagick.org/utilities.html
+  proto.command = proto.subCommand = function subCommand (name){
+    this._subCommand = name;
+    return this;
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-adjoin
+  proto.adjoin = function adjoin () {
+    return this.out("-adjoin");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-affine
+  proto.affine = function affine (matrix) {
+    return this.out("-affine", matrix);
+  }
+
+  /**
+   * Appends images to the list of "source" images.
+   *
+   * We may also specify either top-to-bottom or left-to-right
+   * behavior of the appending by passing a boolean argument.
+   *
+   * Examples:
+   *
+   *    img = gm(src);
+   *
+   *    // +append means left-to-right
+   *    img.append(img1, img2)       gm convert src img1 img2 -append
+   *    img.append(img, true)        gm convert src img +append
+   *    img.append(img, false)       gm convert src img -append
+   *    img.append(img)              gm convert src img -append
+   *    img.append(img).append()     gm convert src img -append
+   *    img.append(img).append(true) gm convert src img +append
+   *    img.append(img).append(true) gm convert src img +append
+   *    img.append(img).background('#222) gm convert src img -background #222 +append
+   *
+   * @param {String} [img]
+   * @param {Boolean} [ltr]
+   * @see http://www.graphicsmagick.org/GraphicsMagick.html#details-append
+   */
+
+  proto.append = function append (img, ltr) {
+    if (!this._append) {
+      this._append = [];
+      this.addSrcFormatter(function (src) {
+        this.out(this._append.ltr ? '+append' : '-append');
+        src.push.apply(src, this._append);
+      });
+    }
+
+    if (0 === arguments.length) {
+      this._append.ltr = false;
+      return this;
+    }
+
+    for (var i = 0; i < arguments.length; ++i) {
+      var arg = arguments[i];
+      switch (typeof arg) {
+        case 'boolean':
+          this._append.ltr = arg;
+          break;
+        case 'string':
+          this._append.push(arg);
+          break;
+      }
+    }
+
+    return this;
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-authenticate
+  proto.authenticate = function authenticate (string) {
+    return this.out("-authenticate", string);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-average
+  proto.average = function average () {
+    return this.out("-average");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-backdrop
+  proto.backdrop = function backdrop () {
+    return this.out("-backdrop");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-black-threshold
+  proto.blackThreshold = function blackThreshold (red, green, blue, opacity) {
+    return this.out("-black-threshold", argsToArray(red, green, blue, opacity).join(','));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-blue-primary
+  proto.bluePrimary = function bluePrimary (x, y) {
+    return this.out("-blue-primary", argsToArray(x, y).join(','));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-border
+  proto.border = function border (width, height) {
+    return this.out("-border", width+"x"+height);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-bordercolor
+  proto.borderColor = function borderColor (color) {
+    return this.out("-bordercolor", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-box
+  proto.box = function box (color) {
+    return this.out("-box", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-channel
+  proto.channel = function channel (type) {
+    return this.out("-channel", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-chop
+  proto.chop = function chop (w, h, x, y) {
+    return this.in("-chop", w+"x"+h + "+"+(x||0)+"+"+(y||0));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-clip
+  proto.clip = function clip () {
+    return this.out("-clip");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-coalesce
+  proto.coalesce = function coalesce () {
+    return this.out("-coalesce");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-colorize
+  proto.colorize = function colorize (r, g, b) {
+    return this.out("-colorize", [r,g,b].join(","));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-colormap
+  proto.colorMap = function colorMap (type) {
+    return this.out("-colormap", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-compose
+  proto.compose = function compose (operator) {
+    return this.out("-compose", operator);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-compress
+  proto.compress = function compress (type) {
+    return this.out("-compress", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-kernel
+  proto.convolve = function convolve (kernel) {
+    return this.out("-convolve", kernel);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-create-directories
+  proto.createDirectories = function createDirectories () {
+    return this.out("-create-directories");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-deconstruct
+  proto.deconstruct = function deconstruct () {
+    return this.out("-deconstruct");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-define
+  proto.define = function define (value) {
+    return this.out("-define", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-delay
+  proto.delay = function delay (value) {
+    return this.out("-delay", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-displace
+  proto.displace = function displace (horizontalScale, verticalScale) {
+    return this.out("-displace", horizontalScale+'x'+verticalScale);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-display
+  proto.display = function display (value) {
+    return this.out("-display", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-dispose
+  proto.dispose = function dispose (method) {
+    return this.out("-dispose", method);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-encoding
+  proto.encoding = function encoding (type) {
+    return this.out("-encoding", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-endian
+  proto.endian = function endian (type) {
+    return this.out("-endian", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-file
+  proto.file = function file (filename) {
+    return this.out("-file", filename);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-flatten
+  proto.flatten = function flatten () {
+    return this.out("-flatten");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-foreground
+  proto.foreground = function foreground (color) {
+    return this.out("-foreground", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-frame
+  proto.frame = function frame (width, height, outerBevelWidth, innerBevelWidth) {
+    if(arguments.length==0) return this.out("-frame");
+    return this.out("-frame", width+'x'+height+'+'+outerBevelWidth+'+'+innerBevelWidth);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-fuzz
+  proto.fuzz = function fuzz (distance, percent) {
+    return this.out("-fuzz", distance+(percent?'%':''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-gaussian
+  proto.gaussian = function gaussian (radius, sigma) {
+    return this.out("-gaussian", argsToArray(radius, sigma).join('x'));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-geometry
+  proto.geometry = function geometry (width, height, arg) {
+    return this.out("-geometry", width+'x'+height+(arg||''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-green-primary
+  proto.greenPrimary = function greenPrimary (x, y) {
+    return this.out("-green-primary", x+','+y);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-highlight-color
+  proto.highlightColor = function highlightColor (color) {
+    return this.out("-highlight-color", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-highlight-style
+  proto.highlightStyle = function highlightStyle (style) {
+    return this.out("-highlight-style", style);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-iconGeometry
+  proto.iconGeometry = function iconGeometry (geometry) {
+    return this.out("-iconGeometry", geometry);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-intent
+  proto.intent = function intent (type) {
+    return this.out("-intent", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-lat
+  proto.lat = function lat (width, height, offset, percent) {
+    return this.out("-lat", width+'x'+height+offset+(percent?'%':''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-level
+  proto.level = function level (blackPoint, gamma, whitePoint, percent) {
+    return this.out("-level", argsToArray(blackPoint, gamma, whitePoint).join(',')+(percent?'%':''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-list
+  proto.list = function list (type) {
+    return this.out("-list", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-log
+  proto.log = function log (string) {
+    return this.out("-log", string);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-loop
+  proto.loop = function loop (iterations) {
+    return this.out("-loop", iterations);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-map
+  proto.map = function map (filename) {
+    return this.out("-map", filename);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-mask
+  proto.mask = function mask (filename) {
+    return this.out("-mask", filename);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-matte
+  proto.matte = function matte () {
+    return this.out("-matte");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-mattecolor
+  proto.matteColor = function matteColor (color) {
+    return this.out("-mattecolor", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-maximum-error
+  proto.maximumError = function maximumError (limit) {
+    return this.out("-maximum-error", limit);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-mode
+  proto.mode = function mode (value) {
+    return this.out("-mode", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-monitor
+  proto.monitor = function monitor () {
+    return this.out("-monitor");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-mosaic
+  proto.mosaic = function mosaic () {
+    return this.out("-mosaic");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-motion-blur
+  proto.motionBlur = function motionBlur (radius, sigma, angle) {
+    var arg=radius;
+    if (typeof sigma!='undefined') arg+='x'+sigma;
+    if (typeof angle!='undefined') arg+='+'+angle;
+    return this.out("-motion-blur", arg);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-name
+  proto.name = function name () {
+    return this.out("-name");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-noop
+  proto.noop = function noop () {
+    return this.out("-noop");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-normalize
+  proto.normalize = function normalize () {
+    return this.out("-normalize");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-opaque
+  proto.opaque = function opaque (color) {
+    return this.out("-opaque", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-operator
+  proto.operator = function operator (channel, operator, rvalue, percent) {
+    return this.out("-operator", channel, operator, rvalue+(percent?'%':''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-ordered-dither
+  proto.orderedDither = function orderedDither (channeltype, NxN) {
+    return this.out("-ordered-dither", channeltype, NxN);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-output-directory
+  proto.outputDirectory = function outputDirectory (directory) {
+    return this.out("-output-directory", directory);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-page
+  proto.page = function page (width, height, arg) {
+    return this.out("-page", width+'x'+height+(arg||''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-pause
+  proto.pause = function pause (seconds) {
+    return this.out("-pause", seconds);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-pen
+  proto.pen = function pen (color) {
+    return this.out("-pen", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-ping
+  proto.ping = function ping () {
+    return this.out("-ping");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-pointsize
+  proto.pointSize = function pointSize (value) {
+    return this.out("-pointsize", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-preview
+  proto.preview = function preview (type) {
+    return this.out("-preview", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-process
+  proto.process = function process (command) {
+    return this.out("-process", command);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-profile
+  proto.profile = function profile (filename) {
+    return this.out("-profile", filename);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-progress
+  proto.progress = function progress () {
+    return this.out("+progress");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-random-threshold
+  proto.randomThreshold = function randomThreshold (channeltype, LOWxHIGH) {
+    return this.out("-random-threshold", channeltype, LOWxHIGH);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-recolor
+  proto.recolor = function recolor (matrix) {
+    return this.out("-recolor", matrix);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-red-primary
+  proto.redPrimary = function redPrimary (x, y) {
+    return this.out("-red-primary", x, y);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-remote
+  proto.remote = function remote () {
+    return this.out("-remote");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-render
+  proto.render = function render () {
+    return this.out("-render");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-repage
+  proto.repage = function repage (width, height, xoff, yoff, arg) {
+    return this.out("-repage", width+'x'+height+'+'+xoff+'+'+yoff+(arg||''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-sample
+  proto.sample = function sample (geometry) {
+    return this.out("-sample", geometry);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-sampling-factor
+  proto.samplingFactor = function samplingFactor (horizontalFactor, verticalFactor) {
+    return this.out("-sampling-factor", horizontalFactor+'x'+verticalFactor);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-scene
+  proto.scene = function scene (value) {
+    return this.out("-scene", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-scenes
+  proto.scenes = function scenes (start, end) {
+    return this.out("-scenes", start+'-'+end);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-screen
+  proto.screen = function screen () {
+    return this.out("-screen");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-set
+  proto.set = function set (attribute, value) {
+    return this.out("-set", attribute, value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-segment
+  proto.segment = function segment (clusterThreshold, smoothingThreshold) {
+    return this.out("-segment", clusterThreshold+'x'+smoothingThreshold);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-shade
+  proto.shade = function shade (azimuth, elevation) {
+    return this.out("-shade", azimuth+'x'+elevation);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-shadow
+  proto.shadow = function shadow (radius, sigma) {
+    return this.out("-shadow", argsToArray(radius, sigma).join('x'));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-shared-memory
+  proto.sharedMemory = function sharedMemory () {
+    return this.out("-shared-memory");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-shave
+  proto.shave = function shave (width, height, percent) {
+    return this.out("-shave", width+'x'+height+(percent?'%':''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-shear
+  proto.shear = function shear (xDegrees, yDegreees) {
+    return this.out("-shear", xDegrees+'x'+yDegreees);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-silent
+  proto.silent = function silent (color) {
+    return this.out("-silent");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-size
+  proto.rawSize = function rawSize (width, height, offset) {
+    var off = 'undefined' != typeof offset
+      ? '+' + offset
+      : '';
+    return this.out("-size", width +'x'+ height + off);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-snaps
+  proto.snaps = function snaps (value) {
+    return this.out("-snaps", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-stegano
+  proto.stegano = function stegano (offset) {
+    return this.out("-stegano", offset);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-stereo
+  proto.stereo = function stereo () {
+    return this.out("-stereo");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-text-font
+  proto.textFont = function textFont (name) {
+    return this.out("-text-font", name);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-texture
+  proto.texture = function texture (filename) {
+    return this.out("-texture", filename);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-threshold
+  proto.threshold = function threshold (value, percent) {
+    return this.out("-threshold", value+(percent?'%':''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-thumbnail
+  proto.thumbnail = function thumbnail (width, height) {
+    return this.out("-thumbnail", width + "x" + height);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-tile
+  proto.tile = function tile (filename) {
+    return this.out("-tile", filename);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-title
+  proto.title = function title (string) {
+    return this.out("-title", string);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-transform
+  proto.transform = function transform (color) {
+    return this.out("-transform", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-transparent
+  proto.transparent = function transparent (color) {
+    return this.out("-transparent", color);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-treedepth
+  proto.treeDepth = function treeDepth (value) {
+    return this.out("-treedepth", value);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-update
+  proto.update = function update (seconds) {
+    return this.out("-update", seconds);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-units
+  proto.units = function units (type) {
+    return this.out("-units", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-unsharp
+  proto.unsharp = function unsharp (radius, sigma, amount, threshold) {
+    var arg=radius;
+    if (typeof sigma != 'undefined') arg+='x'+sigma;
+    if (typeof amount != 'undefined') arg+='+'+amount;
+    if (typeof threshold != 'undefined') arg+='+'+threshold;
+    return this.out("-unsharp", arg);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-use-pixmap
+  proto.usePixmap = function usePixmap () {
+    return this.out("-use-pixmap");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-view
+  proto.view = function view (string) {
+    return this.out("-view", string);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-virtual-pixel
+  proto.virtualPixel = function virtualPixel (method) {
+    return this.out("-virtual-pixel", method);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-visual
+  proto.visual = function visual (type) {
+    return this.out("-visual", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-watermark
+  proto.watermark = function watermark (brightness, saturation) {
+    return this.out("-watermark", brightness+'x'+saturation);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-wave
+  proto.wave = function wave (amplitude, wavelength) {
+    return this.out("-wave", amplitude+'x'+wavelength);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-white-point
+  proto.whitePoint = function whitePoint (x, y) {
+    return this.out("-white-point", x+'x'+y);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-white-threshold
+  proto.whiteThreshold = function whiteThreshold (red, green, blue, opacity) {
+    return this.out("-white-threshold", argsToArray(red, green, blue, opacity).join(','));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-window
+  proto.window = function window (id) {
+    return this.out("-window", id);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-window-group
+  proto.windowGroup = function windowGroup () {
+    return this.out("-window-group");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-strip (graphicsMagick >= 1.3.15)
+  proto.strip = function strip () {
+    if (this._options.imageMagick) return this.out("-strip");
+    return this.noProfile().out("+comment");//Equivalent to "-strip" for all versions of graphicsMagick
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-interlace
+  proto.interlace = function interlace (type) {
+    return this.out("-interlace", type || "None");
+  }
+
+  // force output format
+  proto.setFormat = function setFormat (format) {
+    if (format) this._outputFormat = format;
+    return this;
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-resize
+  proto.resize = function resize (w, h, options) {
+    options = options || "";
+    var geometry;
+    if (w && h) {
+      geometry = w + "x" + h + options
+    } else if (w && !h) {
+      // GraphicsMagick requires <width>x<options>, ImageMagick requires <width><options>
+      geometry = (this._options.imageMagick) ? w + options : w + 'x' + options;
+    } else if (!w && h) {
+      geometry = 'x' + h + options
+    }
+
+    return this.out("-resize", geometry);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-scale
+  proto.scale = function scale (w, h, options) {
+    options = options || "";
+    var geometry;
+    if (w && h) {
+      geometry = w + "x" + h + options
+    } else if (w && !h) {
+      geometry = (this._options.imageMagick) ? w + options : w + 'x' + options;
+    } else if (!w && h) {
+      geometry = 'x' + h + options
+    }
+
+    return this.out("-scale", geometry);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-filter
+  proto.filter = function filter (val) {
+    return this.out("-filter", val);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-density
+  proto.density = function density (w, h) {
+    return this.in("-density", w +"x"+ h);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-profile
+  proto.noProfile = function noProfile () {
+    this.out('+profile', '"*"');
+    return this;
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-resample
+  proto.resample = function resample (w, h) {
+    return this.out("-resample", w+"x"+h);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-rotate
+  proto.rotate = function rotate (color, deg) {
+    return this.out("-background", color, "-rotate", String(deg || 0));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-flip
+  proto.flip = function flip () {
+    return this.out("-flip");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-flop
+  proto.flop = function flop () {
+    return this.out("-flop");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-crop
+  proto.crop = function crop (w, h, x, y, percent) {
+    if (this.inputIs('jpg')) {
+      // avoid error "geometry does not contain image (unable to crop image)" - gh-17
+      var index = this._in.indexOf('-size');
+      if (~index) {
+        this._in.splice(index, 2);
+      }
+    }
+
+    return this.out("-crop", w + "x" + h + "+" + (x || 0) + "+" + (y || 0) + (percent ? '%' : ''));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-magnify
+  proto.magnify = function magnify (factor) {
+    return this.in("-magnify");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.minify = function minify () {
+    return this.in("-minify")
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-quality
+  proto.quality = function quality (val) {
+    return this.in("-quality", val || 75);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-blur
+  proto.blur = function blur (radius, sigma) {
+    return this.out("-blur", radius + (sigma ? "x"+sigma : ""));
+  }
+
+  // http://www.graphicsmagick.org/convert.html
+  proto.charcoal = function charcoal (factor) {
+    return this.out("-charcoal", factor || 2);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-modulate
+  proto.modulate = function modulate (b, s, h) {
+    return this.out("-modulate", [b,s,h].join(","));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-antialias
+  // note: antialiasing is enabled by default
+  proto.antialias = function antialias (disable) {
+    return false === disable
+      ? this.out("+antialias")
+      : this;
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-depth
+  proto.bitdepth = function bitdepth (val) {
+    return this.out("-depth", val);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-colors
+  proto.colors = function colors (val) {
+    return this.out("-colors", val || 128);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-colorspace
+  proto.colorspace = function colorspace (val) {
+    return this.out("-colorspace", val);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-comment
+  proto.comment = comment("-comment");
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-contrast
+  proto.contrast = function contrast (mult) {
+    var arg = (parseInt(mult, 10) || 0) > 0
+      ? "+contrast"
+      : "-contrast";
+
+    mult = Math.abs(mult) || 1;
+
+    while (mult--) {
+      this.out(arg);
+    }
+
+    return this;
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-cycle
+  proto.cycle = function cycle (amount) {
+    return this.out("-cycle", amount || 2);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.despeckle = function despeckle () {
+    return this.out("-despeckle");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-dither
+  // note: either colors() or monochrome() must be used for this
+  // to take effect.
+  proto.dither = function dither (on) {
+    var sign = false === on
+      ? "+"
+      : "-";
+
+    return this.out(sign + "dither");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.monochrome = function monochrome () {
+    return this.out("-monochrome");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.edge = function edge (radius) {
+    return this.out("-edge", radius || 1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.emboss = function emboss (radius) {
+    return this.out("-emboss", radius || 1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.enhance = function enhance () {
+    return this.out("-enhance");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.equalize = function equalize () {
+    return this.out("-equalize");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-gamma
+  proto.gamma = function gamma (r, g, b) {
+    return this.out("-gamma", [r,g,b].join());
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.implode = function implode (factor) {
+    return this.out("-implode", factor || 1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-comment
+  proto.label = comment("-label");
+
+  var limits = [ "disk", "file", "map", "memory", "pixels", "threads"];
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-limit
+  proto.limit = function limit (type, val) {
+    type = type.toLowerCase();
+
+    if (!~limits.indexOf(type)) {
+      return this;
+    }
+
+    return this.out("-limit", type, val);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.median = function median (radius) {
+    return this.out("-median", radius || 1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-negate
+  proto.negative = function negative (grayscale) {
+    var sign = grayscale ? "+" : "-";
+    return this.out(sign + "negate");
+  }
+
+  var noises = [
+      "uniform"
+    , "gaussian"
+    , "multiplicative"
+    , "impulse"
+    , "laplacian"
+    , "poisson"
+  ];
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-noise
+  proto.noise = function noise (radius) {
+    radius = (String(radius)).toLowerCase();
+
+    var sign = ~noises.indexOf(radius)
+      ? "+"
+      : "-";
+
+    return this.out(sign + "noise", radius);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-paint
+  proto.paint = function paint (radius) {
+    return this.out("-paint", radius);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-raise
+  proto.raise = function raise (w, h) {
+    return this.out("-raise", (w||0)+"x"+(h||0));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-raise
+  proto.lower = function lower (w, h) {
+    return this.out("+raise", (w||0)+"x"+(h||0));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-region
+  proto.region = function region (w, h, x, y) {
+    w = w || 0;
+    h = h || 0;
+    x = x || 0;
+    y = y || 0;
+    return this.out("-region", w + "x" + h + "+" + x + "+" + y);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-roll
+  proto.roll = function roll (x, y) {
+    x = ((x = parseInt(x, 10) || 0) >= 0 ? "+" : "") + x;
+    y = ((y = parseInt(y, 10) || 0) >= 0 ? "+" : "") + y;
+    return this.out("-roll", x+y);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-sharpen
+  proto.sharpen = function sharpen (radius, sigma) {
+    sigma = sigma
+      ? "x" + sigma
+      : "";
+
+    return this.out("-sharpen", radius + sigma);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-solarize
+  proto.solarize = function solarize (factor) {
+    return this.out("-solarize", (factor || 1)+"%");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-spread
+  proto.spread = function spread (amount) {
+    return this.out("-spread", amount || 5);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-swirl
+  proto.swirl = function swirl (degrees) {
+    return this.out("-swirl", degrees || 180);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-type
+  proto.type = function type (type) {
+    return this.in("-type", type);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-trim
+  proto.trim = function trim () {
+    return this.out("-trim");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-extent
+  proto.extent = function extent (w, h, options) {
+    options = options || "";
+    var geometry;
+    if (w && h) {
+      geometry = w + "x" + h + options
+    } else if (w && !h) {
+      geometry = (this._options.imageMagick) ? w + options : w + 'x' + options;
+    } else if (!w && h) {
+      geometry = 'x' + h + options
+    }
+
+    return this.out("-extent", geometry);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-gravity
+  // Be sure to use gravity BEFORE extent
+  proto.gravity = function gravity (type) {
+    if (!type || !~gravity.types.indexOf(type)) {
+      type = "NorthWest"; // Documented default.
+    }
+
+    return this.out("-gravity", type);
+  }
+
+  proto.gravity.types = [
+      "NorthWest"
+    , "North"
+    , "NorthEast"
+    , "West"
+    , "Center"
+    , "East"
+    , "SouthWest"
+    , "South"
+    , "SouthEast"
+  ];
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-flatten
+  proto.flatten = function flatten () {
+    return this.out("-flatten");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-background
+  proto.background = function background (color) {
+    return this.in("-background", color);
+  }
+};
+
+/**
+ * Generates a handler for comments/labels.
+ */
+
+function comment (arg) {
+  return function (format) {
+    format = String(format);
+
+    format = "@" == format.charAt(0)
+      ? format.substring(1)
+      : format;
+
+    return this.out(arg, '"' + format + '"');
+  }
+}

+ 358 - 0
node_modules/gm/lib/command.js

@@ -0,0 +1,358 @@
+
+/**
+ * Module dependencies.
+ */
+
+var exec = require('child_process').exec;
+var spawn = require('child_process').spawn;
+var utils = require('./utils');
+var debug = require('debug')('gm');
+var series = require('array-series');
+var streamToBuffer = require('stream-to-buffer');
+
+/*
+ * Creates a pass through stream.
+ * We need to fallback to the `through` lib for node 0.8 support
+ * as PassThrough was added in node 0.10.
+ */
+
+var PassThrough = require('stream').PassThrough || require('through');
+
+/**
+ * Error messaging.
+ */
+
+var noBufferConcat = 'gm v1.9.0+ required node v0.8+. Please update your version of node, downgrade gm < 1.9, or do not use `bufferStream`.';
+
+/**
+ * Extend proto
+ */
+
+module.exports = function (proto) {
+
+  function args (prop) {
+    return function args () {
+      var len = arguments.length;
+      var a = [];
+      var i = 0;
+
+      for (; i < len; ++i) {
+        a.push(arguments[i]);
+      }
+
+      this[prop] = this[prop].concat(a);
+      return this;
+    }
+  }
+
+  proto.in = args('_in');
+  proto.out = args('_out');
+
+  proto._preprocessor = [];
+  proto.preprocessor = args('_preprocessor');
+
+  /**
+   * Execute the command and write the image to the specified file name.
+   *
+   * @param {String} name
+   * @param {Function} callback
+   * @return {Object} gm
+   */
+
+  proto.write = function write (name, callback) {
+    if (!callback) callback = name, name = null;
+
+    if ("function" !== typeof callback) {
+      throw new TypeError("gm().write() expects a callback function")
+    }
+
+    if (!name) {
+      return callback(TypeError("gm().write() expects a filename when writing new files"));
+    }
+
+    this.outname = name;
+
+    var self = this;
+    this._preprocess(function (err) {
+      if (err) return callback(err);
+      self._spawn(self.args(), true, callback);
+    });
+  }
+
+  /**
+   * Execute the command and return stdin and stderr
+   * ReadableStreams providing the image data.
+   * If no callback is passed, a "through" stream will be returned,
+   * and stdout will be piped through, otherwise the error will be passed.
+   *
+   * @param {String} format (optional)
+   * @param {Function} callback (optional)
+   * @return {Stream}
+   */
+
+  proto.stream = function stream (format, callback) {
+    if (!callback && typeof format === 'function') {
+      callback = format;
+      format = null;
+    }
+
+    var throughStream;
+
+    if ("function" !== typeof callback) {
+      throughStream = new PassThrough();
+      callback = function (err, stdout, stderr) {
+        if (err) throughStream.emit('error', err);
+        else stdout.pipe(throughStream);
+      }
+    }
+
+    if (format) {
+      format = format.split('.').pop();
+      this.outname = format + ":-";
+    }
+
+    var self = this;
+    this._preprocess(function (err) {
+      if (err) return callback(err);
+      return self._spawn(self.args(), false, callback);
+    });
+
+    return throughStream || this;
+  }
+
+  /**
+   * Convenience function for `proto.stream`.
+   * Simply returns the buffer instead of the stream.
+   *
+   * @param {String} format (optional)
+   * @param {Function} callback
+   * @return {null}
+   */
+
+  proto.toBuffer = function toBuffer (format, callback) {
+    if (!callback) callback = format, format = null;
+
+    if ("function" !== typeof callback) {
+      throw new Error('gm().toBuffer() expects a callback.');
+    }
+
+    return this.stream(format, function (err, stdout) {
+      if (err) return callback(err);
+
+      streamToBuffer(stdout, callback);
+    })
+  }
+
+  /**
+    * Run any preProcessor functions in series. Used by autoOrient.
+    *
+    * @param {Function} callback
+    * @return {Object} gm
+    */
+
+  proto._preprocess = function _preprocess (callback) {
+    series(this._preprocessor, this, callback);
+  }
+
+  /**
+    * Execute the command, buffer input and output, return stdout and stderr buffers.
+    *
+    * @param {String} bin
+    * @param {Array} args
+    * @param {Function} callback
+    * @return {Object} gm
+    */
+
+  proto._exec = function _exec (args, callback) {
+    return this._spawn(args, true, callback);
+  }
+
+  /**
+    * Execute the command with stdin, returning stdout and stderr streams or buffers.
+    * @param {String} bin
+    * @param {Array} args
+    * @param {ReadableStream} stream
+    * @param {Boolean} shouldBuffer
+    * @param {Function} callback
+    * @return {Object} gm
+    * @TODO refactor this mess
+    */
+
+  proto._spawn = function _spawn (args, bufferOutput, callback) {
+    var appPath = this._options.appPath || '';
+    var bin = this._options.imageMagick
+      ? appPath + args.shift()
+      : 'gm'
+
+    var proc = spawn(bin, args)
+      , cmd = bin + ' ' + args.map(utils.escape).join(' ')
+      , self = this
+      , err;
+
+    debug(cmd);
+
+    if (self.sourceBuffer) {
+      proc.stdin.write(this.sourceBuffer);
+      proc.stdin.end();
+    } else if (self.sourceStream) {
+
+      if (!self.sourceStream.readable) {
+        err = new Error("gm().stream() or gm().write() with a non-readable stream.");
+        return cb(err);
+      }
+
+      self.sourceStream.pipe(proc.stdin);
+
+      // bufferStream
+      // We convert the input source from a stream to a buffer.
+      if (self.bufferStream && !this._buffering) {
+        if (!Buffer.concat) {
+          throw new Error(noBufferConcat);
+        }
+
+        // Incase there are multiple processes in parallel,
+        // we only need one
+        self._buffering = true;
+
+        streamToBuffer(self.sourceStream, function (err, buffer) {
+          self.sourceBuffer = buffer;
+          self.sourceStream = null; // The stream is now dead
+        })
+      }
+    }
+
+    // for _exec operations (identify() mostly), we also
+    // need to buffer the output stream before returning
+    if (bufferOutput) {
+      var stdout = ''
+        , stderr = ''
+        , onOut
+        , onErr
+        , onExit
+
+      proc.stdout.on('data', onOut = function (data) {
+        stdout += data;
+      });
+
+      proc.stderr.on('data', onErr = function (data) {
+        stderr += data;
+      });
+
+      proc.on('close', onExit = function (code, signal) {
+        if (code !== 0 || signal !== null) {
+          err = new Error('Command failed: ' + stderr);
+          err.code = code;
+          err.signal = signal;
+        };
+        cb(err, stdout, stderr, cmd);
+        stdout = stderr = onOut = onErr = onExit = null;
+      });
+
+      proc.on('error', cb);
+    } else {
+      cb(null, proc.stdout, proc.stderr, cmd);
+    }
+
+    return self;
+
+    function cb (err, stdout, stderr, cmd) {
+      if (cb.called) return;
+      cb.called = 1;
+			if (args[0] !== 'identify' && bin !== 'identify') {
+				self._in = [];
+				self._out = [];
+			}
+      callback.call(self, err, stdout, stderr, cmd);
+    }
+  }
+
+  /**
+   * Returns arguments to be used in the command.
+   *
+   * @return {Array}
+   */
+
+  proto.args = function args () {
+    var outname = this.outname || "-";
+  	if (this._outputFormat) outname = this._outputFormat + ':' + outname;
+
+    return [].concat(
+        this._subCommand
+      , this._in
+      , this.src()
+      , this._out
+      , outname
+    ).filter(Boolean); // remove falsey
+  }
+
+  /**
+   * Adds an img source formatter.
+   *
+   * `formatters` are passed an array of images which will be
+   * used as 'input' images for the command. Useful for methods
+   * like `.append()` where multiple source images may be used.
+   *
+   * @param {Function} formatter
+   * @return {gm} this
+   */
+
+  proto.addSrcFormatter = function addSrcFormatter (formatter) {
+    if ('function' != typeof formatter)
+      throw new TypeError('sourceFormatter must be a function');
+    this._sourceFormatters || (this._sourceFormatters = []);
+    this._sourceFormatters.push(formatter);
+    return this;
+  }
+
+  /**
+   * Applies all _sourceFormatters
+   *
+   * @return {Array}
+   */
+
+  proto.src = function src () {
+    var arr = [];
+    for (var i = 0; i < this._sourceFormatters.length; ++i) {
+      this._sourceFormatters[i].call(this, arr);
+    }
+    return arr;
+  }
+
+  /**
+   * Image types.
+   */
+
+  var types = {
+      'jpg': /\.jpe?g$/i
+    , 'png' : /\.png$/i
+    , 'gif' : /\.gif$/i
+    , 'tiff': /\.tif?f$/i
+    , 'bmp' : /(?:\.bmp|\.dib)$/i
+    , 'webp': /\.webp$/i
+  };
+
+  types.jpeg = types.jpg;
+  types.tif = types.tiff;
+  types.dib = types.bmp;
+
+  /**
+   * Determine the type of source image.
+   *
+   * @param {String} type
+   * @return {Boolean}
+   * @example
+   *   if (this.inputIs('png')) ...
+   */
+
+  proto.inputIs = function inputIs (type) {
+    if (!type) return false;
+
+    var rgx = types[type];
+    if (!rgx) {
+      if ('.' !== type[0]) type = '.' + type;
+      rgx = new RegExp('\\' + type + '$', 'i');
+    }
+
+    return rgx.test(this.source);
+  }
+}

+ 100 - 0
node_modules/gm/lib/compare.js

@@ -0,0 +1,100 @@
+// compare
+
+var exec = require('child_process').exec;
+var utils = require('./utils');
+
+/**
+ * Compare two images uses graphicsmagicks `compare` command.
+ *
+ * gm.compare(img1, img2, 0.4, function (err, equal, equality) {
+ *   if (err) return handle(err);
+ *   console.log('The images are equal: %s', equal);
+ *   console.log('There equality was %d', equality);
+ * });
+ *
+ * @param {String} orig Path to an image.
+ * @param {String} compareTo Path to another image to compare to `orig`.
+ * @param {Number|Object} [options] Options object or the amount of difference to tolerate before failing - defaults to 0.4
+ * @param {Function} cb(err, Boolean, equality, rawOutput)
+ */
+
+module.exports = exports = function (proto) {
+  function compare(orig, compareTo, options, cb) {
+    orig = utils.escape(orig);
+    compareTo = utils.escape(compareTo);
+
+    var isImageMagick = this._options && this._options.imageMagick;
+    // compare binary for IM is `compare`, for GM it's `gm compare`
+    var bin = isImageMagick ? '' : 'gm ';
+    var execCmd = bin + 'compare -metric mse ' + orig + ' ' + compareTo;
+    var tolerance = 0.4
+    // outputting the diff image
+    if (typeof options === 'object') {
+      if (options.file) {
+        if (typeof options.file !== 'string') {
+          throw new TypeError('The path for the diff output is invalid');
+        }
+         // graphicsmagick defaults to red
+        var highlightColorOption = options.highlightColor
+          ? ' -highlight-color ' + options.highlightColor + ' '
+          : ' ';
+        var highlightStyleOption = options.highlightStyle
+          ? ' -highlight-style ' + options.highlightStyle + ' '
+          : ' ';
+        var diffFilename = utils.escape(options.file);
+        // For IM, filename is the last argument. For GM it's `-file <filename>`
+        var diffOpt = isImageMagick ? diffFilename : ('-file ' + diffFilename);
+        execCmd += highlightColorOption + highlightStyleOption  + ' ' + diffOpt;
+      }
+      
+      if (options.tolerance) {
+        if (typeof options.tolerance !== 'number') {
+          throw new TypeError('The tolerance value should be a number');
+        }
+        tolerance = options.tolerance;
+      } 
+    } else {
+      // For ImageMagick diff file is required but we don't care about it, so null it out
+      isImageMagick && (execCmd += ' null:');
+
+      if (typeof options == 'function') {
+        cb = options; // tolerance value not provided, flip the cb place
+      } else {
+        tolerance = options
+      }
+    }
+
+    exec(execCmd, function (err, stdout, stderr) {
+      // ImageMagick returns err code 2 if err, 0 if similar, 1 if dissimilar
+      if (isImageMagick) {
+        if (!err) {
+          return cb(null, 0 <= tolerance, 0, stdout);
+        }
+        if (err.code === 1) {
+          err = null;
+          stdout = stderr;
+        }
+      }
+      if (err) {
+        return cb(err);
+      }
+      // Since ImageMagick similar gives err code 0 and no stdout, there's really no matching
+      // Otherwise, output format for IM is `12.00 (0.123)` and for GM it's `Total: 0.123`
+      var regex = isImageMagick ? /\((\d+\.?[\d\-\+e]*)\)/m : /Total: (\d+\.?\d*)/m;
+      var match = regex.exec(stdout);
+      if (!match) {
+        err = new Error('Unable to parse output.\nGot ' + stdout);
+        return cb(err);
+      }
+
+      var equality = parseFloat(match[1]);
+      cb(null, equality <= tolerance, equality, stdout);
+    });
+  }
+
+  if (proto) {
+    proto.compare = compare;
+  }
+  return compare;
+};
+

+ 11 - 0
node_modules/gm/lib/convenience.js

@@ -0,0 +1,11 @@
+
+/**
+ * Extend proto
+ */
+
+module.exports = function (proto) {
+  require("./convenience/thumb")(proto);
+  require("./convenience/morph")(proto);
+  require("./convenience/sepia")(proto);
+  require("./convenience/autoOrient")(proto);
+}

+ 57 - 0
node_modules/gm/lib/convenience/autoOrient.js

@@ -0,0 +1,57 @@
+
+/**
+ * Extend proto.
+ */
+
+module.exports = function (proto) {
+
+  var exifTransforms = {
+      topleft:     ''
+    , topright:    ['-flop']
+    , bottomright: ['-rotate', 180]
+    , bottomleft:  ['-flip']
+    , lefttop:     ['-flip', '-rotate', 90]
+    , righttop:    ['-rotate', 90]
+    , rightbottom: ['-flop', '-rotate', 90]
+    , leftbottom:  ['-rotate', 270]
+  }
+
+  proto.autoOrient = function autoOrient () {
+    // Always strip EXIF data since we can't
+    // change/edit it.
+
+    // imagemagick has a native -auto-orient option
+    // so does graphicsmagick, but in 1.3.18.
+    // apt doesn't release this version yet.
+    if (this._options.imageMagick) {
+      this.out('-auto-orient');
+      this.strip();
+      return this;
+    }
+
+    this.preprocessor(function (callback) {
+      this.orientation({bufferStream: true}, function (err, orientation) {
+        if (err) return callback(err);
+
+        var transforms = exifTransforms[orientation.toLowerCase()];
+        if (transforms) {
+
+          // remove any existing transforms that might conflict
+          var index = this._out.indexOf(transforms[0]);
+          if (~index) {
+            this._out.splice(index, transforms.length);
+          }
+
+          // repage to fix coordinates
+          this._out.unshift.apply(this._out, transforms.concat('-page', '+0+0'));
+        }
+
+        this.strip();
+
+        callback();
+      });
+    });
+
+    return this;
+  }
+}

+ 61 - 0
node_modules/gm/lib/convenience/morph.js

@@ -0,0 +1,61 @@
+
+/**
+ * Module dependencies.
+ */
+
+var fs = require('fs');
+var parallel = require('array-parallel');
+
+/**
+ * Extend proto.
+ */
+
+module.exports = function (proto) {
+
+  /**
+   * Do nothing.
+   */
+
+  function noop () {}
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-morph
+  proto.morph = function morph (other, outname, callback) {
+    if (!outname) {
+      throw new Error("an output filename is required");
+    }
+
+    callback = (callback || noop).bind(this)
+
+    var self = this;
+
+    if (Array.isArray(other)) {
+      other.forEach(function (img) {
+        self.out(img);
+      });
+      self.out("-morph", other.length);
+    } else {
+      self.out(other, "-morph", 1);
+    }
+
+    self.write(outname, function (err, stdout, stderr, cmd) {
+      if (err) return callback(err, stdout, stderr, cmd);
+
+      // Apparently some platforms create the following temporary files.
+      // Check if the output file exists, if it doesn't, then
+      // work with temporary files.
+      fs.exists(outname, function (exists) {
+        if (exists) return callback(null, stdout, stderr, cmd);
+
+        parallel([
+          fs.unlink.bind(fs, outname + '.0'),
+          fs.unlink.bind(fs, outname + '.2'),
+          fs.rename.bind(fs, outname + '.1', outname)
+        ], function (err) {
+          callback(err, stdout, stderr, cmd);
+        })
+      })
+    });
+
+    return self;
+  }
+}

+ 10 - 0
node_modules/gm/lib/convenience/sepia.js

@@ -0,0 +1,10 @@
+
+/**
+ * Extend proto.
+ */
+
+module.exports = function (proto) {
+  proto.sepia = function sepia () {
+    return this.modulate(115, 0, 100).colorize(7, 21, 50);
+  }
+}

+ 73 - 0
node_modules/gm/lib/convenience/thumb.js

@@ -0,0 +1,73 @@
+
+/**
+ * Extend proto.
+ */
+
+module.exports = function (proto) {
+
+  proto.thumb = function thumb (w, h, name, quality, align, callback) {
+    var self = this
+      , args = Array.prototype.slice.call(arguments);
+
+    callback = args.pop();
+    w = args.shift();
+    h = args.shift();
+    name = args.shift();
+    quality = args.shift() || 63;
+    align = args.shift() || 'topleft';
+
+    self.size(function (err, size) {
+      if (err) {
+        return callback.apply(self, arguments);
+      }
+
+      w = parseInt(w, 10);
+      h = parseInt(h, 10);
+
+      var w1, h1;
+      var xoffset = 0;
+      var yoffset = 0;
+
+      if (size.width < size.height) {
+        w1 = w;
+        h1 = Math.floor(size.height * (w/size.width));
+        if (h1 < h) {
+          w1 = Math.floor(w1 * (((h-h1)/h) + 1));
+          h1 = h;
+        }
+      } else if (size.width > size.height) {
+        h1 = h;
+        w1 = Math.floor(size.width * (h/size.height));
+        if (w1 < w) {
+          h1 = Math.floor(h1 * (((w-w1)/w) + 1));
+          w1 = w;
+        }
+      } else if (size.width == size.height) {
+        var bigger = (w>h?w:h);
+        w1 = bigger;
+        h1 = bigger;
+      }
+
+      if (align == 'center') {
+        if (w < w1) {
+          xoffset = (w1-w)/2;
+        }
+        if (h < h1) {
+          yoffset = (h1-h)/2;
+        }
+      }
+
+      self
+      .quality(quality)
+      .in("-size", w1+"x"+h1)
+      .scale(w1, h1)
+      .crop(w, h, xoffset, yoffset)
+      .noProfile()
+      .write(name, function () {
+        callback.apply(self, arguments)
+      });
+    });
+
+    return self;
+  }
+}

+ 160 - 0
node_modules/gm/lib/drawing.js

@@ -0,0 +1,160 @@
+
+/**
+ * Module dependencies.
+ */
+
+var escape = require('./utils').escape;
+
+/**
+ * Extend proto.
+ */
+
+module.exports = function (proto) {
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-fill
+  proto.fill = function fill (color) {
+    return this.out("-fill", color || "none");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-stroke
+  proto.stroke = function stroke (color, width) {
+    if (width) {
+      this.strokeWidth(width);
+    }
+
+    return this.out("-stroke", color || "none");
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-strokewidth
+  proto.strokeWidth = function strokeWidth (width) {
+    return this.out("-strokewidth", width);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-font
+  proto.font = function font (font, size) {
+    if (size) {
+      this.fontSize(size);
+    }
+
+    return this.out("-font", font);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html
+  proto.fontSize = function fontSize (size) {
+    return this.out("-pointsize", size);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.draw = function draw (args) {
+    return this.out("-draw", [].slice.call(arguments).join(" "));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawPoint = function drawPoint (x, y) {
+    return this.draw("point", x +","+ y);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawLine = function drawLine (x0, y0, x1, y1) {
+    return this.draw("line", x0+","+y0, x1+","+y1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawRectangle = function drawRectangle (x0, y0, x1, y1, wc, hc) {
+    var shape = "rectangle"
+      , lastarg;
+
+    if ("undefined" !== typeof wc) {
+      shape = "roundRectangle";
+
+      if ("undefined" === typeof hc) {
+        hc = wc;
+      }
+
+      lastarg = wc+","+hc;
+    }
+
+    return this.draw(shape, x0+","+y0, x1+","+y1, lastarg);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawArc = function drawArc (x0, y0, x1, y1, a0, a1) {
+    return this.draw("arc", x0+","+y0, x1+","+y1, a0+","+a1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawEllipse = function drawEllipse (x0, y0, rx, ry, a0, a1) {
+    if (a0 == undefined) a0 = 0;
+    if (a1 == undefined) a1 = 360;
+    return this.draw("ellipse", x0+","+y0, rx+","+ry, a0+","+a1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawCircle = function drawCircle (x0, y0, x1, y1) {
+    return this.draw("circle", x0+","+y0, x1+","+y1);
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawPolyline = function drawPolyline () {
+    return this.draw("polyline", formatPoints(arguments));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawPolygon = function drawPolygon () {
+    return this.draw("polygon", formatPoints(arguments));
+  }
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawBezier = function drawBezier () {
+    return this.draw("bezier", formatPoints(arguments));
+  }
+
+  proto._gravities = [
+      "northwest"
+	  , "north"
+    , "northeast"
+	  , "west"
+    , "center"
+	  , "east"
+    , "southwest"
+    , "south"
+    , "southeast"];
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.drawText = function drawText (x0, y0, text, gravity) {
+    var gravity = String(gravity || "").toLowerCase()
+      , arg = ["text " + x0 + "," + y0 + " " + escape(text)];
+
+    if (~this._gravities.indexOf(gravity)) {
+      arg.unshift("gravity", gravity);
+    }
+
+    return this.draw.apply(this, arg);
+  }
+
+  proto._drawProps = ["color", "matte"];
+
+  // http://www.graphicsmagick.org/GraphicsMagick.html#details-draw
+  proto.setDraw = function setDraw (prop, x, y, method) {
+    prop = String(prop || "").toLowerCase();
+
+    if (!~this._drawProps.indexOf(prop)) {
+      return this;
+    }
+
+    return this.draw(prop, x+","+y, method);
+  }
+
+}
+
+function formatPoints (points) {
+  var len = points.length
+    , result = []
+    , i = 0;
+
+  for (; i < len; ++i) {
+    result.push(points[i].join(","));
+  }
+
+  return result;
+}

+ 300 - 0
node_modules/gm/lib/getters.js

@@ -0,0 +1,300 @@
+/**
+ * Extend proto.
+ */
+
+module.exports = function (gm) {
+
+  var proto = gm.prototype;
+
+  /**
+   * `identify` states
+   */
+
+  const IDENTIFYING = 1;
+  const IDENTIFIED = 2;
+
+  /**
+   * Map getter functions to output names.
+   *
+   * - format: specifying the -format argument (see man gm)
+   * - verbose: use -verbose instead of -format (only if necessary b/c its slow)
+   * - helper: use the conversion helper
+   */
+
+  var map = {
+      'format': { key: 'format', format: '%m ', helper: 'Format' }
+    , 'depth':  { key: 'depth',  format: '%q' }
+    , 'filesize': { key: 'Filesize', format: '%b' }
+    , 'size':  { key: 'size', format: '%wx%h ', helper: 'Geometry' }
+    , 'color': { key: 'color', format: '%k',  helper: 'Colors' }
+    , 'orientation': { key: 'Orientation', verbose: true }
+    , 'res':   { key: 'Resolution', verbose: true }
+  }
+
+  /**
+   * Getter functions
+   */
+
+  Object.keys(map).forEach(function (getter) {
+    proto[getter] = function (opts, callback) {
+      if (!callback) callback = opts, opts = {};
+      if (!callback) return this;
+
+      var val = map[getter]
+        , key = val.key
+        , self = this;
+
+      if (self.data[key]) {
+        callback.call(self, null, self.data[key]);
+        return self;
+      }
+
+      self.on(getter, callback);
+
+      self.bufferStream = !!opts.bufferStream;
+
+      if (val.verbose) {
+        self.identify(opts, function (err, stdout, stderr, cmd) {
+          if (err) {
+            self.emit(getter, err, self.data[key], stdout, stderr, cmd);
+          } else {
+            self.emit(getter, err, self.data[key]);
+          }
+        });
+        return self;
+      }
+
+      var args = makeArgs(self, val);
+      self._exec(args, function (err, stdout, stderr, cmd) {
+        if (err) {
+          self.emit(getter, err, self.data[key], stdout, stderr, cmd);
+          return;
+        }
+
+        var result = (stdout||'').trim();
+
+        if (val.helper in helper) {
+          helper[val.helper](self.data, result);
+        } else {
+          self.data[key] = result;
+        }
+
+        self.emit(getter, err, self.data[key]);
+      });
+
+      return self;
+    }
+  });
+
+  /**
+   * identify command
+   *
+   * Overwrites all internal data with the parsed output
+   * which is more accurate than the fast shortcut
+   * getters.
+   */
+
+  proto.identify = function identify (opts, callback) {
+    // identify with pattern
+    if (typeof(opts) === 'string') {
+      opts = {
+        format: opts
+      }
+    }
+    if (!callback) callback = opts, opts = {};
+    if (!callback) return this;
+    if (opts && opts.format) return identifyPattern.call(this, opts, callback);
+
+    var self = this;
+
+    if (IDENTIFIED === self._identifyState) {
+      callback.call(self, null, self.data);
+      return self;
+    }
+
+    self.on('identify', callback);
+
+    if (IDENTIFYING === self._identifyState) {
+      return self;
+    }
+
+    self._identifyState = IDENTIFYING;
+
+    self.bufferStream = !!opts.bufferStream;
+
+    var args = makeArgs(self, { verbose: true });
+
+    self._exec(args, function (err, stdout, stderr, cmd) {
+      if (err) {
+        self.emit('identify', err, self.data, stdout, stderr, cmd);
+        return;
+      }
+
+      err = parse(stdout, self);
+
+      if (err) {
+        self.emit('identify', err, self.data, stdout, stderr, cmd);
+        return;
+      }
+
+      self.data.path = self.source;
+
+      self.emit('identify', null, self.data);
+      self._identifyState = IDENTIFIED;
+    });
+
+    return self;
+  }
+
+
+  /**
+   * identify with pattern
+   *
+   * Execute `identify -format` with custom pattern
+   */
+
+  function identifyPattern (opts, callback) {
+    var self = this;
+
+    self.bufferStream = !!opts.bufferStream;
+
+    var args = makeArgs(self, opts);
+    self._exec(args, function (err, stdout, stderr, cmd) {
+      if (err) {
+        return callback.call(self, err, undefined, stdout, stderr, cmd);
+      }
+
+      callback.call(self, err, (stdout||'').trim());
+    });
+
+    return self;
+  }
+
+
+  /**
+   * Parses `identify` responses.
+   *
+   * @param {String} stdout
+   * @param {Gm} self
+   * @return {Error} [optionally]
+   */
+
+  function parse (stdout, self) {
+    // normalize
+    var parts = (stdout||"").trim().replace(/\r\n|\r/g, "\n").split("\n");
+
+    // skip the first line (its just the filename)
+    parts.shift();
+
+    try {
+      var len = parts.length
+        , rgx1 = /^( *)(.+?): (.*)$/ // key: val
+        , rgx2 = /^( *)(.+?):$/      // key: begin nested object
+        , out = { indent: {} }
+        , level = null
+        , lastkey
+        , i = 0
+        , res
+        , o
+
+      for (; i < len; ++i) {
+        res = rgx1.exec(parts[i]) || rgx2.exec(parts[i]);
+        if (!res) continue;
+
+        var indent = res[1].length
+          , key = res[2] ? res[2].trim() : '';
+
+        if ('Image' == key) continue;
+
+        var val = res[3] ? res[3].trim() : null;
+
+        // first iteration?
+        if (null === level) {
+          level = indent;
+          o = out.root = out.indent[level] = self.data;
+        } else if (indent < level) {
+          // outdent
+          if (!(indent in out.indent)) {
+            continue;
+          }
+          o = out.indent[indent];
+        } else if (indent > level) {
+          // dropping into a nested object
+          out.indent[level] = o;
+          // wierd format, key/val pair with nested children. discard the val
+          o = o[lastkey] = {};
+        }
+
+        level = indent;
+
+        if (val) {
+          o[key] = val;
+
+          if (key in helper) {
+            helper[key](o, val);
+          }
+        }
+
+        lastkey = key;
+      }
+
+    } catch (err) {
+      err.message = err.message + "\n\n  Identify stdout:\n  " + stdout;
+      return err;
+    }
+  }
+
+  /**
+   * Create an argument array for the identify command.
+   *
+   * @param {gm} self
+   * @param {Object} val
+   * @return {Array}
+   */
+
+  function makeArgs (self, val) {
+    var args = [
+        'identify'
+      , '-ping'
+    ];
+
+    if (val.format) {
+      args.push('-format', val.format);
+    }
+
+    if (val.verbose) {
+      args.push('-verbose');
+    }
+
+    args = args.concat(self.src());
+    return args;
+  }
+
+  /**
+   * identify -verbose helpers
+   */
+
+  var helper = gm.identifyHelpers = {};
+
+  helper.Geometry = function Geometry (o, val) {
+    // We only want the size of the first frame.
+    // Each frame is separated by a space.
+    var split = val.split(" ").shift().split("x");
+    o.size = {
+        width:  parseInt(split[0], 10)
+      , height: parseInt(split[1], 10)
+    }
+  };
+
+  helper.Format = function Format (o, val) {
+    o.format = val.split(" ")[0];
+  };
+
+  helper.Depth = function Depth (o, val) {
+    o.depth = parseInt(val, 10);
+  };
+
+  helper.Colors = function Colors (o, val) {
+    o.color = parseInt(val, 10);
+  };
+}

+ 17 - 0
node_modules/gm/lib/options.js

@@ -0,0 +1,17 @@
+
+module.exports = exports = function (proto) {
+  proto._options = {};
+
+  proto.options = function setOptions (options) {
+    var keys = Object.keys(options)
+      , i = keys.length
+      , key
+
+    while (i--) {
+      key = keys[i];
+      this._options[key] = options[key];
+    }
+
+    return this;
+  }
+}

+ 23 - 0
node_modules/gm/lib/utils.js

@@ -0,0 +1,23 @@
+
+/**
+ * Escape the given shell `arg`.
+ *
+ * @param {String} arg
+ * @return {String}
+ * @api public
+ */
+
+exports.escape = function escape (arg) {
+  return '"' + String(arg).trim().replace(/"/g, '\\"') + '"';
+}
+
+exports.argsToArray = function (args) {
+  var arr = [];
+
+  for (var i = 0; i <= arguments.length; i++) {
+    if ('undefined' != typeof arguments[i])
+      arr.push(arguments[i]);
+  }
+
+  return arr;
+}

+ 49 - 0
node_modules/gm/package.json

@@ -0,0 +1,49 @@
+{
+  "name": "gm",
+  "description": "GraphicsMagick and ImageMagick for node.js",
+  "version": "1.16.0",
+  "author": "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
+  "keywords": [
+    "graphics",
+    "magick",
+    "image",
+    "graphicsmagick",
+    "imagemagick",
+    "gm",
+    "convert",
+    "identify",
+    "compare"
+  ],
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "bugs": {
+    "url": "http://github.com/aheckmann/gm/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "http://www.opensource.org/licenses/mit-license.php"
+    }
+  ],
+  "main": "./index",
+  "scripts": {
+    "test": "make test-unit; make test;"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/aheckmann/gm.git"
+  },
+  "license": "MIT",
+  "devDependencies": {
+    "gleak": "0.4.0",
+    "async": "~0.2.7"
+  },
+  "dependencies": {
+    "debug": "0.7.0",
+    "array-series": "~0.1.0",
+    "array-parallel": "~0.1.0",
+    "stream-to-buffer": "~0.0.1",
+    "through": "~2.3.1"
+  }
+}

+ 1 - 0
node_modules/jsbarcode/.dockerignore

@@ -0,0 +1 @@
+**/node_modules

+ 4 - 0
node_modules/jsbarcode/.eslintignore

@@ -0,0 +1,4 @@
+test
+bin
+dist
+example

+ 24 - 0
node_modules/jsbarcode/.eslintrc

@@ -0,0 +1,24 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "parserOptions": {
+    "ecmaVersion": 7,
+    "sourceType": "module",
+    "ecmaFeatures": {
+      "experimentalObjectRestSpread": true
+    }
+  },
+  "extends": "eslint:recommended",
+  "predef": "jQuery",
+  "rules": {
+    "curly": "error",
+    "semi": [1, "always"],
+    "no-console": 2,
+    "no-control-regex": 0,
+    "indent": [1, "tab", {"SwitchCase": 1}],
+    "space-infix-ops": ["error"],
+    "comma-spacing": ["error"]
+  }
+}

+ 16 - 0
node_modules/jsbarcode/.travis.yml

@@ -0,0 +1,16 @@
+language: node_js
+sudo: required
+before_install:
+  - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+  - sudo apt-get update
+  - npm install -g gulp
+install:
+  - sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++-4.8
+  - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
+  - npm install
+after_success: npm run coveralls
+node_js:
+  - "node"
+  - "14"
+  - "12"
+  - "10"

+ 84 - 0
node_modules/jsbarcode/CONTRIBUTING.md

@@ -0,0 +1,84 @@
+Getting Started
+----
+We would :heart: to have pull requests for you. So here is how you start development with JsBarcode.
+
+First fork and clone the repo:
+````bash
+git clone git@github.com:your-username/JsBarcode.git
+````
+
+Then run ``npm install`` to set everything up. Make sure you have all dependencies of [node-canvas](https://github.com/Automattic/node-canvas) installed before doing this, or check **Using Docker** section.
+
+You are now ready to start doing your changes.
+
+JsBarcode is using [gulp](http://gulpjs.com/) in the building step. Here comes some commands that will come handy when developing.
+
+````bash
+gulp compile # Compile the code (for nodejs)
+gulp compile-web # Compiles down to JsBarcode.all.js
+gulp compress # Compiles and compresses all individual barcode files
+
+gulp watch # Listens to file changes and re-compiles automatically
+gulp watch-web # Listens to file changes and re-compiles to JsBarcode.all.js automatically
+
+gulp lint # Checking the code according to the code style specified in .eslintrc
+````
+
+Testing
+----
+JsBarcode has tests on all barcode symbologies (and more). If you want to test your changes just run ``npm test`` and the code will be compiled and tested.
+
+There are also visual tests located under ``test/browser/``.
+
+Using Docker
+----
+If you have installed [Docker](https://www.docker.com), you can avoid local installation of dependencies for [node-canvas](https://github.com/Automattic/node-canvas). For doing that, run ``npm install --ignore-scripts`` instead of ``npm install``. Then you can run tests by ``docker-compose up``
+
+Symbologies and The Core
+----
+JsBarcode is divided up in two distinct parts. The barcode symbologies (EAN-13, CODE128, ITF, ...) and the core.
+
+### Symbologies
+Implementing a new symbology is the easiest way to contribute. Just follow the standard for that symbology and create a class that generate the correct binary data.
+
+The structure of such a class is as follows:
+
+````javascript
+import Barcode from "../Barcode.js";
+
+class GenericBarcode extends Barcode{
+	constructor(data, options){
+		super(data, options); // Sets this.data and this.text
+	}
+
+	// Return the corresponding binary numbers for the data provided
+	encode(){
+		return {
+			data: "10101010101010101010101010101010101010101",
+			text: this.text
+		};
+	}
+
+	// Resturn true/false if the string provided is valid for this encoder
+	valid(){
+		return true;
+	}
+}
+````
+
+It might be a good idea to check one of the already implemented barcodes (such as [ITF14](https://github.com/lindell/JsBarcode/blob/master/src/barcodes/ITF14/index.js)) for inspiration.
+
+### The Core / Renderers
+The core part handles the API requests and calls the renderers. If you want to do any structural changes please [create an issue](https://github.com/lindell/JsBarcode/issues/new) or ask about it in the [gitter chat](https://gitter.im/lindell/JsBarcode) first.
+
+Bug fixes is of course welcome at any time :+1:
+
+Pull Requests
+----
+So you are ready to make a PR? Great! :smile:
+
+But first make sure you have checked some things.
+
+* Your code should follow the code style guide provided by [.eslintrc](https://github.com/lindell/JsBarcode/blob/master/.eslintrc) by running ``gulp lint``
+* If you implemented a new symbology, make sure you have tests for it
+* Don't commit build changes. No `dist/` or `bin/` changes in the PR. 

+ 13 - 0
node_modules/jsbarcode/Dockerfile

@@ -0,0 +1,13 @@
+FROM node:8
+
+RUN apt-get update && apt-get install -qq libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
+
+RUN mkdir -p /jsbarcode
+WORKDIR /jsbarcode
+COPY ./ ./
+
+RUN npm install
+
+CMD npm test
+
+EXPOSE 3000

+ 7 - 0
node_modules/jsbarcode/MIT-LICENSE.txt

@@ -0,0 +1,7 @@
+Copyright (c) 2016 Johan Lindell (johan@lindell.me)
+
+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.

+ 255 - 0
node_modules/jsbarcode/README.md

@@ -0,0 +1,255 @@
+<p align="center">
+	<a href="http://lindell.me/JsBarcode"><img src="http://lindell.me/JsBarcode/other/logo.svg" alt="JsBarcode"/></a>
+	<br><br>
+	<a href="http://travis-ci.org/lindell/JsBarcode"><img src="https://secure.travis-ci.org/lindell/JsBarcode.svg" alt="Build Status"/></a>
+	<a href="https://scrutinizer-ci.com/g/lindell/JsBarcode/?branch=master"><img src="https://scrutinizer-ci.com/g/lindell/JsBarcode/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"/></a>
+	<a href="https://www.jsdelivr.com/package/npm/jsbarcode"><img src="https://data.jsdelivr.com/v1/package/npm/jsbarcode/badge?style=rounded" alt="CDN"></a>
+	<a href="https://github.com/lindell/JsBarcode/blob/master/MIT-LICENSE.txt"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"/></a>
+</p>
+
+Introduction
+----
+**JsBarcode** is a **barcode generator** written in JavaScript. It supports multiple barcode formats and works in browsers and with *Node.js*. It has *no dependencies* when it is used for the web but works with *jQuery* if you are into that.
+
+
+
+Demo
+----
+#### [Barcode Generator](http://lindell.github.io/JsBarcode/generator/)
+#### [Simple CodePen Demo](http://codepen.io/lindell/pen/eZKBdO?editors=1010)
+#### [Settings CodePen Demo](http://codepen.io/lindell/pen/mPvLXx?editors=1010)
+
+Supported barcodes:
+----
+* [CODE128](https://github.com/lindell/JsBarcode/wiki/CODE128)
+  * CODE128 (automatic mode switching)
+  * CODE128 A/B/C (force mode)
+* [EAN](https://github.com/lindell/JsBarcode/wiki/EAN)
+  * EAN-13
+  * EAN-8
+  * EAN-5
+  * EAN-2
+  * UPC (A)
+  * UPC (E)
+* [CODE39](https://github.com/lindell/JsBarcode/wiki/CODE39)
+* [ITF](https://github.com/lindell/JsBarcode/wiki/ITF-14)
+  * ITF
+  * ITF-14
+* [MSI](https://github.com/lindell/JsBarcode/wiki/MSI)
+  * MSI10
+  * MSI11
+  * MSI1010
+  * MSI1110
+* [Pharmacode](https://github.com/lindell/JsBarcode/wiki/pharmacode)
+* [Codabar](https://github.com/lindell/JsBarcode/wiki/codabar)
+
+Examples for browsers:
+----
+
+#### First create a canvas (or image)
+````html
+<svg id="barcode"></svg>
+<!-- or -->
+<canvas id="barcode"></canvas>
+<!-- or -->
+<img id="barcode"/>
+````
+
+
+
+#### Simple example:
+````javascript
+JsBarcode("#barcode", "Hi!");
+// or with jQuery
+$("#barcode").JsBarcode("Hi!");
+````
+
+##### Result:
+![Result](https://s3-eu-west-1.amazonaws.com/js-barcode/barcodes/simple.svg)
+
+
+#### Example with options:
+````javascript
+JsBarcode("#barcode", "1234", {
+  format: "pharmacode",
+  lineColor: "#0aa",
+  width:4,
+  height:40,
+  displayValue: false
+});
+````
+##### Result:
+![Result](https://s3-eu-west-1.amazonaws.com/js-barcode/barcodes/advanced.svg)
+
+
+#### More advanced use case:
+````javascript
+JsBarcode("#barcode")
+  .options({font: "OCR-B"}) // Will affect all barcodes
+  .EAN13("1234567890128", {fontSize: 18, textMargin: 0})
+  .blank(20) // Create space between the barcodes
+  .EAN5("12345", {height: 85, textPosition: "top", fontSize: 16, marginTop: 15})
+  .render();
+````
+##### Result:
+![Result](https://s3-eu-west-1.amazonaws.com/js-barcode/barcodes/simple.svg)
+
+
+
+#### Or define the value and options in the HTML element:
+Use any `jsbarcode-*` or `data-*` as attributes where `*` is any option.
+````html
+<svg class="barcode"
+  jsbarcode-format="upc"
+  jsbarcode-value="123456789012"
+  jsbarcode-textmargin="0"
+  jsbarcode-fontoptions="bold">
+</svg>
+````
+
+And then initialize it with:
+````javascript
+JsBarcode(".barcode").init();
+````
+
+##### Result:
+![Result](https://s3-eu-west-1.amazonaws.com/js-barcode/barcodes/init.svg)
+
+
+
+#### Retrieve the barcode values so you can render it any way you'd like
+Pass in an object which will be filled with data.
+```javascript
+const data = {};
+JsBarcode(data, 'text', {...options});
+```
+data will be filled with a ``` encodings ``` property which has all the needed values.
+See wiki for an example of what data looks like.
+
+
+Setup for browsers:
+----
+### Step 1:
+Download or get the CDN link to the script:
+
+| Name | Supported barcodes | Size (gzip) | CDN / Download |
+|------|--------------------|:-----------:|---------------:|
+|  *All*  |  *All the barcodes!*  |  *10.1 kB*  |  *[JsBarcode.all.min.js][1]*  |
+|  CODE128  |  CODE128 (auto and force mode)  |  6.2 kB  |  [JsBarcode.code128.min.js][2]  |
+|  CODE39  |  CODE39  |  5.1 kB  |  [JsBarcode.code39.min.js][3]  |
+|  EAN / UPC  |  EAN-13, EAN-8, EAN-5, EAN-2, UPC (A)  |  6.6 kB  |  [JsBarcode.ean-upc.min.js][4]  |
+|  ITF  |  ITF, ITF-14  |  5 kB  |  [JsBarcode.itf.min.js][5]  |
+|  MSI  |  MSI, MSI10, MSI11, MSI1010, MSI1110  |  5 kB  |  [JsBarcode.msi.min.js][6]  |
+|  Pharmacode  |  Pharmacode  |  4.7 kB  |  [JsBarcode.pharmacode.min.js][7]  |
+|  Codabar  |  Codabar  |  4.9 kB  |  [JsBarcode.codabar.min.js][8]  |
+
+
+### Step 2:
+Include the script in your code:
+
+
+````html
+<script src="JsBarcode.all.min.js"></script>
+````
+
+### Step 3:
+You are done! Go generate some barcodes :smile:
+
+Bower and npm:
+----
+You can also use [Bower](http://bower.io) or [npm](https://www.npmjs.com) to install and manage the library.
+````bash
+bower install jsbarcode --save
+````
+````bash
+npm install jsbarcode --save
+````
+
+Node.js:
+----
+
+#### With canvas:
+```` javascript
+var JsBarcode = require('jsbarcode');
+
+// Canvas v1
+var Canvas = require("canvas");
+// Canvas v2
+var { createCanvas } = require("canvas");
+
+// Canvas v1
+var canvas = new Canvas();
+// Canvas v2
+var canvas = createCanvas();
+
+JsBarcode(canvas, "Hello");
+
+// Do what you want with the canvas
+// See https://github.com/Automattic/node-canvas for more information
+````
+
+#### With svg:
+```` javascript
+const { DOMImplementation, XMLSerializer } = require('xmldom');
+const xmlSerializer = new XMLSerializer();
+const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null);
+const svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+
+JsBarcode(svgNode, 'test', {
+    xmlDocument: document,
+});
+
+const svgText = xmlSerializer.serializeToString(svgNode);
+````
+
+
+Options:
+----
+For information about how to use the options, see [the wiki page](https://github.com/lindell/JsBarcode/wiki/Options).
+
+| Option | Default value | Type |
+|--------|---------------|------|
+| [`format`](https://github.com/lindell/JsBarcode/wiki/Options#format) | `"auto" (CODE128)` | `String` |
+| [`width`](https://github.com/lindell/JsBarcode/wiki/Options#width) | `2` | `Number` |
+| [`height`](https://github.com/lindell/JsBarcode/wiki/Options#height) | `100` | `Number` |
+| [`displayValue`](https://github.com/lindell/JsBarcode/wiki/Options#display-value) | `true` | `Boolean` |
+| [`text`](https://github.com/lindell/JsBarcode/wiki/Options#text) | `undefined` | `String` |
+| [`fontOptions`](https://github.com/lindell/JsBarcode/wiki/Options#font-options) | `""` | `String` |
+| [`font`](https://github.com/lindell/JsBarcode/wiki/Options#font) | `"monospace"` | `String` |
+| [`textAlign`](https://github.com/lindell/JsBarcode/wiki/Options#text-align) | `"center"` | `String` |
+| [`textPosition`](https://github.com/lindell/JsBarcode/wiki/Options#text-position) | `"bottom"` | `String` |
+| [`textMargin`](https://github.com/lindell/JsBarcode/wiki/Options#text-margin) | `2` | `Number` |
+| [`fontSize`](https://github.com/lindell/JsBarcode/wiki/Options#font-size) | `20` | `Number` |
+| [`background`](https://github.com/lindell/JsBarcode/wiki/Options#background)  | `"#ffffff"` | `String (CSS color)` |
+| [`lineColor`](https://github.com/lindell/JsBarcode/wiki/Options#line-color) | `"#000000"` | `String (CSS color)` |
+| [`margin`](https://github.com/lindell/JsBarcode/wiki/Options#margins) | `10` | `Number` |
+| [`marginTop`](https://github.com/lindell/JsBarcode/wiki/Options#margins) | `undefined` | `Number` |
+| [`marginBottom`](https://github.com/lindell/JsBarcode/wiki/Options#margins) | `undefined` | `Number` |
+| [`marginLeft`](https://github.com/lindell/JsBarcode/wiki/Options#margins) | `undefined` | `Number` |
+| [`marginRight`](https://github.com/lindell/JsBarcode/wiki/Options#margins) | `undefined` | `Number` |
+| [`valid`](https://github.com/lindell/JsBarcode/wiki/Options#valid) | `function(valid){}` | `Function` |
+
+Contributions and feedback:
+----
+We :heart: contributions and feedback.
+
+If you want to contribute, please check out the [CONTRIBUTING.md](https://github.com/lindell/JsBarcode/blob/master/CONTRIBUTING.md) file.
+
+If you have any question or suggestion [create an issue](https://github.com/lindell/JsBarcode/issues/new) or ask about it in the [gitter chat](https://gitter.im/lindell/JsBarcode).
+
+Bug reports should always be done with a [new issue](https://github.com/lindell/JsBarcode/issues/new).
+
+License:
+----
+JsBarcode is shared under the [MIT license](https://github.com/lindell/JsBarcode/blob/master/MIT-LICENSE.txt). This means you can modify and use it however you want, even for comercial use. But please give this the Github repo a :star: and write a small comment of how you are using JsBarcode in the [gitter chat](https://gitter.im/lindell/JsBarcode).
+
+
+
+[1]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/JsBarcode.all.min.js "jsdelivr all barcodes"
+[2]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/barcodes/JsBarcode.code128.min.js "jsdelivr code128"
+[3]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/barcodes/JsBarcode.code39.min.js "jsdelivr code39"
+[4]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/barcodes/JsBarcode.ean-upc.min.js "jsdelivr ean/upc"
+[5]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/barcodes/JsBarcode.itf.min.js "jsdelivr itf"
+[6]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/barcodes/JsBarcode.msi.min.js "jsdelivr msi"
+[7]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/barcodes/JsBarcode.pharmacode.min.js "jsdelivr pharmacode"
+[8]: https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/barcodes/JsBarcode.codabar.min.js "jsdelivr codabar"

+ 37 - 0
node_modules/jsbarcode/automation/barcode-building.json

@@ -0,0 +1,37 @@
+[
+  {
+    "name": "code39",
+    "names": "CODE39",
+    "barcodeFile": "./CODE39"
+  },
+  {
+    "name": "code128",
+    "names": ["CODE128, CODE128A, CODE128B, CODE128C"],
+    "barcodeFile": "./CODE128"
+  },
+  {
+    "name": "ean-upc",
+    "names": "EAN13, EAN8, EAN5, EAN2, UPC",
+    "barcodeFile": "./EAN_UPC"
+  },
+  {
+    "name": "itf",
+    "names": "ITF, ITF14",
+    "barcodeFile": "./ITF"
+  },
+  {
+    "name": "msi",
+    "names": "MSI, MSI10, MSI11, MSI1010, MSI1110",
+    "barcodeFile": "./MSI"
+  },
+  {
+    "name": "pharmacode",
+    "names": "pharmacode",
+    "barcodeFile": "./pharmacode"
+  },
+  {
+    "name": "codabar",
+    "names": "codabar",
+    "barcodeFile": "./codabar"
+  }
+]

+ 132 - 0
node_modules/jsbarcode/automation/building.js

@@ -0,0 +1,132 @@
+var gulp = require('gulp');
+var header = require('gulp-header');
+var clean = require('gulp-clean');
+var gulpWebpack = require('webpack-stream');
+var webpack = require('webpack');
+var babel = require("gulp-babel");
+var runSequence = require('gulp4-run-sequence');
+var fs = require('fs');
+
+var settings = require('./settings.json');
+var shared = require('./shared.js');
+
+gulp.task("clean", gulp.series(function () {
+	return gulp.src(["bin/", "dist/"], { read: false })
+		.pipe(clean());
+}));
+
+
+gulp.task("babel", gulp.series(function () {
+	return babelFunc();
+}));
+
+
+function babelFunc() {
+	return gulp.src("src/**/*")
+		.pipe(babel({
+			presets: ['es2015', 'stage-3']
+		}))
+		.pipe(gulp.dest("bin/"));
+}
+
+
+gulp.task("webpack", gulp.series(["babel"], function () {
+	return webpackFunc();
+}));
+
+
+function webpackFunc() {
+	return gulp.src('bin/JsBarcode.js')
+		.pipe(gulpWebpack(
+			{
+				mode: "none",
+				output: {
+					filename: 'JsBarcode.all.js'
+				}
+			}
+			, webpack))
+		.pipe(gulp.dest("dist/"));
+}
+
+
+gulp.task("webpack-min", gulp.series(["babel"], function () {
+	return webpackMin('all');
+}));
+
+
+function webpackMin(name, dest) {
+	dest = dest || './';
+	return gulp.src('bin/JsBarcode.js')
+		.pipe(gulpWebpack(
+			{
+				mode: "production",
+				output: {
+					filename: shared.minifiedFilename(name)
+				},
+			}
+			, webpack))
+		.pipe(header(settings.banner, require(settings.baseDir + 'package.json')))
+		.pipe(gulp.dest("dist/" + dest));
+}
+
+
+gulp.task("webpack-all", gulp.series(function (cb) {
+	var barcodes = require('./barcode-building.json');
+
+	// Move the real barcodes/index.js out of the way while compiling the individual barcodes
+	fs.renameSync("src/barcodes/index.js", "src/barcodes/index.tmp.js");
+
+	// Take a barcode from the barcodes array, call the functions to compile that
+	// format and have a callback when it has finished.
+	function loopBarcode(i) {
+		if (i < barcodes.length) {
+			createBarcodeInclude(barcodes[i], function () {
+				loopBarcode(i + 1);
+			});
+		}
+		else {
+			fs.renameSync("src/barcodes/index.tmp.js", "src/barcodes/index.js");
+			cb(); // Done
+		}
+	}
+
+	loopBarcode(0);
+}));
+
+
+// Takes information about a barcode formatSize
+// Modifies the barcodes/index.js file to only import the specified format
+// and then does a recompilation and minifies everything with webpack
+function createBarcodeInclude(barcode, callback) {
+	var toFile = "";
+	toFile += "import {" + barcode.names + "} from '" + barcode.barcodeFile + "'";
+	toFile += "\n";
+	toFile += "export default {" + barcode.names + "}";
+
+	// Write a new barcodes/index file that only includes the specified barcode
+	fs.writeFile("src/barcodes/index.js", toFile, function () {
+		// Remove the compiled barcodes/index file (if it exist)
+		if (fs.existsSync("bin/barcodes/index.js")) {
+			fs.unlinkSync("bin/barcodes/index.js");
+		}
+		// Re-compile with babel and webpack everything
+		babelFunc().on('end', function () {
+			webpackMin(barcode.name, 'barcodes/').on('end', callback);
+		});
+	});
+}
+
+
+gulp.task('compress', gulp.series(function (cb) {
+	runSequence(
+		"clean",
+		"webpack-all",
+		"webpack",
+		"webpack-min",
+		cb
+	);
+}));
+
+gulp.task('compile', gulp.series(['babel']));
+
+gulp.task('compile-web', gulp.series(['webpack']));

+ 9 - 0
node_modules/jsbarcode/automation/linting.js

@@ -0,0 +1,9 @@
+var gulp = require('gulp');
+var eslint = require('gulp-eslint');
+
+gulp.task("lint", function () {
+	return gulp.src(['src/**/*.js'])
+		.pipe(eslint())
+		.pipe(eslint.format())
+		.pipe(eslint.failAfterError());
+});

+ 30 - 0
node_modules/jsbarcode/automation/misc.js

@@ -0,0 +1,30 @@
+/*eslint no-console: 0 */
+
+var gulp = require('gulp');
+var request = require('request');
+var fs = require('fs');
+
+gulp.task('jsdelivr', function(callback){
+	console.log("Making request...");
+	request({
+		url: "https://api.jsdelivr.com/v1/jsdelivr/libraries?name=jsbarcode",
+		json: true
+	}, function (error, response, body) {
+		if (!error && response.statusCode === 200) {
+			var readme = fs.readFileSync('README.md', "utf-8");
+			var version = body[0].lastversion;
+
+			readme = readme.replace(/https:\/\/cdn\.jsdelivr\.net\/jsbarcode\/[0-9]+\.[0-9]+\.[0-9]+\//g,
+				"https://cdn.jsdelivr.net/jsbarcode/" + version + "/");
+
+			fs.writeFileSync('README.md', readme, 'utf8');
+
+			console.log("New version: " + version);
+			callback();
+		}
+		else{
+			console.error("Failed to make jsdelivr api request");
+			callback();
+		}
+	});
+});

+ 163 - 0
node_modules/jsbarcode/automation/releasing.js

@@ -0,0 +1,163 @@
+/*eslint
+no-console: 0
+*/
+
+var gulp = require('gulp');
+var bump = require('gulp-bump');
+var git = require('gulp-git');
+var publishRelease = require('publish-release');
+var gzipSize = require('gzip-size');
+var runSequence = require('gulp4-run-sequence');
+var fs = require('fs');
+
+var settings = require('./settings.json');
+var shared = require('./shared.js');
+
+
+gulp.task('git-release', gulp.series(['compress'], function (cb) {
+	var pkg = require(settings.baseDir + 'package.json');
+	var v = 'v' + pkg.version;
+	var message = ':package: Release ' + v;
+
+	updateReadmeFileSizes();
+
+	gulp.src(['./package.json', './bower.json', './README.md', './bin/', './dist'])
+		.pipe(git.add({ args: '--all --force' }))
+		.pipe(git.commit(message));
+
+	git.push('origin', 'master', function () {
+		git.tag(v, message, function () {
+			git.push('origin', 'master', { args: '--tags' }, cb);
+		});
+	});
+}));
+
+
+// Bump (increase) the version number
+gulp.task('bump-patch', function () {
+	return gulp.src(['./package.json', './bower.json'])
+		.pipe(bump({ type: 'patch' }))
+		.pipe(gulp.dest('./'));
+});
+
+
+gulp.task('bump-minor', function () {
+	return gulp.src(['./package.json', './bower.json'])
+		.pipe(bump({ type: 'minor' }))
+		.pipe(gulp.dest('./'));
+});
+
+
+gulp.task('bump-major', function () {
+	return gulp.src(['./package.json', './bower.json'])
+		.pipe(bump({ type: 'major' }))
+		.pipe(gulp.dest('./'));
+});
+
+
+gulp.task('npm', function (done) {
+	require('child_process').spawn('npm', ['publish'], { stdio: 'inherit' })
+		.on('close', done);
+});
+
+
+gulp.task('github-release', function (done) {
+	var pkg = require(settings.baseDir + './package.json');
+	var v = 'v' + pkg.version;
+	var name = "JsBarcode " + v;
+
+	publishRelease({
+		token: process.env.GITHUB_TOKEN,
+		owner: "lindell",
+		repo: "JsBarcode",
+		tag: v,
+		name: name,
+		assets: [__dirname + "/" + settings.baseDir + "/dist/JsBarcode.all.min.js", __dirname + "/" + settings.baseDir + "/dist/JsBarcode.all.js"]
+	}, done);
+});
+
+
+
+gulp.task('release', gulp.series(function (callback) {
+	runSequence(
+		'git-release',
+		'github-release',
+		'npm',
+		callback
+	);
+}));
+
+
+gulp.task('patch', function () {
+	runSequence(
+		'bump-patch',
+		'release',
+		releaseDone
+	);
+});
+
+
+gulp.task('minor', function () {
+	runSequence(
+		'bump-minor',
+		'release',
+		releaseDone
+	);
+});
+
+
+gulp.task('major', function () {
+	runSequence(
+		'bump-major',
+		'release',
+		releaseDone
+	);
+});
+
+function releaseDone(error) {
+	if (error) {
+		console.log(error.message);
+	}
+	else {
+		console.log('Successful!');
+	}
+}
+
+
+function updateReadmeFileSizes() {
+	var files = require('./barcode-building.json');
+	var readme = fs.readFileSync('README.md', "utf-8");
+
+	// Update .all files
+	var allData = fs.readFileSync('dist/JsBarcode.all.min.js');
+	var allFilesize = gzipSize.sync(allData);
+
+	var allRegexp = new RegExp('\\|[^\\|]*\\|([ \\t\\*]*\\[JsBarcode\\.all\\.min\\.js\\])');
+	readme = readme.replace(allRegexp, "|  *" + formatSize(allFilesize) + "*  |$1");
+
+	// Update all barcodes files
+	for (var i in files) {
+		var filename = shared.minifiedFilename(files[i].name);
+
+		var fileData = fs.readFileSync('dist/barcodes/' + filename);
+		var fileFilesize = gzipSize.sync(fileData);
+
+		var fileRegexp = new RegExp('\\|[^\\|]*\\|([ \\t]*\\[' + RegExp.escape(filename) + '\\])');
+
+		readme = readme.replace(fileRegexp, "|  " + formatSize(fileFilesize) + "  |$1");
+	}
+
+	fs.writeFileSync('README.md', readme, 'utf8');
+}
+
+
+// Util functions
+RegExp.escape = function (s) {
+	return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+};
+
+function formatSize(bytes) {
+	var kilobytes = Math.round(bytes / 1024 * 10) / 10;
+
+	return kilobytes + " kB";
+}

+ 6 - 0
node_modules/jsbarcode/automation/settings.json

@@ -0,0 +1,6 @@
+{
+  "baseDir": "../",
+  "distDir": "./dist/",
+  "binDir": "./bin/",
+  "banner": "/*! JsBarcode v<%= version %> | (c) <%= author %> | <%= license %> license */\n"
+}

+ 5 - 0
node_modules/jsbarcode/automation/shared.js

@@ -0,0 +1,5 @@
+module.exports = {};
+
+module.exports.minifiedFilename = function(name){
+	return "JsBarcode." + name + ".min.js";
+};

+ 252 - 0
node_modules/jsbarcode/bin/JsBarcode.js

@@ -0,0 +1,252 @@
+'use strict';
+
+var _barcodes = require('./barcodes/');
+
+var _barcodes2 = _interopRequireDefault(_barcodes);
+
+var _merge = require('./help/merge.js');
+
+var _merge2 = _interopRequireDefault(_merge);
+
+var _linearizeEncodings = require('./help/linearizeEncodings.js');
+
+var _linearizeEncodings2 = _interopRequireDefault(_linearizeEncodings);
+
+var _fixOptions = require('./help/fixOptions.js');
+
+var _fixOptions2 = _interopRequireDefault(_fixOptions);
+
+var _getRenderProperties = require('./help/getRenderProperties.js');
+
+var _getRenderProperties2 = _interopRequireDefault(_getRenderProperties);
+
+var _optionsFromStrings = require('./help/optionsFromStrings.js');
+
+var _optionsFromStrings2 = _interopRequireDefault(_optionsFromStrings);
+
+var _ErrorHandler = require('./exceptions/ErrorHandler.js');
+
+var _ErrorHandler2 = _interopRequireDefault(_ErrorHandler);
+
+var _exceptions = require('./exceptions/exceptions.js');
+
+var _defaults = require('./options/defaults.js');
+
+var _defaults2 = _interopRequireDefault(_defaults);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// The protype of the object returned from the JsBarcode() call
+
+
+// Help functions
+var API = function API() {};
+
+// The first call of the library API
+// Will return an object with all barcodes calls and the data that is used
+// by the renderers
+
+
+// Default values
+
+
+// Exceptions
+// Import all the barcodes
+var JsBarcode = function JsBarcode(element, text, options) {
+	var api = new API();
+
+	if (typeof element === "undefined") {
+		throw Error("No element to render on was provided.");
+	}
+
+	// Variables that will be pased through the API calls
+	api._renderProperties = (0, _getRenderProperties2.default)(element);
+	api._encodings = [];
+	api._options = _defaults2.default;
+	api._errorHandler = new _ErrorHandler2.default(api);
+
+	// If text is set, use the simple syntax (render the barcode directly)
+	if (typeof text !== "undefined") {
+		options = options || {};
+
+		if (!options.format) {
+			options.format = autoSelectBarcode();
+		}
+
+		api.options(options)[options.format](text, options).render();
+	}
+
+	return api;
+};
+
+// To make tests work TODO: remove
+JsBarcode.getModule = function (name) {
+	return _barcodes2.default[name];
+};
+
+// Register all barcodes
+for (var name in _barcodes2.default) {
+	if (_barcodes2.default.hasOwnProperty(name)) {
+		// Security check if the propery is a prototype property
+		registerBarcode(_barcodes2.default, name);
+	}
+}
+function registerBarcode(barcodes, name) {
+	API.prototype[name] = API.prototype[name.toUpperCase()] = API.prototype[name.toLowerCase()] = function (text, options) {
+		var api = this;
+		return api._errorHandler.wrapBarcodeCall(function () {
+			// Ensure text is options.text
+			options.text = typeof options.text === 'undefined' ? undefined : '' + options.text;
+
+			var newOptions = (0, _merge2.default)(api._options, options);
+			newOptions = (0, _optionsFromStrings2.default)(newOptions);
+			var Encoder = barcodes[name];
+			var encoded = encode(text, Encoder, newOptions);
+			api._encodings.push(encoded);
+
+			return api;
+		});
+	};
+}
+
+// encode() handles the Encoder call and builds the binary string to be rendered
+function encode(text, Encoder, options) {
+	// Ensure that text is a string
+	text = "" + text;
+
+	var encoder = new Encoder(text, options);
+
+	// If the input is not valid for the encoder, throw error.
+	// If the valid callback option is set, call it instead of throwing error
+	if (!encoder.valid()) {
+		throw new _exceptions.InvalidInputException(encoder.constructor.name, text);
+	}
+
+	// Make a request for the binary data (and other infromation) that should be rendered
+	var encoded = encoder.encode();
+
+	// Encodings can be nestled like [[1-1, 1-2], 2, [3-1, 3-2]
+	// Convert to [1-1, 1-2, 2, 3-1, 3-2]
+	encoded = (0, _linearizeEncodings2.default)(encoded);
+
+	// Merge
+	for (var i = 0; i < encoded.length; i++) {
+		encoded[i].options = (0, _merge2.default)(options, encoded[i].options);
+	}
+
+	return encoded;
+}
+
+function autoSelectBarcode() {
+	// If CODE128 exists. Use it
+	if (_barcodes2.default["CODE128"]) {
+		return "CODE128";
+	}
+
+	// Else, take the first (probably only) barcode
+	return Object.keys(_barcodes2.default)[0];
+}
+
+// Sets global encoder options
+// Added to the api by the JsBarcode function
+API.prototype.options = function (options) {
+	this._options = (0, _merge2.default)(this._options, options);
+	return this;
+};
+
+// Will create a blank space (usually in between barcodes)
+API.prototype.blank = function (size) {
+	var zeroes = new Array(size + 1).join("0");
+	this._encodings.push({ data: zeroes });
+	return this;
+};
+
+// Initialize JsBarcode on all HTML elements defined.
+API.prototype.init = function () {
+	// Should do nothing if no elements where found
+	if (!this._renderProperties) {
+		return;
+	}
+
+	// Make sure renderProperies is an array
+	if (!Array.isArray(this._renderProperties)) {
+		this._renderProperties = [this._renderProperties];
+	}
+
+	var renderProperty;
+	for (var i in this._renderProperties) {
+		renderProperty = this._renderProperties[i];
+		var options = (0, _merge2.default)(this._options, renderProperty.options);
+
+		if (options.format == "auto") {
+			options.format = autoSelectBarcode();
+		}
+
+		this._errorHandler.wrapBarcodeCall(function () {
+			var text = options.value;
+			var Encoder = _barcodes2.default[options.format.toUpperCase()];
+			var encoded = encode(text, Encoder, options);
+
+			render(renderProperty, encoded, options);
+		});
+	}
+};
+
+// The render API call. Calls the real render function.
+API.prototype.render = function () {
+	if (!this._renderProperties) {
+		throw new _exceptions.NoElementException();
+	}
+
+	if (Array.isArray(this._renderProperties)) {
+		for (var i = 0; i < this._renderProperties.length; i++) {
+			render(this._renderProperties[i], this._encodings, this._options);
+		}
+	} else {
+		render(this._renderProperties, this._encodings, this._options);
+	}
+
+	return this;
+};
+
+API.prototype._defaults = _defaults2.default;
+
+// Prepares the encodings and calls the renderer
+function render(renderProperties, encodings, options) {
+	encodings = (0, _linearizeEncodings2.default)(encodings);
+
+	for (var i = 0; i < encodings.length; i++) {
+		encodings[i].options = (0, _merge2.default)(options, encodings[i].options);
+		(0, _fixOptions2.default)(encodings[i].options);
+	}
+
+	(0, _fixOptions2.default)(options);
+
+	var Renderer = renderProperties.renderer;
+	var renderer = new Renderer(renderProperties.element, encodings, options);
+	renderer.render();
+
+	if (renderProperties.afterRender) {
+		renderProperties.afterRender();
+	}
+}
+
+// Export to browser
+if (typeof window !== "undefined") {
+	window.JsBarcode = JsBarcode;
+}
+
+// Export to jQuery
+/*global jQuery */
+if (typeof jQuery !== 'undefined') {
+	jQuery.fn.JsBarcode = function (content, options) {
+		var elementArray = [];
+		jQuery(this).each(function () {
+			elementArray.push(this);
+		});
+		return JsBarcode(elementArray, content, options);
+	};
+}
+
+// Export to commonJS
+module.exports = JsBarcode;

+ 17 - 0
node_modules/jsbarcode/bin/barcodes/Barcode.js

@@ -0,0 +1,17 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Barcode = function Barcode(data, options) {
+	_classCallCheck(this, Barcode);
+
+	this.data = data;
+	this.text = options.text || data;
+	this.options = options;
+};
+
+exports.default = Barcode;

+ 167 - 0
node_modules/jsbarcode/bin/barcodes/CODE128/CODE128.js

@@ -0,0 +1,167 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _Barcode2 = require('../Barcode.js');
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+var _constants = require('./constants');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+// This is the master class,
+// it does require the start code to be included in the string
+var CODE128 = function (_Barcode) {
+	_inherits(CODE128, _Barcode);
+
+	function CODE128(data, options) {
+		_classCallCheck(this, CODE128);
+
+		// Get array of ascii codes from data
+		var _this = _possibleConstructorReturn(this, (CODE128.__proto__ || Object.getPrototypeOf(CODE128)).call(this, data.substring(1), options));
+
+		_this.bytes = data.split('').map(function (char) {
+			return char.charCodeAt(0);
+		});
+		return _this;
+	}
+
+	_createClass(CODE128, [{
+		key: 'valid',
+		value: function valid() {
+			// ASCII value ranges 0-127, 200-211
+			return (/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)
+			);
+		}
+
+		// The public encoding function
+
+	}, {
+		key: 'encode',
+		value: function encode() {
+			var bytes = this.bytes;
+			// Remove the start code from the bytes and set its index
+			var startIndex = bytes.shift() - 105;
+			// Get start set by index
+			var startSet = _constants.SET_BY_CODE[startIndex];
+
+			if (startSet === undefined) {
+				throw new RangeError('The encoding does not start with a start character.');
+			}
+
+			if (this.shouldEncodeAsEan128() === true) {
+				bytes.unshift(_constants.FNC1);
+			}
+
+			// Start encode with the right type
+			var encodingResult = CODE128.next(bytes, 1, startSet);
+
+			return {
+				text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, '') : this.text,
+				data:
+				// Add the start bits
+				CODE128.getBar(startIndex) +
+				// Add the encoded bits
+				encodingResult.result +
+				// Add the checksum
+				CODE128.getBar((encodingResult.checksum + startIndex) % _constants.MODULO) +
+				// Add the end bits
+				CODE128.getBar(_constants.STOP)
+			};
+		}
+
+		// GS1-128/EAN-128
+
+	}, {
+		key: 'shouldEncodeAsEan128',
+		value: function shouldEncodeAsEan128() {
+			var isEAN128 = this.options.ean128 || false;
+			if (typeof isEAN128 === 'string') {
+				isEAN128 = isEAN128.toLowerCase() === 'true';
+			}
+			return isEAN128;
+		}
+
+		// Get a bar symbol by index
+
+	}], [{
+		key: 'getBar',
+		value: function getBar(index) {
+			return _constants.BARS[index] ? _constants.BARS[index].toString() : '';
+		}
+
+		// Correct an index by a set and shift it from the bytes array
+
+	}, {
+		key: 'correctIndex',
+		value: function correctIndex(bytes, set) {
+			if (set === _constants.SET_A) {
+				var charCode = bytes.shift();
+				return charCode < 32 ? charCode + 64 : charCode - 32;
+			} else if (set === _constants.SET_B) {
+				return bytes.shift() - 32;
+			} else {
+				return (bytes.shift() - 48) * 10 + bytes.shift() - 48;
+			}
+		}
+	}, {
+		key: 'next',
+		value: function next(bytes, pos, set) {
+			if (!bytes.length) {
+				return { result: '', checksum: 0 };
+			}
+
+			var nextCode = void 0,
+			    index = void 0;
+
+			// Special characters
+			if (bytes[0] >= 200) {
+				index = bytes.shift() - 105;
+				var nextSet = _constants.SWAP[index];
+
+				// Swap to other set
+				if (nextSet !== undefined) {
+					nextCode = CODE128.next(bytes, pos + 1, nextSet);
+				}
+				// Continue on current set but encode a special character
+				else {
+						// Shift
+						if ((set === _constants.SET_A || set === _constants.SET_B) && index === _constants.SHIFT) {
+							// Convert the next character so that is encoded correctly
+							bytes[0] = set === _constants.SET_A ? bytes[0] > 95 ? bytes[0] - 96 : bytes[0] : bytes[0] < 32 ? bytes[0] + 96 : bytes[0];
+						}
+						nextCode = CODE128.next(bytes, pos + 1, set);
+					}
+			}
+			// Continue encoding
+			else {
+					index = CODE128.correctIndex(bytes, set);
+					nextCode = CODE128.next(bytes, pos + 1, set);
+				}
+
+			// Get the correct binary encoding and calculate the weight
+			var enc = CODE128.getBar(index);
+			var weight = index * pos;
+
+			return {
+				result: enc + nextCode.result,
+				checksum: weight + nextCode.checksum
+			};
+		}
+	}]);
+
+	return CODE128;
+}(_Barcode3.default);
+
+exports.default = CODE128;

Some files were not shown because too many files changed in this diff