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

x-browser-update

v1.0.0

Published

A Vue.js browser-update plugin.

Downloads

53

Readme

x-browser-update

Version License NPM downloads Downloads JS gzip size

A Vue.js browser-update plugin.

Example

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

Usage

## Packages install
npm install x-browser-update --save

## main.js
import XBrowserUpdate from 'x-browser-update'

Vue.use(XBrowserUpdate)

## App.vue
<style lang="less">
  html {
    height: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  body {
    height: 100%;
    width: 100%;
    font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 0;
    margin: 0;
  }
  .layout {
    background: #383838;
  }
</style>

<template>
  <div id="app" class="layout">
    <x-browser-update :config="browserUpdateConfig"></x-browser-update>
  </div>
</template>

<script>
  export default {
    name: 'app',
    data () {
      return {
        browserUpdateConfig: {
          vs: {
            i: 11,
            f: -4,
            o: -4,
            s: 9,
            c: 40
          },
          // Specifies browser versions to notify. Negative numbers specify how much versions behind current version to notify.
          // f:22 ---> Firefox <= 22
          // c:-5 ---> Chrome <= 35 if current Chrome version is 40.
          reminder: 1,
          // after how many hours should the message reappear
          // 0 = show all the time
          reminderClosed: 150,
          // if the user explicitly closes message it reappears after x hours
          onshow: function (infos) {},
          onclick: function (infos) {},
          onclose: function (infos) {},
          // callback functions after notification has appeared / was clicked / closed
          l: false,
          // set a fixed language for the message, e.g. "en". This overrides the default detection.
          test: true,
          // true = always show the bar (for testing)
          text: '',
          // custom notification text (html)
          // Placeholders {brow_name} will be replaced with the browser name, {up_but} with contents of the update link tag and {ignore_but} with contents for the ignore link.
          // Example: Your browser, {brow_name}, is too old: <a{up_but}>update</a> or <a{ignore_but}>ignore</a>.
          text_xx: '',
          // custom notification text for language "xx"
          // e.g. text_de for german and text_it for italian
          newwindow: true,
          // open link in new window/tab
          url: null,
          // the url to go to after clicking the notification
          noclose: false,
          // Do not show the "ignore" button to close the notification
          nomessage: false,
          // Do not show a message if the browser is out of date, just call the onshow callback function
          jsshowurl: '//browser-update.org/update.show.min.js',
          // URL where the script, that shows the notification, is located. This is only loaded if the user actually has an outdated browser.
          container: document.body,
          // Element where the notification will be injected.
          api: 4
          // This is the version of the browser-update api to use. Please do not remove.
        }
      }
    }
  }
</script>

Links

License

MIT