1.0.4 • Published 5 years ago

@haoxh/nconsole v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

nConsole

Shared console 跨端共享 console.log & 跨端监控解决方案

nConsole 特性

兼容性: npm.io

1. 跨端共享 console.log

  • 打开其他此页面窗口或其他设备时,数据共享打印
  • 共享代码的 error ,监听了全局的错误事件 onerror
function test(){
  console.log('fn')
}
console.log('shared log',test)
console.info('shared info')

npm.io

// 监听滚动条高度
document.querySelector('#content').onscroll = function(e){
  console.log('scrollTop:'+ e.target.scrollTop)
}

npm.io

2. 跨端执行 console.compiler

// 让其他正在开启的浏览器执行表达式
// 打印结果为其他端的浏览器执行的结果
console.compiler('window.navigator.userAgent')

npm.io

3. console.performance()

// 打印其他窗口请求过的资源 与 performance.getEntriesByType('resource') 相同
console.performance()
console.performance('resource')

// 打印其他窗口加载页面的时间 与 performance.timing 相同
console.performance('timing')

4. 开启(关闭)请求监听

// 打印其他端的 fetch or ajax 请求
// 开启
console.fetch.open()
// 关闭
console.fetch.close()

使用 nConsole

 npm i @haoxh/nconsole -D

or

 yarn add @haoxh/nconsole -D

启动服务

 npx nconsole

引入依赖

<script src="./dist/nconsole.umd.min.js"></script>
<script>
  //启动 nConsole
  nConsole({
    //启动的 nconsole ip 地址
    host:'192.168.0.100'
  })
</script>

or

import nConsole from '@haoxh/nconsole/nconsole.umd.min'
nConsole({
  host:'192.168.0.100'
})
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago