Open maucrvlh opened 6 years ago
Trying to run this code:
const { Provider } = require("node-webcrypto-p11"); const provider = new Provider("/usr/lib/libaetpkss.so.3"); let tokens = 0; provider .on("listening", (info) => { console.log("listening"); console.log(info); console.log(`Providers: ${info.providers.length}`); tokens = info.providers.length; }) .on("token", (info) => { console.log("Removed:", info.removed); console.log("Added:", info.added); }) .on("error", (e) => { console.error(e); }) provider.open();
Returns:
You need to use babel-polyfill. node-webcrypto-p11 uses PKIjs which doesn't work without babel module
babel-polyfill
node-webcrypto-p11
PKIjs
Add this line to your code
require("babel-polyfill")
Trying to run this code:
Returns: