npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-moniter

v1.0.2

Published

vue-moniter

Downloads

9

Readme

vue-moniter

欢迎使用 vue-moniter

为什么我们使用 vue moniter

在使用vue项目中,我们使用传统的 dom.ready 或者 preformance 根本无法统计到真正的vue项目首屏时间 甚至很多vue使用者使用了非常多的异步模块在项目中,这些该怎么统计呢?

demo

import Vue from 'vue'
import VueRouter from 'vue-router'
import moniter from 'vue-moniter'

Vue.use(VueRouter)

// 2. Define route components
const Home = {
  template: '<div>home</div>',
  mounted () {
    console.log('Home mounted')
  }
}
const Foo = {
  template: '<div class="foo">foo</div>',
  beforeRouteEnter (to, from, next) {
    next(vm => {
      // console.log(vm)
    })
  },
  mounted () {
    console.log('children mounted')
  },
  data () {
    return {
      hook: {
        prepatch: (_, vnode) => {
          window.alert(1)
        }
      }
    }
  }
}

// 3. Create the router
const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [
    { path: '/', component: Home },
    {
      path: '/bar/a',
      components: {
        abc: () => import('./async.js'),
        bbb: Ren
      },
      children: [
        {
          path: 'b',
          component: () => import('./asyncb.js')
        }
      ]
    },
    { path: '/bar/a', component: Foo }
  ]
})

const rootVue = new Vue({
  router,
  mounted () {
    console.log('main mounted')
  },
  template: `
    <div id="app">
      <h1>Basic</h1>
      <ul>
        <li><router-link to="/bar/a">/bar/a</router-link></li>
        <li><router-link to="/bar/b">/bar/b</router-link></li>        
        <router-link tag="li" to="/bar" :event="['mousedown', 'touchstart']">
          <a>/bar</a>
        </router-link>
      </ul>
      <router-view class="view" name="abc"></router-view>
    </div>
  `
})
moniter.init(rootVue, Vue)
rootVue.$mount('#app')

api

moniter.push

如果在多入口的vue项目中 可以把多个rootVue对象push进来

moniter.init(rootVue, Vue)

rootVue vue项目的根节点可以是数组 Vue import的Vue对象

TODO

还计划做一些比如路由切换之间组件的渲染时间(而且可以针对异步),还有针对于路由切换长时间使用的场景进行内存增长分析 总之就是对vue的各种上报。 欢迎有兴趣的小伙伴提提建议。