Socket
Book a DemoInstallSign in
Socket

@cycjimmy/h5-preloader

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cycjimmy/h5-preloader

Resources pre-load for h5 page

5.0.4
latest
Source
npmnpm
Version published
Weekly downloads
3
Maintainers
0
Weekly downloads
 
Created
Source

H5 Preloader

libraries dependency status libraries sourcerank Coverage Status Release date rollup semantic-release jest npm license

Resources pre-load for h5 page. Demo

Install

NPM version NPM bundle size npm download

# via npm
$ npm install @cycjimmy/h5-preloader --save

# or via yarn
$ yarn add @cycjimmy/h5-preloader

Usage

import h5Preloader from '@cycjimmy/h5-preloader';

h5Preloader({
  type: 'progressBar',
  progressBar: {
    eProgressBar: ...,
    eProgressBarPercent: ...
  },
  resources: [
    ...
  ],
  hookWhenProgressComplete: () => 
    ...
  },
}).load();
  • h5Preloader config:
    • resources: [Require][Array] Resource paths array.
    • type: [Option][String] Set type of progress. Currently only supports 'progressBar'. Default 'progressBar'.
    • progressBar: [Option][Object] Progress bar config
      • eProgressBar: [Element] Element of Progress bar.
      • eProgressBarPercent: [Element] Element for showing percent.
    • hookWhenProgressComplete: [Option][Function] The hook function when the progress complete.
    • autoComplete: [Option][Boolean] Whether to automatic operation the hook function when the progress complete. Default true
  • h5Preloader instance supports the following methods:
    • load(): Start preloader.
    • progressComplete(): Call the progress complete function manually.

CDN

jsdelivr

To use via a CDN include this in your HTML:

<script src="https://cdn.jsdelivr.net/npm/@cycjimmy/h5-preloader@5/dist/h5-preloader.umd.min.js"></script>

Keywords

h5

FAQs

Package last updated on 17 Jul 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.