mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +08:00
Merge pull request #20 from serratus/issue-17
Issue 17: prepare for npm publishing
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
|||||||
|
test/
|
||||||
|
example/
|
||||||
|
examples/
|
||||||
|
.sass-cache/
|
||||||
|
node_modules/
|
||||||
|
coverage/
|
||||||
|
.project
|
||||||
|
_site/
|
||||||
|
_includes/
|
||||||
|
.idea/
|
||||||
|
doc/
|
||||||
|
.gitignore
|
||||||
+1
-6
@@ -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.
|
||||||
|
|||||||
Vendored
+15
-1132
File diff suppressed because it is too large
Load Diff
+9
-5
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-8
@@ -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) {
|
||||||
|
|||||||
Vendored
-1123
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user