热门标签 | HotTags
当前位置:  开发笔记 > 前端 > 正文

npmservemd工具[MD]

博文地址我的GitHub我的博客我的微信我的邮箱baiqiantaobaiqiantaobqt20094baiqiantao@sina.com目录目录目录常用的几个npm工具npm

博文地址



















我的GitHub我的博客我的微信我的邮箱
baiqiantaobaiqiantaobqt20094baiqiantao@sina.com



目录

目录



  • 目录

  • 常用的几个 npm 工具

    • npm serve

      • 基本使用

      • 支持的参数



    • npm md




常用的几个 npm 工具

npm serve



  • npm serve

  • GitHub

Static file serving and directory listing.


serve a static site, a single page application, a static file, no matter if on your device or on the local network



基本使用

最简单的使用方式:在当前目录下执行命令npx serve即可。

yarn global add serve # 全局安装 serve
serve -v # 查看版本
serve --help # 查看帮助文件
serve # 在当前目录下启动服务,启动后会自动将地址拷贝到粘贴板
serve -p 10086 # 在当前目录下启动服务,并指定端口【http://localhost:10086】
serve folder_name # 在指定的目录下启动服务

By default, serve will listen on 0.0.0.0:3000 and serve the current working directory on that address.



支持的参数

常用



  • -l, listen:Specify a URI endpoint 端点 on which to listen, more than one may be specified to listen in multiple places

  • -p, port:Specify custom port 端口

  • -d, debug:Show debugging information

  • -s, single:Rewrite all not-found requests to index.html

不常用



  • -c, config:Specify custom path to serve.json

  • -C, cors:Enable CORS, sets Access-Control-Allow-Origin to *

  • -n, no-clipboard:Do not copy the local address to the clipboard

  • -u, no-compression:Do not compress files

  • -S, symlinks:Resolve symlinks instead of showing 404 errors

  • --no-etag:Send Last-Modified header instead of ETag

  • --ssl-cert:Optional path to an SSL/TLS certificate to serve with HTTPS

  • --ssl-key:Optional path to the SSL/TLS certificate's private key 私钥

  • --ssl-pass:Optional path to the SSL/TLS certificate's passphrase 密钥

  • --no-port-switching:Do not open a port other than 除了 the one specified when it's taken.

监听端口

Listen endpoints (specified by the --listen or -l options above) instruct 指示 serve to listen on one or more interfaces/ports, UNIX domain sockets, or Windows named pipes.



  • For TCP ports on hostname "localhost":serve -l 1234

  • For TCP (traditional host/port) endpoints:serve -l tcp://hostname:1234

  • For UNIX domain socket endpoints:serve -l unix:/path/to/socket.sock

  • For Windows named pipe endpoints:serve -l pipe:\\.\pipe\PipeName


npm md



  • GitHub

  • 在线编辑器地址:Netlify、Gitee Pages、GitHub Pages

一款高度简洁的微信 Markdown 编辑器:支持 Markdown 所有基础语法、色盘取色、一键复制并粘贴到公众号后台、多图上传、一键下载文档、自定义 CSS 样式、一键重置等特性

开发和部署

npm i # 安装依赖
npm run serve # 启动开发模式
npm run build # 输出部署版本

2017-01-16

本文来自博客园,作者:白乾涛,转载请注明原文链接:https://www.cnblogs.com/baiqiantao/p/6290306.html



推荐阅读
author-avatar
sasame
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有