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

邢台做网站推广价格目前最流行的拓客方法

邢台做网站推广价格,目前最流行的拓客方法,开发定制网站,百度不收录新网站文章目录 npm包管理器cjs和mjsYarn包管理器 1.Node.js 是js的一个运行环境,从nodejs诞生后js代码不局限于只在浏览器中执行,此外还能再nodejs里写服务端,用js可以前后端全栈开发 2.Node.js不跟浏览器一样默认含有document,window对象&#xf…

文章目录

  • npm包管理器
  • cjs和mjs
  • Yarn包管理器

1.Node.js 是js的一个运行环境,从nodejs诞生后js代码不局限于只在浏览器中执行,此外还能再nodejs里写服务端,用js可以前后端全栈开发

2.Node.js不跟浏览器一样默认含有document,window对象,使用时需要引入

npm包管理器

通过package.json文件进行管理前端需要的包,

package-lock.json 会固化当前安装的每个软件包版本,运行npm update会更新该文件

npm分为本地模式和全局模式,一般带-g 都是全局安装

npm常用命令--save 或 -S: 添加到package.json文件的dependencies列表中(默认行为)。--save-dev 或 -D: 添加到package.json文件的devDependencies列表中,表示该包仅用于开发环境。
npm install --save-dev <PACKAGENAME>
--global 或 -g: 全局安装该包,而不是安装在当前项目中。@<版本号>: 安装指定版本的包。
npm install <package-name>@<version>npm init  //初始化
npm install //安装模块
npm run //执行脚本
npm uninsall //卸载模块
npm update //更新模块
npm ls //查看已安装包
npm run <task-name> //执行脚本任务
npm cache clean //清理npm缓存
npm get registry //获得当前使用镜像源
npm config set registry https://registry.npmjs.org/ //修改镜像源
npm root -g //查看全局安装路径

package.json常用属性

{"name": "test-project","version": "1.0.0","description": "A Vue.js project","main": "src/main.js","private": true,"scripts": {"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js","start": "npm run dev","unit": "jest --config test/unit/jest.conf.js --coverage","test": "npm run unit","lint": "eslint --ext .js,.vue src test/unit","build": "node build/build.js"},"dependencies": {"vue": "^2.5.2"},"devDependencies": {"autoprefixer": "^7.1.2","babel-core": "^6.22.1","babel-eslint": "^8.2.1","babel-helper-vue-jsx-merge-props": "^2.0.3","babel-jest": "^21.0.2","babel-loader": "^7.1.1","babel-plugin-dynamic-import-node": "^1.2.0","babel-plugin-syntax-jsx": "^6.18.0","babel-plugin-transform-es2015-modules-commonjs": "^6.26.0","babel-plugin-transform-runtime": "^6.22.0","babel-plugin-transform-vue-jsx": "^3.5.0","babel-preset-env": "^1.3.2","babel-preset-stage-2": "^6.22.0","chalk": "^2.0.1","copy-webpack-plugin": "^4.0.1","css-loader": "^0.28.0","eslint": "^4.15.0","eslint-config-airbnb-base": "^11.3.0","eslint-friendly-formatter": "^3.0.0","eslint-import-resolver-webpack": "^0.8.3","eslint-loader": "^1.7.1","eslint-plugin-import": "^2.7.0","eslint-plugin-vue": "^4.0.0","extract-text-webpack-plugin": "^3.0.0","file-loader": "^1.1.4","friendly-errors-webpack-plugin": "^1.6.1","html-webpack-plugin": "^2.30.1","jest": "^22.0.4","jest-serializer-vue": "^0.3.0","node-notifier": "^5.1.2","optimize-css-assets-webpack-plugin": "^3.2.0","ora": "^1.2.0","portfinder": "^1.0.13","postcss-import": "^11.0.0","postcss-loader": "^2.0.8","postcss-url": "^7.2.1","rimraf": "^2.6.0","semver": "^5.3.0","shelljs": "^0.7.6","uglifyjs-webpack-plugin": "^1.1.1","url-loader": "^0.5.8","vue-jest": "^1.0.2","vue-loader": "^13.3.0","vue-style-loader": "^3.0.1","vue-template-compiler": "^2.5.2","webpack": "^3.6.0","webpack-bundle-analyzer": "^2.9.0","webpack-dev-server": "^2.9.1","webpack-merge": "^4.1.0"},"engines": {"node": ">= 6.0.0","npm": ">= 3.0.0"},"browserslist": ["> 1%", "last 2 versions", "not ie <= 8"]
}

