标签文章:#nodejs#

  • npm 国内镜像设定

    镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在):1.通过config命令npmconfigsetregistryhttps://registry.npm.taobao.orgnpminfounderscore(如果上面配置正确这个命令会有字符串response)2.命令行指定npm--registryhttps://registry.npm.taob......

    Nemo Nemo 2017.04.13 22:04 1224浏览 0回复

    阅读更多
  • nodejs版本快速升至最新版

    只需要两个步骤即可升级:1、首先安装n模块别看它名字很短,用途却很大,可以用短小精悍来形容。n模块是专门用来管理nodejs版本的。这里需要全局安装:sudonpminstall-gn2、升级node.js到最新稳定版nstable等待完成即可。

    Nemo Nemo 2017.03.21 10:06 1744浏览 0回复

    阅读更多
  • 【NodeJs】Http:简化版客户端http.get

    varhttp=require('http');http.get({       host:'localhost',       path:'/user?name=Nemo',       ......

    Nemo Nemo 2016.08.01 22:20 4666浏览 0回复

    阅读更多
  • 【NodeJs】Http:client

    varhttp=require('http');varquerystring=require('querystring');varcontents={       'name':'Nemo',       'age':'23',  &nbs......

    Nemo Nemo 2016.08.01 22:11 2964浏览 0回复

    阅读更多
  • 【NodeJs】Http:post

    varhttp=require('http');varqueryStr=require('querystring');varutil=require('util');http.createServer(function(req,res){       varpost='';    &nbs......

    Nemo Nemo 2016.08.01 21:50 3352浏览 0回复

    阅读更多
  • 【NodeJs】Http:get

     varhttp=require('http');varurls=require('url');varutil=require('util');http.createServer(function(req,res){       res.writeHead(200,{'Content-Type':'text/plain......

    Nemo Nemo 2016.08.01 21:49 3208浏览 0回复

    阅读更多
  • 【NodeJs】Http:原生实现

    varhttp=require('http');varserver=newhttp.Server();server.on('request',function(){       res.writeHead(200,{'Content-Type':'text/html'});    &nbs......

    Nemo Nemo 2016.08.01 21:49 1026浏览 0回复

    阅读更多
  • 【NodeJs】Http: 基本服务

    varhttp=require('http');varserver=http.createServer(function(req,res){       console.log(req.url);       res.writeHead(200,{'Conte......

    Nemo Nemo 2016.08.01 21:48 3299浏览 0回复

    阅读更多
  • [NodeJs]HTTP

    varoptions={    hostname:'www.imooc.com',    port:80,    path:'/course/docomment',    method:'POST',   &n......

    Nemo Nemo 2016.07.05 15:56 5201浏览 0回复

    阅读更多
  • [Nodejs]第一个爬虫

    varhttp=require('http');varcheerio=require('cheerio');varurl='http://www.link-nemo.com/Cynthia/index.do';functionfilterChapters(html){       var$=cheerio.load(html);......

    Nemo Nemo 2016.07.05 13:57 2789浏览 2回复

    阅读更多
  • [NodeJS] FS模块

    1、FS模块跟其他模块不同,所有的操作都提供了异步和同步两种方式。2、fs.readFile(filename,[ecoding],[callback(err,data)])异步式读取文件,文件不会被阻塞在读取文件的地方,而会继续往下执行。文件操作完成后,需要通过回调函数指定相应的操作。如果发生异常,会通过回调函数中的err参数通知。文件的内容会通过回调函数传递。=================......

    Nemo Nemo 2016.06.20 22:24 5147浏览 0回复

    阅读更多
  • 【NodeJs]events.EventEmitter事件

    events模块只提供了一个对象:events.EventEmitter.EventEmitter的核心就是事件发射与事件监听器功能的封装。//为指定事件注册监听器,接受一个字符串event和一个回调函数listenerEventEmitter.on(event,listener)//发射event事件,传递若干可选参数到事件监听器的参数表EventEmitter.emit(event,[arg1......

    Nemo Nemo 2016.06.17 00:25 1428浏览 0回复

    阅读更多
  • 【NodeJS]Util.inspect实体属性输出

    varutil=require('util');functionPerson(){   this.name='Nemo';   this.toString=function(){      returnthis.name;   }}varobj=ne......

    Nemo Nemo 2016.06.17 00:12 1865浏览 0回复

    阅读更多
  • [NodeJS]Util.inherits,原型继承

    //引入util模块varutil=require('util');//定义函数BasefunctionBase(){   //定义全局变量name和year   this.name='Nemo';   this.year=2016;   //定义了一个私有的sayHello方法......

    Nemo Nemo 2016.06.17 00:06 2354浏览 0回复

    阅读更多
  • [NodeJS]学习资源

    1.学习路线图http://blog.fens.me/nodejs-roadmap/2.视频http://www.icoolxue.com/album/show/89http://www.imooc.com/learn/3483.在线文档http://www.runoob.com/nodejs/nodejs-tutorial.htmlhttps://nodejs.org/api/

    Nemo Nemo 2016.06.14 23:49 2997浏览 0回复

    阅读更多
  • [NodeJS]读取文件

       varfs=require('fs');    fs.readFile('file.txt','utf-8',function(err,data){        if(err){     &n......

    Nemo Nemo 2016.06.13 21:16 4223浏览 0回复

    阅读更多
  • [NodeJS]npm 的使用

    安装$npminstallexpress-gnpmWARNcheckPermissionsMissingwriteaccessto/usr/local/lib/usr/local/lib└─┬express@4.13.4├─┬accepts@1.2.13│├─┬mime-types@2.1.11││└──mime-db@1.23.0│└──negotiator@0.5.3├──array-flat......

    Nemo Nemo 2016.06.13 21:07 3628浏览 0回复

    阅读更多
  • [NodeJS]第一个服务器端程序

    $vimfirstServer.js输入:varhttp=require('http');http.createServer(function(request,response){    response.writeHead(200,{'Content-Type':'text/plain'});    response......

    Nemo Nemo 2016.06.13 20:59 3679浏览 0回复

    阅读更多
  • [NodeJS]Ubuntu下部署nodejs环境

    有两种方式:1、$sudogitclonehttps://github.com/nodejs/node.git$sudochmod-R755node$cdnode$sudo./configure$sudomake$sudomakeinstall即可完成。输入:$node-v查看Nodejs版本。2、直接使用apt-get方式安装:$sudoapt-getinstallnodejs$sudoapt-......

    Nemo Nemo 2016.06.13 20:57 3465浏览 0回复

    阅读更多