Removed dependency on async.js, prepared npm publishing

pull/20/head
Christoph Oberhofer 11 years ago
parent 6f02116663
commit 8bc119b62e

@ -48,18 +48,13 @@ module.exports = function(grunt) {
"glMatrixAddon" : { "glMatrixAddon" : {
"deps" : ["glMatrix"], "deps" : ["glMatrix"],
"exports" : "glMatrixAddon" "exports" : "glMatrixAddon"
},
"async": {
"deps": [],
"exports": "async"
} }
}, },
"paths" : { "paths" : {
"typedefs" : "typedefs", "typedefs" : "typedefs",
"glMatrix" : "vendor/glMatrix", "glMatrix" : "vendor/glMatrix",
"glMatrixAddon" : "glMatrixAddon", "glMatrixAddon" : "glMatrixAddon"
"async": "vendor/async"
} }
} }
} }

@ -5,6 +5,8 @@
//see this AMD call, not the internal modules in //see this AMD call, not the internal modules in
//the closure below. //the closure below.
define([], factory); define([], factory);
} else if (typeof module !== 'undefined') {
module.exports = factory();
} else { } else {
//Browser globals case. Just assign the //Browser globals case. Just assign the
//result to a property on the global. //result to a property on the global.

1147
dist/quagga.js vendored

File diff suppressed because it is too large Load Diff

@ -1,8 +1,8 @@
{ {
"name": "quagga", "name": "quagga",
"version": "0.1.0", "version": "0.4.0",
"description": "This README would normally document whatever steps are necessary to get your application up and running.", "description": "An advanced barcode-scanner written in JavaScript",
"main": "js/main.js", "main": "dist/quagga.js",
"devDependencies": { "devDependencies": {
"grunt": "~0.4.5", "grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0", "grunt-contrib-jshint": "~0.10.0",
@ -26,6 +26,10 @@
"scripts": { "scripts": {
"test": "karma start" "test": "karma start"
}, },
"author": "", "repository": {
"license": "ISC" "type": "git",
"url": "https://github.com/serratus/quaggaJS.git"
},
"author": "Christoph Oberhofer <ch.oberhofer@gmail.com>",
"license": "MIT"
} }

@ -1,8 +1,8 @@
/* jshint undef: true, unused: true, browser:true, devel: true */ /* jshint undef: true, unused: true, browser:true, devel: true */
/* global define, vec2, importScripts */ /* global define, vec2, importScripts */
define(["code_128_reader", "ean_reader", "input_stream", "image_wrapper", "barcode_locator", "barcode_decoder", "frame_grabber", "html_utils", "config", "events", "camera_access", "async", "image_debug"], define(["code_128_reader", "ean_reader", "input_stream", "image_wrapper", "barcode_locator", "barcode_decoder", "frame_grabber", "html_utils", "config", "events", "camera_access", "image_debug"],
function(Code128Reader, EANReader, InputStream, ImageWrapper, BarcodeLocator, BarcodeDecoder, FrameGrabber, HtmlUtils, _config, Events, CameraAccess, async, ImageDebug) { function(Code128Reader, EANReader, InputStream, ImageWrapper, BarcodeLocator, BarcodeDecoder, FrameGrabber, HtmlUtils, _config, Events, CameraAccess, ImageDebug) {
"use strict"; "use strict";
var _inputStream, var _inputStream,
@ -223,14 +223,19 @@ function(Code128Reader, EANReader, InputStream, ImageWrapper, BarcodeLocator, Ba
} }
function initWorkers(cb) { function initWorkers(cb) {
var i;
_workerPool = []; _workerPool = [];
async.times(_config.numOfWorkers, function(n, next) { for (i = 0; i < _config.numOfWorkers; i++) {
initWorker(function(workerThread) { initWorker(workerInitialized);
_workerPool.push(workerThread); }
next(null);
}); function workerInitialized(workerThread) {
}, cb); _workerPool.push(workerThread);
if (_workerPool.length >= _config.numOfWorkers){
cb();
}
}
} }
function initWorker(cb) { function initWorker(cb) {

1123
src/vendor/async.js vendored

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save