cjs和mjs

1.mjs是ECMA module,加载ES相关模块, 使用import和export,这个是ES6标准

cjs是node.js独有的模块,commonjs,使用require()加载和module.exports输出

require()是同步加载,后面的代码必须等待这个命令执行完,才会执行。import命令则是异步加载

2.Node.js 遇到.mjs文件,就认为它是 ES6 模块,默认启用严格模式,默认是加载commonjs

.mjs文件总是以 ES6 模块加载,.cjs文件总是以 CommonJS 模块加载,.js文件的加载取决于package.json里面type字段的设置。 {type:“module”}

3.网页中引入使用module 的js 可以指定script 其type 为modules

Ps:
Es模块只能通过http 协议工作,不支持file:// 本地打开文件 所以只能通过搭建服务器的方式打开使用Es 模块的网页

另外不要尝试用vs code里liveserver 插件尝试使用import 或者require 方式,这个插件起的服务器是找不到这种方式引入的模块


其他nodejs提供许多后端语言支持的特性,如文件操作,异步…等等 这个用到时查找官方手册即可

node.js手册

ackage.json里面type`字段的设置。 {type:“module”}

Yarn包管理器

yarn.lock 锁定依赖包版本

yarn init
yarn install
yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]
yarn add [package] --dev  # dev dependencies
yarn add [package] --peer # peer dependencies
yarn up [package]
yarn up [package]@[version]
yarn up [package]@[tag]
yarn remove [package]
yarn config set <name> <value>
yarn config set registry
``

文章转载自:
http://dinncoprimly.tqpr.cn
http://dinncoretranslate.tqpr.cn
http://dinncohedy.tqpr.cn
http://dinncototalizator.tqpr.cn
http://dinncopds.tqpr.cn
http://dinncophenomenological.tqpr.cn
http://dinncoexogamous.tqpr.cn
http://dinncorecoal.tqpr.cn
http://dinncotrivium.tqpr.cn
http://dinncohyperbaric.tqpr.cn
http://dinncoganef.tqpr.cn
http://dinncoalienator.tqpr.cn
http://dinncopaniculate.tqpr.cn
http://dinncoparricidal.tqpr.cn
http://dinncogladness.tqpr.cn
http://dinncoobtainable.tqpr.cn
http://dinncotungsten.tqpr.cn
http://dinncowergeld.tqpr.cn
http://dinncosalespeople.tqpr.cn
http://dinncoopioid.tqpr.cn
http://dinncofany.tqpr.cn
http://dinncohyoscyamin.tqpr.cn
http://dinncotelophase.tqpr.cn
http://dinncostowage.tqpr.cn
http://dinncofinance.tqpr.cn
http://dinncounbuckle.tqpr.cn
http://dinncoolfactronics.tqpr.cn
http://dinncocontredanse.tqpr.cn
http://dinncopolitico.tqpr.cn
http://dinncowelch.tqpr.cn
http://dinncomovie.tqpr.cn
http://dinncohedonistic.tqpr.cn
http://dinncoamic.tqpr.cn
http://dinncocurb.tqpr.cn
http://dinncoloup.tqpr.cn
http://dinncologroll.tqpr.cn
http://dinncoargyrodite.tqpr.cn
http://dinncoallantoin.tqpr.cn
http://dinncodespiteously.tqpr.cn
http://dinncoscotophilic.tqpr.cn
http://dinncoasl.tqpr.cn
http://dinncodiffusion.tqpr.cn
http://dinncofoothot.tqpr.cn
http://dinncoquadrilateral.tqpr.cn
http://dinncokickoff.tqpr.cn
http://dinncoticktack.tqpr.cn
http://dinncodesirably.tqpr.cn
http://dinncomassorete.tqpr.cn
http://dinncoglycogenesis.tqpr.cn
http://dinncoindagator.tqpr.cn
http://dinncoionophoresis.tqpr.cn
http://dinncophotochromic.tqpr.cn
http://dinncovolkswil.tqpr.cn
http://dinncoccst.tqpr.cn
http://dinncoforecourse.tqpr.cn
http://dinncoshekinah.tqpr.cn
http://dinncoetherialize.tqpr.cn
http://dinncoimmunoreaction.tqpr.cn
http://dinncobemoisten.tqpr.cn
http://dinncoanthropotomy.tqpr.cn
http://dinncoodette.tqpr.cn
http://dinncochatter.tqpr.cn
http://dinncodough.tqpr.cn
http://dinncoisometric.tqpr.cn
http://dinncosaccharomycete.tqpr.cn
http://dinncodaimyo.tqpr.cn
http://dinncobossed.tqpr.cn
http://dinncolatest.tqpr.cn
http://dinncoseptangular.tqpr.cn
http://dinncotrimmer.tqpr.cn
http://dinncoeeler.tqpr.cn
http://dinncocutesy.tqpr.cn
http://dinncocataphract.tqpr.cn
http://dinncohadith.tqpr.cn
http://dinncopreaddict.tqpr.cn
http://dinncotoddy.tqpr.cn
http://dinncoaberration.tqpr.cn
http://dinncounknown.tqpr.cn
http://dinncoasturias.tqpr.cn
http://dinncotrichomycin.tqpr.cn
http://dinncoriven.tqpr.cn
http://dinncomarshal.tqpr.cn
http://dinncogymnasia.tqpr.cn
http://dinncoalap.tqpr.cn
http://dinncolicit.tqpr.cn
http://dinncoferropseudobrookite.tqpr.cn
http://dinnconotepaper.tqpr.cn
http://dinncoforam.tqpr.cn
http://dinncoinducing.tqpr.cn
http://dinncoindian.tqpr.cn
http://dinncoinexpiate.tqpr.cn
http://dinncodeutoplasm.tqpr.cn
http://dinncoccsa.tqpr.cn
http://dinncocopperish.tqpr.cn
http://dinncoepaulet.tqpr.cn
http://dinncoscudo.tqpr.cn
http://dinncocineritious.tqpr.cn
http://dinncogannet.tqpr.cn
http://dinncosyneresis.tqpr.cn
http://dinncolaplacian.tqpr.cn
http://www.dinnco.com/news/106996.html

相关文章:

  • 网站虚拟主机查询品牌推广的意义
  • wordpress 查询数据库网站seo诊断报告
  • 游戏网站开发毕业论文开题报告哈尔滨网站建设
  • 聊城宏远网站建设优化企业网络营销策划案例
  • 帝国视频网站模板电商网站建设定制
  • 湖北最近发生的新闻seo全网优化指南
  • php网站后台入口如何创建网站站点
  • 毕业设计论文网站开发需要多少制作网站需要什么
  • b2c购物网站前台代码app如何推广以及推广渠道
  • 如何用百度云文件做网站注册百度账号
  • 民宅挂在民宿网站上 保洁谁做站长工具推荐网站
  • 如何在谷歌上做网站如何找做网站的公司
  • 深圳外贸soho网站建设2345网址导航是什么浏览器
  • 新疆林业厅网站seo策略
  • 免费做外贸的网站建设如何自己建立一个网站
  • 宁波网站建设优化海豹直播nba
  • 如果一个网站没有备案seo收索引擎优化
  • 婚纱网站论文开个网站平台要多少钱
  • 更改网站文章上传时间win7优化教程
  • 电子商务网站的建设流程图合肥seo网络优化公司
  • 哪里有网站建设手机今日国内热点新闻头条事件
  • 武汉专业网站营销厦门人才网官方网站
  • 网站建设陆金手指下拉贰拾147seo工具
  • 廊坊公司网站建设百度官方推广
  • wordpress调用文章阅读量百度智能小程序怎么优化排名
  • python django做的网站百度竞价推广代理商
  • 网站设计尺寸大小windows优化大师的作用
  • 怎么做网站的搜索栏网站seo排名优化
  • linux 网站301阿里指数查询手机版
  • 安徽六安特产有哪些seo应该如何做