Permalink
Browse files

First version

  • Loading branch information...
thomaschaaf committed Nov 18, 2012
1 parent a6287fc commit fccbe54cc72821dd63b8c489d4ad96feb869c25e
Showing with 111 additions and 3 deletions.
  1. +51 −3 README.md
  2. +29 −0 lib/main.js
  3. +31 −0 package.json
View
@@ -1,4 +1,52 @@
-node-zxing
-==========
+# Node-ZXing
-Node.JS wrapper for ZXing
+This is a Node.JS wrapper for [Zebra Crossing aka ZXing](http://code.google.com/p/zxing/).
+
+## Installation
+
+`npm install node-zxing`
+
+## Usage overview
+
+```javascript
+var qrdecoder = require('node-zxing');
+var path = "./a.jpg";
+qrdecode.decode(a);
+```
+
+## TODO
+
+See the [issue tracker](http://github.com/komola/node-zxing).
+
+## Author
+
+Thomas Schaaf (schaaf@komola.de).
+Development was sponsored by [komola](http://www.komola.de/).
+
+## Used by
+
+- [Prismabox](http://prismabox.de/)
+
+## License
+
+(The MIT License)
+
+Copyright (C) 2012 Thomas Schaaf
+
+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.
View
@@ -0,0 +1,29 @@
+/* Copyright 2012 Thomas Schaaf, see LICENSE */
+"use strict";
+
+var exec = require('child_process').exec;
+
+module.exports = function (ZXingLocation) {
+ if(ZXingLocation == null) {
+ ZXingLocation = "./"
+ }
+
+ var commandLineOptions = " ";
+ if(defaults.try_harder) {
+ commandLineOptions += "--try_harder ";
+ }
+ return {
+ decode: function(path, cb) {
+ qrcode = "";
+ exec('java -cp '+ZXingLocation+'/javase/javase.jar:'+ZXingLocation+'/core/core.jar com.google.zxing.client.j2se.CommandLineRunner'+commandLineOptions+''+path, function(err, stdout, strerr){
+ if(err !== null) {
+ console.log(err, stdout, stderr);
+ cb(error, '');
+ } else {
+ console.log(stdout);
+ cb(null, stdout);
+ }
+ });
+ }
+ };
+}
View
@@ -0,0 +1,31 @@
+{
+ "author": "Thomas Schaaf <schaaf@komola.de> (http://www.komola.de/)",
+ "name": "node-zxing",
+ "maintainers":[
+ {
+ "name":"Thomas Schaaf",
+ "email":"schaaf@komola.de"
+ }
+ ],
+ "description": "ZXing Wrapper",
+ "version": "0.0.1",
+ "homepage": "https://github.com/komola/node-zxing",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/komola/node-zxing.git"
+ },
+ "engines": {
+ "node": ">= v0.6.0"
+ },
+ "directories" : { "lib" : "./lib" },
+ "main": "lib/main",
+ "licenses" : [
+ {
+ "type": "MIT",
+ "url": "http://github.com/komola/node-zxing/blob/master/LICENSE"
+ }
+ ],
+ "keywords": ["qrcode", "zxing"],
+ "dependencies": {},
+ "devDependencies": {}
+}

0 comments on commit fccbe54

Please sign in to comment.