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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vuses

v1.2.0

Published

[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![Travis](https://img.shields.io/travis/jo0ger/vuses.svg)](https://travis-ci.org/jo0ger/vuses) [![Coveralls](https://img.shields

Readme

vuses

styled with prettier Travis Coveralls dependencies

Vue Hooks that built with Vue Composition Api

For Vue 3, but also compatible with Vue 2

Usage

if you are using Vue2, you must first import @vue/composition-api package:

import Vue from 'vue'
import CompositionAPI from '@vue/composition-api'

Vue.use(CompositionAPI) // required for Vue2

and then:

<template>
  <div>
    <p>{{ counter }}</p>
    <button @click="inc">inc</button>
    <button @click="dec">dec</button>
  </div>
</template>

<script>
  import { useCounter } from 'vuses'

  export default {
    setup () {
      const [counter, { inc, dec }] = useCounter()
      return {
        counter,
        inc,
        dec
      }
    }
  }
</script>

Hooks Plan

  • State:
    • [x] useCounter and useNumber: tracks state of a number
    • [x] useToggle and useBoolean: tracks state of a boolean
    • [x] usePrevious: returns the previous state
    • [ ] useDefault: returns the default value when state is null or undefined
    • [ ] useGetSet: returns state getter get() instead of raw state
    • [ ] useGetSetState: as if useGetSet and useSetState had a baby
    • [ ] useObservable: tracks latest value of an Observable
    • [ ] useStateList: circularly iterates over an array
    • [ ] useList: tracks state of an array
    • [ ] useMap: tracks state of an object
    • [ ] useStateValidator: tracks state of an object
  • Sensors:
    • [x] useWindowSize: tracks Widnow dimensions(browser environment is required)
    • [x] useWindowScroll: tracks Window scroll position(browser environment is required)
    • [ ] useBattery: tracks device battery state
    • [x] useGeolocation: tracks geo location state of user's device
    • [ ] useIdle: tracks whether user is being inactive
    • [ ] useIntersection: tracks an HTML element's intersection
    • [ ] useEvent: subscribe to events
    • [x] useMedia: tracks state of a CSS media query
    • [ ] useMediaDevices: tracks connected hardware devices
    • [ ] useMotion: tracks state of device's motion sensor
    • [x] useMouse: tracks state of mouse position
    • [ ] useNetwork: tracks state of user's internet connection
    • [ ] usePageLeave: triggers when mouse leaves page boundaries
  • Side Effects:
    • [ ] useDebounce: debounces a function
    • [ ] useThrottle: throttles a function
    • [ ] useAsync: resolves an async function
    • [x] useLocalStorage: manages a value in localStorage
    • [x] useSessionStorage: manages a value in sessionStorage
    • [x] useFavicon: sets favicon of the page
    • [x] useTitle: sets title of the page
    • [x] usePermission: query permission status for browser APIs
  • UI:
    • [ ] useClickAway: triggers callback when user clicks outside target area
    • [ ] useCss: dynamically adjusts CSS
    • [ ] useFullscreen: display an element or video full-screen
    • [ ] useWait: complex waiting management for UIs
  • Animations:
    • [ ] useTimeout: re-renders component after a timeout
    • [ ] useInterval: re-renders component on a set interval using setInterval

Contributing

Please see Contributing

Contributors

License

MIT