Skip to content

Instantly share code, notes, and snippets.

View erossignon's full-sized avatar

Etienne erossignon

View GitHub Profile
@erossignon
erossignon / gist:d00db28dbea5741b6a19
Last active August 29, 2015 14:04
commenting out 'assert' in javascript code
var fs = require("fs")
esprima = require('esprima'),
escodegen = require('escodegen'),
estraverse = require('estraverse');
;
function is_assert_call_node(node) {
@erossignon
erossignon / gist:e81eaf4ba1390bf76d2b
Last active August 29, 2015 14:23
Browserify nodeopcua
export NODE_PATH=`pwd`
ulimit -n 3000
npm install browserify2 minifyjs -g
browserify --bare bin/simple_server.js --exclude usage --exclude node-expat --exclude ursa --exclude x509 | minifyjs --mangle toplevel --reserved '$,require,exports' --comments --preamble "// * Copyright 2014-2015 NodeOPCUA" -m -o simple_server.min.js
@erossignon
erossignon / gist:5cd4704d52591b53f12f
Created March 18, 2016 18:33
npm depencies list
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN prefer global [email protected] should be installed with -g
npm WARN prefer global [email protected] should be installed with -g
npm WARN prefer global [email protected] should be installed with -g
> [email protected] postinstall C:\projects\NodeOPCUA\node-opcua
> node postinstall.js
Executing node bin/generate_opcua_classes.js --clear
/*global require,console,setTimeout */
var opcua;
try{
opcua = require("node-opcua");
} catch(err) {
opcua = require("..");
}
var async = require("async");
var client = new opcua.OPCUAClient();
/*global require,console,setTimeout */
var opcua;
try{
opcua = require("node-opcua");
} catch(err) {
opcua = require("..");
}
var async = require("async");
var client = new opcua.OPCUAClient();
@erossignon
erossignon / server_with_40000_variables.js
Last active June 19, 2018 09:04
Performance node-opcua with 40000 variables nodes
/* eslint no-process-exit: 0 */
"use strict";
Error.stackTraceLimit = Infinity;
var argv = require('yargs')
.wrap(132)
.string("port")
.describe("port")
.alias('p', 'port')
.argv;
@erossignon
erossignon / two_servers.js
Created October 27, 2016 16:23
2 servers in the same process
var opcua = require("node-opcua");
var path = require("path");
var port1 = 25000
var port2 = 25001
var standard_nodeset_file = opcua.standard_nodeset_file;
var rootFolder = path.join(__dirname,"./");
@erossignon
erossignon / checkdatatype.js
Created November 20, 2016 10:03
How to determine dataType of a variable
/*global require,console,setTimeout */
var opcua = require("node-opcua");
var async = require("async");
var assert = require("assert");
var client = new opcua.OPCUAClient();
var endpointUrl = "opc.tcp://" + require("os").hostname() + ":26543/UA/Server";
///var myNodeId = "ns=411;s=Scalar_Simulation_Double";
var myNodeId = "ns=411;s=Scalar_Simulation_ImageGIF";
@erossignon
erossignon / check_translate.js
Last active December 13, 2016 12:20
Test Translate BrowsePath
/*global require,console,setTimeout */
var opcua
try {
opcua = require("node-opcua");
}
catch(e){
opcua = require("./index");
}
var async = require("async");
import {
BrowseResult,
BrowseDescription,
BrowseDirection,
OPCUAClient,
MessageSecurityMode,
SecurityPolicy,
ClientSession
} from "node-opcua";
import async = require("async");