New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

idle-preload

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idle-preload

preload something when the page is idle

latest
Source
npmnpm
Version
1.0.13
Version published
Weekly downloads
2
-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

Idle Preload

Features

Preload something when the page is idle.

Idle detection algorithm:

  • After page loaded, use setTimeout and record the real callback time delay.
  • Compute the variance of multiple callback time delay.
  • The page is considered idle and stable when the variance is low.

Installation

yarn add idle-preload

or

npm i idle-preload --save

Usage

import { idlePreload } from 'idle-preload'

const preload = idlePreload({
  // options
  // debug: true
})
preload.push(() => {
  // use your code to preload something
  // 
})
preload.start()

Options

  • varianceLimit: Integer (default 5),
  • samplingCount: Integer (default 5),
  • afterWindowLoad: Boolean (default true),
  • checkTimeInterval: Integer (default 200) ms,
  • debug: Boolean (default false)

License

MIT

Keywords

idle

FAQs

Package last updated on 27 Dec 2021

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