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

paint-html

v0.0.1

Published

loading css step

Readme

paint-html

把一个指定格式的html文件拆分成三个文件。通过ajax请求分别载入html,和css 部分,并慢慢加载css,实现动画的效果。

使用

  • 准备html文件 . 具体的html内容如下文。
  • 全局安装paint-html
npm install -g paint-html
  • 运行命令

进入到你第一步建立的html文件所在的目录,

paint-html c

html的格式

<!DOCTYPE html>
<html lang="zh-Hans">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>标题</title>
    <style>
        body {
            box-sizing: border-box;
            margin: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding:2em;
        }
        .title{margin-bottom:1em;}
        .title h2{padding-bottom:0;margin-bottom: 0.5em;}
        .loadingbar{
            width: 100%;
            height: 4px;
            background-color: #ccc;
            position: relative;
        }
        #loading{
            position: absolute;
            width: 0%;
            bottom:0;
            top:0;
            left:0;
            height: 4px;
            background-color: red;
        }
        #wrapper{
            display: flex;
            width: 100%;
            height: 100vh;
            /* height: 100%; */
        }
        .code-wrapper{
            flex: 1 1 auto;
            border:1px solid #ccc;
            overflow: auto;
            margin-right: 2em;
        }
        .code{padding:1em;}
        .preview-wrapper{
            flex:1 1 auto;
            border:1px solid #ccc;
            display: flex;
        }
        .preview-wrapper .preview{
            margin: auto;
        }
    </style>
    <!-- <link rel="stylesheet" href="./index.source.css"> -->
    <style id="styleTag">
      <!-- 
      
      
      
      css的内容 (1)
      
      
      
      -->
    </style>
</head>

<body>
    <div class="title">
        <h2>标题</h2>
        <div class="loadingbar"><div id="loading"></div></div>
    </div>
    <div id="wrapper">
        <div class="code-wrapper" id="code-wrapper">
            <pre class="code" id="cssCode">
            </pre>
        </div>
        <div class="preview-wrapper">
            <div class="preview" id="preview">
                    <!--



                        html的主体内容 (2)



                    -->
            </div>
        </div>
    </div>
</body>
</html>

你只能在(1)处写css代码, (2)处写html代码。 其它内容均不能修改。