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

@mini-dev/update

v0.0.4

Published

update when page not found

Downloads

1

Readme

@mini-dev/update

在用户使用旧版本打开新版本页面的时候,触发更新机制。

使用方式

安装

npm install @mini-dev/update

创建一个兜底页面,默认路径为 /pages/404/

index.json

{
  "navigationBarTitleText": "404",
  "usingComponents": {
    "update-view": "@mini-dev/update/update-view"
  }
}

页面引用

<update-view name="拼鸦"/>

启动时初始化

const update = require('@mini-dev/update');

update.init();

App({
    onLaunch(options) {
    }
});

如果不想使用默认的兜底页面,可以在初始化的时候配置:

const update = require('@mini-dev/update');

update.init({page:'/pages/xxx/yyy/zzz'});

如果部分页面有其他的替代页面,则可以在兜底之前拦截:

update.init({
    interceptors: [
        function (page) {
            if (page.path === 'pages/index/index3') {
                console.log('拦截并跳转到首页,不会打开兜底页面');
                wx.redirectTo({
                    url: '/pages/index/index'
                });
                return true; //返回值表示拦截成功
            }
        }
    ]
});

App 全局配置

update-view 组件内支持两个自定义属性:

  1. name,默认值为 app.$__name__;
  2. homepage,默认值为 app.$__homepage__;
App({
    $__name__: '这里是App.$__name__',
    $__homepage__: '/pages/index/index'
});

ChangeLogs

0.0.4

  1. 默认文案修改;

0.0.3

  1. 增加手动跳转到首页的按钮;
  2. 增加 App 全局变量配置;

0.0.2

  1. 增加了前置拦截