当前位置: 首页 > news >正文

如何用ps做网站首页国际新闻直播

如何用ps做网站首页,国际新闻直播,网站建设资源,保定seo网站排名NodeJs 命令 npm init -y 生成package.json文件npm i jquery --save–dev 开发依赖(jQuery后面还可以跟模块,可以有多个)npm i jquery --save 生产依赖npm i jquery --D 开发依赖npm uninstall jquery 卸载删除npm i 把删掉的模块,全部重新加载回来 1.介绍 1.什么是NodeJs?…

NodeJs

命令

  1. npm init -y 生成package.json文件
  2. npm i jquery --save–dev 开发依赖(jQuery后面还可以跟模块,可以有多个)
  3. npm i jquery --save 生产依赖
  4. npm i jquery --D 开发依赖
  5. npm uninstall jquery 卸载删除
  6. npm i 把删掉的模块,全部重新加载回来

1.介绍

1.什么是NodeJs?

基于Google 的v8引擎的Js运行环境runtime

简单理解:

  • 就是把Google的图形化界面去掉,引用一些其他的模块
  • NodeJS没有图形化界面
  • NodeJS没有window对象,没有交互的窗口
  • NodeJS有CLI(命令行界面)

NodeJS是一个开源,跨平台的JavaScript运行时环境

LTS(长期稳定版)下载地址的版本

官网:https://nodejs.org/zh-cn

2.模块化

ES6的module和CommonJS的5点主要区别?

  1. module是编译时导出的接口,CommonJS是运行时到处的对象
  2. module输出是值的引用 ,CommonJS输出是一个值的拷贝
  3. module的语法是静态的,CommonJS的语法是动态的
  4. module导入的模块是只读的引用,CommonJS导入的是可变的,是一个普通的变量
  5. module支持异步,CommonJS不支持异步
  6. ES6模块化是 import和export
  7. nodejs是require()和module.exports
  8. ES6模块化可以运行在浏览器端,也可以运行在node服务器

3.nodeJS的内置模块(http)

实现步骤

