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

compscaf

v1.1.5

Published

组件化脚手架工具

Readme

#组件化脚手架 组件化脚手架程序

##INSTALL

npm install compscaf

##OPTION

-o, --comp [name]:  init a compoment : required
-t, --tpl  [name]:  init a tpl   file, default [name] is main 
-s, --scss [name]:  init a scss  file, default [name] is base 
-j, --js   [name]:  init a entry file, default [name] is index
-a, --all        :  init all file[tpl/scss/js]
-f, --force      :  init a compoment, remove the old one if extis
-c, --clear      :  clear a component, remove all file in the component dir

###USAGE

    ./node_modules/.bin/compscaf -r './' -o test 
    ./node_modules/.bin/compscaf -r './' -o test -c 
    ./node_modules/.bin/compscaf -r './' -o test -fjts 
    ./node_modules/.bin/compscaf -r './' -o test -s common -j entry

##Common Config 自定义配置文件:${process.cwd}/compscaf.yml ####cwd String

组件目录,相对于process.cwd() ####contentTpl Object{:type-> String}

类型文件对应的初始化内容,目前支持变量

comp:组件名
deps:组件依赖
depsVar:组件变量名
EOL: 换行符

####baseDeps Array[String]

基础依赖,入口文件的通用依赖模块 ####varRegx Object{:type-> Array[RegExp, replacement]}

变量匹配正则 ####extension Object{:type-> String}

文件扩展名 ####defaultName Object{:type-> String}

默认文件名(不含文件后缀) ###Default Config

cwd: './'

contentTpl:
    tpl: '<div class="o-{{comp}}">{{EOL}}</div>'
    scss: '.o-{{comp}} {{{EOL}}}'
    js: "define('comp/{{comp}}/index', [{{deps}}], function ({{depsVars}}) {{{EOL}}})"

baseDeps: []

varRegx :
    baseDep: [ ".+\/([^\/]+)'$" , '$$$1']
    tpl: [ "([^\.]+).+$" , "$$$1Tpl"]

extension:
    tpl: 'html'

defaultName:
    js: 'index'
    scss: 'base'
    tpl: 'main'

##TEST

./node_modules/.bin/compscaf -o test -af

生成指定名称test组件的目录,以及scss,entry js,tpl资源文件,并预先填充内容;

默认配置下,组件目录下生成

├── base.scss
├── index.js
└── main.html

####base.scss

.o-test {
}

####index.js

define('comp/test/index', ['./main.html', './base.scss'], function ($mainTpl) {
})

####main.html

<div class="o-test">
</div>