EddieLa / JOB

A Barcode scanner capapable of reading Code128, Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar and EAN-13 barcodes in javascript.
http://eddiela.github.io/JOB
600 stars 204 forks source link

[Question] Using bower #31

Closed igorissen closed 3 years ago

igorissen commented 9 years ago

Hi,

For my Angular project, I'm using Bower. So I've executed this command because there isn't (for now) a bower package for your library :

bower install --save https://github.com/EddieLa/JOB.git

It works great. First question: did you intend to create a bower package for your library ? Now when you include the library

...
<script src="assets/vendor/JOB/src/JOB.js"></script>
...

and call the init function

...
JOB.Init();
...

these lines place some issues

...
DecoderWorker: new Worker("DecoderWorker.js"),
...
Init: function () {
...
script.src = "exif.js";
...
}

because DecoderWorker.js and exif.js have a wrong file path. If I want your library to work I need to change your code to

...
DecoderWorker: new Worker("assets/vendor/JOB/src/DecoderWorker.js"),
...
Init: function () {
...
script.src = "assets/vendor/JOB/src/exif.js";
...
}

and it's a complicated when you want to deploy your application. Maybe it would be better to add the DecoderWorker.js and exif.js files like your library

<script src="path/to/DecoderWorker.js"></script>
<script src="path/to/exif.js"></script>
<script src="path/to/JOB.js"></script>

What do you think about this?

EddieLa commented 9 years ago

Hi,

I had not intented to make a bower package, I had in fact never heard of bower until you mentioned. I'm not actually very involved in web or javascript development I mostly do .net/java so I'm afraid I can't really help you here.

igorissen commented 9 years ago

Ok. I will try to create a bower package for your library. It's also the first time for me.

seabornlee commented 9 years ago

Bower is very popular in front-end community. I must be great to have the library in bower repository.

seangates commented 9 years ago

@igorissen Did you get the Bower fork working? I created one for NPM with this most recent pull request. I'm sure Bower would be really easy to get going.