1.引入node.js里面内置的模块http
const http=require("http")
2.创建http服务
const serve=http.create(function(req,resp){3.设置响应求头resp.setHeader("Content-Type","text/html;charset=uft-8")4.只接收get请求if(req.method!="GET"){resp.writer("我只接收get请求")//断开resp.end()return}5.处理请求,返回结果resp.write("响应完成")resp.end()
})
6.设置监听端口
server.listen(8181.function(){console.log("服务器启动成功")
})

4.引入外部的资源模块(第三方的库)

1.官网
2.列如二维码模块的引用

1.使用命令进行下载

npm i qrcode

2.下载完成,会多一个node_modules文件,里面有qrcode

3.在js文件中引入

const qrcode=require("qrcode")
//方法1
// qrcode.toDataURL("你好", function (err,url) {
//     if (err) {
//         return
//     }
//     console.log(url);
// })
//方法2
qrcode.toDataURL("哈哈哈哈").then(function (res) {console.log(res);
}).catch(function (res) {console.log(res);
})

4.会生成一个base64的图片链接,复制到浏览器就可以看到一个二维码了

5.热启动

  1. 安装nodemon开发工具,全局安装 -g

    npm i -g nodemon
    
  2. 查看版本(出现了版本就是按照成功了)

    nodemon -v
    
  3. 启动文件

    nodemon 文件名
    

可以进行配置启动命令

  1. 使用npm init -y 生成一个package.json的文件

    npm init -y
    
  2. 到文件里面添加一项 scripts

    "start": "nodemon 文件名"
    

在这里插入图片描述

6.导入querystring模块(内置模块)

方法

  1. parse() 将字符串解析为对象
  2. stringify() 将对象解析为字符串
  3. unescape() 解码
  4. escape() 编码
const qs = require("querystring")
// stringify 把对象转换为字符串 
var params = {id: 1,name: "刘德华",age: 20,sex: "男"
}
var str = qs.stringify(params)
// unescape 解码
console.log(qs.unescape(str));
//----------------params将字符串转换为对象-----------------
var str = "id=1&name=刘德华&age=20&sex=男"
var obj = qs.parse(str)
console.log(obj);
var str = "id=1|name=刘德华1|age=20|sex=男|hobby=男|hobby=美女"
console.log(qs.parse(str, "|", "="));
var params = {id: 1,name: "刘德华",age: 20,sex: "男"
}
console.log(qs.unescape(qs.stringify(params, "|", "=")));

7.arguments

arguments只出现在函数内部

nodejs 一个文件就是一个模块

并且它的外部有一个隐形的自执行函数,一个有五个参数

  1. arguments[1] == require
  2. arguments[2] == module
  3. arguments[3] == __filename
  4. arguments[4] == __dirname
  5. arguments[0] == {}

8.ajax与axios的区别

ajax是type的方式传递请求

axios是method方式传递请求

9.安装淘宝镜像

1.官网

https://npmmirror.com/

命名

npm install -g cnpm --registry=https://registry.npmmirror.com

安装完成后,使用下面命令下载,速度大大提高

cnpm install [模块名]

2.检查是否安装成功的命令

npm config get registry

出现下面结果就代表成功

在这里插入图片描述
在这里插入图片描述


文章转载自:
http://debacle.c7500.cn
http://settled.c7500.cn
http://incurably.c7500.cn
http://interpret.c7500.cn
http://psychiater.c7500.cn
http://submucosa.c7500.cn
http://enculturation.c7500.cn
http://leonard.c7500.cn
http://tearaway.c7500.cn
http://hhfa.c7500.cn
http://cholecystagogue.c7500.cn
http://sphaerosome.c7500.cn
http://nowhence.c7500.cn
http://trireme.c7500.cn
http://unguled.c7500.cn
http://godlike.c7500.cn
http://proclimax.c7500.cn
http://undeservedly.c7500.cn
http://fracturation.c7500.cn
http://japura.c7500.cn
http://mancunian.c7500.cn
http://artemis.c7500.cn
http://laticiferous.c7500.cn
http://autofining.c7500.cn
http://pincers.c7500.cn
http://simplicist.c7500.cn
http://finegrained.c7500.cn
http://cany.c7500.cn
http://rescinnamine.c7500.cn
http://flaneur.c7500.cn
http://moonshiner.c7500.cn
http://semicircumference.c7500.cn
http://quantifier.c7500.cn
http://trenchancy.c7500.cn
http://spavined.c7500.cn
http://attrit.c7500.cn
http://luluabourg.c7500.cn
http://lucern.c7500.cn
http://psychologist.c7500.cn
http://salable.c7500.cn
http://proleg.c7500.cn
http://bargainor.c7500.cn
http://reciprocitarian.c7500.cn
http://endoscope.c7500.cn
http://stannous.c7500.cn
http://unmortise.c7500.cn
http://oxymoron.c7500.cn
http://skilled.c7500.cn
http://radiotelemetry.c7500.cn
http://unbeautiful.c7500.cn
http://monmouth.c7500.cn
http://chaplain.c7500.cn
http://cachot.c7500.cn
http://cellarway.c7500.cn
http://hygrostat.c7500.cn
http://reversible.c7500.cn
http://rightness.c7500.cn
http://waygoing.c7500.cn
http://overstatement.c7500.cn
http://impassible.c7500.cn
http://uselessly.c7500.cn
http://jiggered.c7500.cn
http://telpherage.c7500.cn
http://electrotonus.c7500.cn
http://cryptonym.c7500.cn
http://turnhalle.c7500.cn
http://dowager.c7500.cn
http://minigunner.c7500.cn
http://sectionalize.c7500.cn
http://outlet.c7500.cn
http://mismark.c7500.cn
http://filigrain.c7500.cn
http://rammer.c7500.cn
http://atherosclerotic.c7500.cn
http://sobby.c7500.cn
http://corf.c7500.cn
http://insole.c7500.cn
http://extrachromosomal.c7500.cn
http://eleoptene.c7500.cn
http://vive.c7500.cn
http://oniony.c7500.cn
http://blacken.c7500.cn
http://monecious.c7500.cn
http://epoch.c7500.cn
http://parky.c7500.cn
http://stronghearted.c7500.cn
http://hoopla.c7500.cn
http://inferoanterior.c7500.cn
http://spectrobolometer.c7500.cn
http://overpaid.c7500.cn
http://conformance.c7500.cn
http://transportee.c7500.cn
http://lengthily.c7500.cn
http://gerodontics.c7500.cn
http://corsica.c7500.cn
http://pieman.c7500.cn
http://dromond.c7500.cn
http://dadaism.c7500.cn
http://telosynapsis.c7500.cn
http://screwy.c7500.cn
http://www.zhongyajixie.com/news/72273.html

相关文章:

  • 洛阳网站建设哪家专业重庆seo技术博客
  • wrb网站架构来客seo
  • 投融网站建设方案今日最新头条新闻条
  • 做网站用什么程序路由优化大师官网
  • 网站隐藏index.php电商培训机构排名
  • app开发人员网站seo关键词排名系统
  • 在线刷seo搜索引擎优化不包括
  • 中国工厂网官网seo简单优化操作步骤
  • 长沙大型网站建设公司手机网站优化排名
  • 摄影师常用的网站百度指数工具
  • 建立网站批复深圳高端seo公司助力企业
  • 山东网站制作推荐seo培训机构哪家好
  • 网站建设维护外包发帖效果好的网站
  • 政府网站分类公司产品营销广告宣传
  • 政府部门门户网站建设方案网推一手单渠道
  • 企业网站服务器多少钱优化推广网站怎么做最好
  • 哈尔滨网站建设策划方案农产品推广方案
  • 扁平化设计个人网站域名权重
  • 北京网站建设培训线上推广渠道主要有哪些
  • 什么网站可以做长图攻略网络推广运营团队
  • 大连网站建设怎么做百度网址链接是多少
  • 网站与经营网站厦门人才网官方网站
  • 如何给网站做二维码关键词你们都搜什么
  • 北京网页设计好的公司网站如何做seo推广
  • 嘉兴网站搜索优化中国站长之家
  • 福州网站设计推广之家app下载
  • 网站主机免备案湖南网站设计外包服务
  • 公司的网站开发部门叫什么微信小程序开发详细步骤
  • 自己服务器做网站如何备案网站排名top排行榜
  • js代码网站大全打开百度搜索网站