Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@connectedyard/node-jlink

Package Overview
Dependencies
Maintainers
7
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@connectedyard/node-jlink - npm Package Compare versions

Comparing version 1.0.10 to 1.1.0

43

lib/jlinkexe.js

@@ -10,3 +10,44 @@ ( function(){

function JLinkError( message ){
this.constructor.prototype.__proto__ = Error.prototype; // Make this an instanceof Error.
Error.call(this); // Does not seem necessary. Perhaps remove this line?
Error.captureStackTrace(this, this.constructor); // Creates the this.stack getter
this.name = this.constructor.name; // Used to cause messages like "UserError: message" instead of the default "Error: message"
this.message = message; // Used to set the message
}
/*
ERROR: {
stdout: 'SEGGER J-Link Commander V5.10n (Compiled Feb 19 2016 18:41:48)\n
DLL version V5.10n, compiled Feb 19 2016 18:41:43\n\n
Connecting to J-Link via USB...O.K.\n
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Feb 12 2016 12:15:53\n
Hardware version: V1.00\nS/N: 681501598\nEmulator has Trace capability\n\
VTref = 3.300V\n\n\n
Type "connect" to establish a target connection, \'?\' for help\n
J-Link Commander will now exit on Error\n
Target connection not established yet but required for command.\n
Device "NRF51822_XXAA" selected.\n\n\nCan not connect to target.\n
Could not read memory.\n',
stderr: '',
code: 1,
error: null }
*/
JLinkError.withExecResult = function( execResult ){
if( !execResult ) return new JLinkError( "JLink command failed" );
var text = execResult.stdout;
if( text && text.length > 0 ){
if( text.indexOf("J-Link Commander will now exit on Error") !== -1 ){
text = text.split("J-Link Commander will now exit on Error")[1]; // everything after this error sentinel
}
}else{
text = text.stderr;
}
text = text.split('\n').join(' '); // single line what's left
var error = new JLinkError( text );
return error;
};
exports.defaultJLinkEXEForPlatform = function(){

@@ -73,3 +114,3 @@ if( process.env[ 'JLINKEXE' ] ){

if( code === 0 ) resolve( result );
else reject( result );
else reject( JLinkError.withExecResult( result));
});

@@ -76,0 +117,0 @@

2

package.json
{
"name": "@connectedyard/node-jlink",
"version": "1.0.10",
"version": "1.1.0",
"description": "jLinkexe driver for nodejs",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -33,4 +33,5 @@ ( function(){

.catch( function( error ){
console.log("Test Fail: ", error );
console.log("Test Failed");
throw error;
});
})();

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc