Remove bindings dependency (require the built addon directly because the build output location is well-known and constant)
Add note about a possible error and its solution to the README Improve .editorconfig Run tests in CI workflow
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
const EventEmitter = require('events');
|
||||
const pcsclite = require('bindings')('pcsclite');
|
||||
|
||||
// pcsclite.node is a Node.js native C++ addon that is compiled during installation
|
||||
// via node-gyp (see package.json > scripts > install)
|
||||
// the build output name and directory is constant so we can require it directly
|
||||
// see https://github.com/nodejs/node-gyp/issues/263, https://github.com/nodejs/node-gyp/issues/631
|
||||
const pcsclite = require('../build/Release/pcsclite.node');
|
||||
|
||||
const { PCSCLite, CardReader } = pcsclite;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user