How to use the node.version function in node

To help you get started, we’ve selected a few node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lovell / detect-libc / tests / integration / probe.js View on Github external
var fs = require('fs');
var libc = require('../../lib/detect-libc.js');

var result = { };
result['libc.family'] = libc.family || 'unknown';
result['libc.version'] = libc.version || 'unknown';
result['detect.method'] = libc.method || 'unknown';
result['node.version'] = process.versions.node;

var osRelease =
  (fs.existsSync('/etc/os-release')
    ? fs.readFileSync('/etc/os-release', 'utf8')
    : ''
  )
    .split('\n')
    .filter(function (item) { return item.indexOf('=') !== -1; })
    .map(function (item) { return item.split('=', 2); })
    .reduce(function (obj, item) {
      obj[item[0].trim()] = item[1].trim().replace(/^"(.+)"$/, '$1');
      return obj;
    }, { });

result['dist.name'] = osRelease.PRETTY_NAME || 'unknown';
github ceylon / ceylon.language / runtime-js / process.js View on Github external
if (navigator.languages||navigator.userLanguage||navigator.browserLanguage||navigator.language) {
        properties["user.locale"]=$_String((navigator.languages || [navigator.userLanguage||navigator.browserLanguage||navigator.language])[0]);
    }
    if (navigator.appVersion !== undefined) {
        properties["browser.version"] = $_String(navigator.appVersion);
    }
}
if (typeof process !== "undefined") {
    if (process.platform !== undefined) {
        properties["os.name"] = $_String(process.platform);
    }
    if (process.arch !== undefined) {
        properties["os.arch"] = $_String(process.arch);
    }
    if (process.versions !== undefined && process.versions.node != undefined) {
        properties["node.version"] = $_String(process.versions.node);
    }
}
if (typeof document !== "undefined") {
    if (document.defaultCharset !== undefined) {
        properties["file.encoding"] = $_String(document.defaultCharset);
    }
}

var linesep = '\n';
var filesep = '/';
var pathsep = ':';
var osname = properties["os.name"];
if ((osname !== undefined) && (osname.search(/win/i) >= 0 && osname.search(/darwin/i)<0)) {
    linesep = "\r\n";
    filesep = '\\';
    pathsep = ';';
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
buildNodeCtrlPanel:function(nodeObj) {
			
			if(UserFilterCache.nomapping){
				return;//权限设置
			}
		
			var sb=new StringBuffer();
			
			var nodeCtrlUrl=this.getNodeCtrlUrl(nodeObj);
			
			var nodeObjStr=StringHelper.obj2str({id:nodeObj["id"],name:nodeObj["name"],url:nodeCtrlUrl,ip:nodeObj["ip"],pid:nodeObj["node.pid"],pname:nodeObj["name"],profile:nodeObj["node.profile"],
                                                version:nodeObj["node.version"] == undefined ? "UNKNOW" : nodeObj["node.version"],nodeRoot:nodeObj["node.root"],
                                                dockerContainer:nodeObj["node.docker.container"] == undefined ? "{}" : nodeObj["node.docker.container"]});
			//权限设置
			var groupName = nodeObj.group;
			var ctrlAuthor = false;
			if(UserFilterCache.ctrls[groupName]!=undefined && UserFilterCache.ctrls[groupName]["nodectrl"] !=undefined && UserFilterCache.ctrls[groupName]["nodectrl"]=="T"){
				ctrlAuthor=true;
			}
			
			if(UserFilterCache.all || ctrlAuthor){
				//设置系统属性
				sb.append("<button class="\&quot;btn">修改属性</button>");

				//重启Node
				sb.append("&nbsp;<button class="\&quot;btn">配置管理</button>");
				sb.append("&nbsp;<button class="\&quot;btn">重启节点</button>");
				sb.append("&nbsp;<button class="\&quot;btn">停止节点</button>");
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
"                    <span class="\&quot;kvField\&quot;">配置</span><span>:</span>"+jsonObj["node.profile"] +
	            "                " +
                    "               <div class="\&quot;kv\&quot;">" +
                    "                  <span class="\&quot;kvField\&quot;">能力</span><span>:</span>"+this.formatter.feature(jsonObj["node.feature"],jsonObj) +
	            "              </div>" +
	            "               <div class="\&quot;kv\&quot;">" +
	            "                  <span class="\&quot;kvField\&quot;">Http服务</span><span>:</span>"+this.formatter.services(jsonObj["node.services"]) +
	            "              </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">所属心跳地址</span><span>:</span>"+jsonObj["node.hbserver"] +
	            "                </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">路径</span><span>:</span>"+jsonObj["node.root"] +
	            "                </div>" +
		    "                <div class="\&quot;kv\&quot;">" +
                    "                    <span class="\&quot;kvField\&quot;">版本</span><span>:</span>"+jsonObj["node.version"] +
                    "                </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">端口</span><span>:</span>";
			
				var macinfo=app.mdata("macinfo");
				var procs=eval("("+macinfo[jsonObj["ip"]]["node.procs"]+")");
				var pid=jsonObj["node.pid"];
				for (var key in procs) {
					
					if (pid==key) {
						str+=procs[key]["ports"];
						break;
					}					
				}
	            str+="</div>";