限时免费试用:欢迎注册 api.bigmodel.org ,快速体验大模型 API 接入服务。
当前位置:首页 >前端技术 >NodeJs

NodeJs

nodejs学习初体验(4)小爬虫

var http = require('http') var url = 'http://www.imooc.com/learn/348' var cheerio = require('cheerio') http.get(url,function(res){ var html = '' res.on('data',function(data){ html

nodejs学习初体验(3)api

//url网址解析 // url.parse 将网址解析成对象 > url.parse('https://www.imooc.com/video/6710') > url.parse('https://www.imooc.com/video/6710',true) //query会被解析成对象 > url.parse('//www.imooc.com/vid

nodejs学习初体验(2)模块与包管理工具

// 模块与包管理工具 npm install 模块的流程 1. 创建模块 test.js 2. 导出模块 (两种) exports.add = function(){} function add(){} exports.add = add 3. 加载模块 var tests = require('./test.js') 4. 使用模块 tests.add(

nodejs学习初体验(1)

// 简单的搭建web服务器 var http = require('http'); var server = http.createServer(function(req,res){ res.writeHead(200,{'Content-Type':'text/plain'}); res.end('Hello,world'); }) server.lis