随笔分类 -  开发工具代码复制急用

Html判断用户使用设备
摘要:var browser = { versions: function() { var u = navigator.userAgent, app = navigator.appVersion; return {//移动终端浏览器版本信息 trident: u.indexOf('Trident') > 阅读全文
posted @ 2020-07-03 10:20 DMC-尼禄 阅读(476) 评论(0) 推荐(0)
加载js脚本函数
摘要:加载单个js脚本 var loadSingleScript = function (src, callback) { var s = document.createElement('script'); s.async = false; s.src = src; s.addEventListener( 阅读全文
posted @ 2020-07-03 09:57 DMC-尼禄 阅读(179) 评论(0) 推荐(0)
快速搭建服务器
摘要:var url = require("url"), fs = require("fs"), http = require("http"), path = require("path"); var port = 8080 // 默认检测80端口 if (process.argv[2] '-p') { 阅读全文
posted @ 2020-07-02 17:48 DMC-尼禄 阅读(272) 评论(0) 推荐(0)
koa 快速保存文件的服务器
摘要:import * as Koa from "koa"; import * as fs from "fs"; import * as path from "path"; const app = new Koa(); app.use(async ctx => { // console.log(ctx.u 阅读全文
posted @ 2020-06-11 16:45 DMC-尼禄 阅读(406) 评论(0) 推荐(0)
快速搭建 Koa + TS 服务器
摘要:package.json { "name": "myweb", "version": "1.0.0", "description": "", "main": "", "scripts": { "start": "ts-node index.ts" }, "author": "nero", "lice 阅读全文
posted @ 2020-06-10 10:14 DMC-尼禄 阅读(2466) 评论(0) 推荐(0)
node下运行ts
摘要:一、把npm换成淘宝源,下载速度快 npm config set registry https://registry.npm.taobao.org --global npm config set disturl https://npm.taobao.org/dist --global 二、初始化pa 阅读全文
posted @ 2020-06-06 14:11 DMC-尼禄 阅读(4999) 评论(0) 推荐(0)