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 🙏

© 2024 – Pkg Stats / Ryan Hefner

page-skt

v1.0.5

Published

骨架屏生成工具

Downloads

6

Readme

一款自动生成骨架屏的工具

Yarn Install (推荐)

$ yarn global add page-skt

Npm Install

$ npm install page-skt -g

Usage

Example

Step1 执行命令:

$ skt init

在当前目录生成 config.js 配置文件

{
    url: 'http://www.baidu.com', // 页面地址

    devices: {               // 支持设备类型列表,可扩增设备
        iphone: [375, 667, 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1'],
        ipad: [768, 1024, 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1'],
        ipadPro: [1024, 1366, 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1'],
        pc: [1200, 1000, 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1']
    },
    device: 'iphone',        // 默认设备类型
    style: `animation: opacity 1s linear infinite;`, // 骨架动画样式
    background: '#eee', // 骨架填充色
    output: '', // 输出路径。默认当前执行目录
    cutHeight: 0, // 裁剪页面高度,骨架屏整体上移
    ignoreBlockByClass: [], // 忽略模块(类名)
    ignoreDomByClass: [], // 忽略单节点(类名匹配)
    ignoreDomById: ['header'] // 忽略单节点 (id匹配)
    // headers: {  // 配置 header
    //     cookies: [{ // 如果页面需要登陆态,设置 cookie
    //         'name': 'pt_pin',
    //         domain: '.jd.com',
    //         'value': '%E6%88%91%E5%90%83%E5%B0%8F%E8%98%91%E8%8F%87635'
    //     }, {
    //         'name': 'pt_key',
    //         domain: '.jd.com',
    //         'value': 'AAJiEzi8AECSC83BcZNPs3bji3v7LxJVFpr-GMBV9dXDfSCtDK64orA4FUQr9QopjF23IDsERxPlQcTBCEanx8p3JNhcJ2BY'
    //     }],
    // }
}

Step2 执行命令:

$ skt start

在当前目录分别生成:

  • index.html 文件骨架屏
  • index.React 文件骨架屏
  • index.Vue 文件骨架屏