![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nodejs
yzsy_1986
这个作者很懒,什么都没留下…
展开
-
socket.io (nodejs+express)
//服务端 var express = require('express'); var sio = require('socket.io'); var http = require('http'); var app = express(); function normalizePort(val) { var port = parseInt(val, 10); if (isNaN(port原创 2017-05-17 16:47:14 · 219 阅读 · 0 评论 -
使用child_process创建进程
var childprocess = require('child_process'); var Child_Process = childprocess.fork("./bin/child.js"); Child_Process.send(msg); //发送消息 //接送处理消息 Child_Process.on("message",function(message原创 2017-05-17 16:55:17 · 330 阅读 · 0 评论 -
nodejs 读取文件
var fs = require('fs'); var alldata = []; var readstream = fs.createReadStream(filepath,{autoClose:true,start:0,end:1000}); readstream.on('data',function(data){ alldata.push.apply(alldata,data); });原创 2017-05-17 17:06:17 · 247 阅读 · 0 评论 -
nodejs 连接操作MSSQL 数据库
nodejs +express socket.io使用方法 //服务端 var express = require('express'); var sio = require('socket.io'); var http = require('http'); var app = express();function normalizePort(val) { var port = parseInt原创 2017-05-17 17:16:26 · 1468 阅读 · 1 评论 -
nodejs 读取ini文件
var ini = require('iniparser'); var iconv = require('iconv-lite');var ini_str = iconv.decode(FILESTR, "gbk"); //如有中文需要转码 var ini_cfg = ini.parseString(ini_str)['main'];原创 2017-05-17 17:30:07 · 1359 阅读 · 0 评论