Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-insomnia

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-insomnia

A vue plugin that prevents display sleep.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by27.27%
Maintainers
1
Weekly downloads
 
Created
Source

vue-insomnia

Prevents the display of a mobile device from going to sleep by playing a small (6kb) mp4 video that's positioned off screen on a loop.

Installation

Import into your project using npm or yarn.

yarn add vue-insomnia or npm install --save vue-insomnia

In your main.js (or equivalent) import and then use vue-insomnia.

import vueInsomnia from "vue-insomnia";

Vue.use(vueInsomnia);

Usage

There are two methods globally available, vueInsomnia().on() and vueInsomnia().off(), to toggle screen wake lock on and off, respectively. For example, to turn on the wake lock when a component is loaded:

mounted: {
  this.vueInsomnia().on();
}

or to use in a component template:

Add a method

methods: {
  wakeLockOn() {
    this.vueInsomnia().on();
  },
  wakeLockOff() {
    this.vueInsomnia().off();
  }
}

and then use the method:

<button @click="wakeLockOn">Wake Lock on</button>

FAQs

Package last updated on 14 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc