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" : {
"deps" : ["glMatrix"],
"exports" : "glMatrixAddon"
},
"async": {
"deps": [],
"exports": "async"
}
},
"paths" : {
"typedefs" : "typedefs",
"glMatrix" : "vendor/glMatrix",
"glMatrixAddon" : "glMatrixAddon",
"async": "vendor/async"
"glMatrixAddon" : "glMatrixAddon"
}
}
}

@ -5,6 +5,8 @@
//see this AMD call, not the internal modules in
//the closure below.
define([], factory);
} else if (typeof module !== 'undefined') {
module.exports = factory();
} else {
//Browser globals case. Just assign the
//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",
"version": "0.1.0",
"description": "This README would normally document whatever steps are necessary to get your application up and running.",
"main": "js/main.js",
"version": "0.4.0",
"description": "An advanced barcode-scanner written in JavaScript",
"main": "dist/quagga.js",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0",
@ -26,6 +26,10 @@
"scripts": {
"test": "karma start"
},
"author": "",
"license": "ISC"
"repository": {
"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 */
/* 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"],
function(Code128Reader, EANReader, InputStream, ImageWrapper, BarcodeLocator, BarcodeDecoder, FrameGrabber, HtmlUtils, _config, Events, CameraAccess, async, ImageDebug) {
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, ImageDebug) {
"use strict";
var _inputStream,
@ -223,14 +223,19 @@ function(Code128Reader, EANReader, InputStream, ImageWrapper, BarcodeLocator, Ba
}
function initWorkers(cb) {
var i;
_workerPool = [];
async.times(_config.numOfWorkers, function(n, next) {
initWorker(function(workerThread) {
_workerPool.push(workerThread);
next(null);
});
}, cb);
for (i = 0; i < _config.numOfWorkers; i++) {
initWorker(workerInitialized);
}
function workerInitialized(workerThread) {
_workerPool.push(workerThread);
if (_workerPool.length >= _config.numOfWorkers){
cb();
}
}
}
function initWorker(cb) {

1123
src/vendor/async.js vendored

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