
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
napi-bindings
Advanced tools
Simple Node bindings for the Nymi API (NAPI) 4.0.
Please refer to the official Nymi Github or SDK Documentation for details.
All Platforms supported by the Nymi SDK 4.0 should be supported by this module.
Tested on Windows 7 64bit and macOS Sierra 10.12.2.
npm i napi-bindings
Create a file in the root directory of your project named config.json
with the following content.
{
"neaName" : "sample",
"sigAlgorithm" : "NIST256P",
"automaticFirmwareVersion" : false
}
This example will initialize the NAPI, request info about all provisioned Nymi Bands and print the result. The example makes the assumption you are using the Nymulator on your local machine on default port 9088.
const napi = require('napi-bindings')(true); // true for using Nymulator or false for using physical Nymi Band (default: false)
try {
let init, put, get;
init = napi.jsonNapiConfigureD('.', napi.LogLevel.NORMAL, 9088, '127.0.0.1');
console.assert(init === napi.ConfigOutcome.OKAY, 'INIT: %s', Object.keys(napi.ConfigOutcome)[init]);
put = napi.jsonNapiPutD(JSON.stringify({path: 'info/get', exchange: 'provisions'}));
console.assert(put === napi.JsonPutOutcome.OKAY, 'PUT: %s', Object.keys(napi.JsonPutOutcome)[put]);
get = napi.jsonNapiGetD();
console.assert(get.outcome === napi.JsonGetOutcome.OKAY, 'GET: %s', Object.keys(napi.JsonGetOutcome)[get]);
console.log(JSON.parse(get.message));
} catch(err) {
console.error(err.message);
} finally {
napi.jsonNapiTerminateD();
}
See LICENSE file.
FAQs
Nymi API bindings to work with Nymi SDK 4.x
We found that napi-bindings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.