Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Aug 30, 2021
1 parent 773198b commit 6f8ca37
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
42 changes: 0 additions & 42 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,45 +230,3 @@ var MUPSaobracajnaApi = /** @class */ (function () {
}());
exports.MUPSaobracajnaApi = MUPSaobracajnaApi;
exports.default = MUPSaobracajnaApi;
/* EXAMPLE */
var smartcard = require("smartcard");
var devices = new smartcard.Devices();
devices.on("device-activated", function (e) {
console.log("---Device:", e.device.name);
console.log("Waiting for card...");
e.device.on("card-inserted", function (e) {
console.log("---Card:", e.card.getAtr());
_test(e.device.name);
});
});
console.log("Waiting for device...");
var _test = function (device) { return __awaiter(void 0, void 0, void 0, function () {
var celik, data, e_1;
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
console.log("---START---");
celik = new MUPSaobracajnaApi(device);
_b.label = 1;
case 1:
_b.trys.push([1, 3, 4, 6]);
return [4 /*yield*/, celik.readAllData()];
case 2:
data = _b.sent();
console.log(data);
return [3 /*break*/, 6];
case 3:
e_1 = _b.sent();
console.log((_a = e_1.message) !== null && _a !== void 0 ? _a : new Error(e_1));
return [3 /*break*/, 6];
case 4: return [4 /*yield*/, celik.end()];
case 5:
_b.sent();
console.log("---END---");
process.exit();
return [7 /*endfinally*/];
case 6: return [2 /*return*/];
}
});
}); };
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node_saobracajna_api",
"version": "1.0.0-2",
"version": "1.0.0-3",
"description": "NodeJS Wrapper around SaobracajnaAPI (MUP RS) for reading vehicle cards",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down

0 comments on commit 6f8ca37

Please sign in to comment.