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 🙏

© 2026 – Pkg Stats / Ryan Hefner

keepalive-extend

v0.1.4

Published

<p> <img src="https://img.shields.io/github/workflow/status/frontendway/keepalive-extend/test-coverage/master"> <img src="https://img.shields.io/codecov/c/github/frontendway/keepalive-extend/master"> <img src="https://img.shields.io/github/size/fron

Downloads

11

Readme

keepalive-extend

Brief Introduction

  • Compatible with vue2.x API native keepalive component
  • Can decide whether to refresh the matching route page according to the rules
  • This component depends on Vue-router. Please ensure that Vue router is installed

Install

# npm
npm install keepalive-extend -S

# or yarn
yarn add keepalive-extend -S

How to use

import Vue from 'vue'
import KeepaliveExtend from 'keepalive-extend'
Vue.use(KeepaliveExtend)

Component API

<keepalive-extend
  unique-key="app"
  :rules="{
    page1: {refresh: 'page2', notRefresh: 'page3'}
  }"
  :keep-active="false"
  include="page1"
  exclude="page1"
  max="2"
>
  <router-view />
</keepalive-extend>

API

| property | description | type | required | | ---- | ---- | ---- | ---- | | unique-key | unique key value | string | true | | keep-active | whether to persistent cache | boolean | false | | rules | whether the target page refreshes the rule | object | false | | include | consistent with that of keep-alive | string | false | | exclude | consistent with that of keep-alive | string | false | | max | consistent with that of keep-alive | string or number | false |

Rules Api

  • Vue router must be installed to use rules
  • Enter page1 page from Page2 or Page3 page, and page1 re renders
rules = {
  page1: {
    refresh: 'page2,page3',
    // notRefresh: 'page2,page3'
  }
}
rules = {
  page1: {
    refresh: /paeg2|page3/,
    // notRefresh: /paeg2|page3/
  }
}
rules = {
  page1: {
    refresh: ['page2', /page3/],
    // notRefresh: ['page2', /page3/]
    # or
    refresh: [['page2', /page3/]]
    // notRefresh: [['page2', /page3/]]
  }
}
  • After opening, the page without configuration rules will be re rendered every time
rules = {
  page1: {refresh: 'page2'},
  othersCachedClean: true // Other pages that are not page1 pages are re rendered every time
}

Example

  • The details page enters the list page, and the list page does not refresh
  • The non details page enters the list page, and the list page refreshes
<keepalive-extend
  unique-key="app"
  include="list"
  :rules="{
    list: {
      notRefresh: 'detail',
      refresh: /[^detail]/
    }
  }"
>
  <router-view />
</keepalive-extend>

Remind

  • The component name must be consistent with the name in the routing configuration
# ./src/page1.vue
<script>
export default {
  name: 'page1',
  ...
}
</script>

# router.js
const routes = [
  {
    path: '/',
    name: 'page1',
    component: () => import('./src/page1.vue')
  }
  ...
]
  • The name value of the page where the nested keepalive-extend is located must be configured in the exclude of the parent keepalive-extend
  • For the nested keepalive-extend page, if the slot needs to be permanently cached, turn on keep-active
  • Root keepalive-extend component does not need to enable keep-active