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

preview-skr-component-cli

v1.0.3

Published

Check Your Reskript Project Component Play Demo.

Downloads

34

Readme

preview-skr-component CLI 工具

preview-skr-component 是一个基于 reskript 脚手架的命令行工具,主要用于项目中公共组件的预览和管理。它提供了快速预览组件的功能,并支持添加新的公共组件。

功能

  • 预览组件: 使用 preview 命令预览指定目录下的组件。
  • 新增公共组件: 使用 add 命令在配置的公共组件目录下创建新的组件。

安装

使用 npm 全局安装:

npm install -g preview-skr-component

使用

预览组件

预览指定目录下的组件:

preview-skr-component preview [directory]
  • directory: 可选参数,指定要预览的组件目录。如果未提供,将使用 .previewrc 文件中的默认路径。

新增公共组件

在配置的目录下添加新组件:

preview-skr-component add [directory]
  • directory: 可选参数,指定要添加到的组件目录。如果未提供,将使用 .previewrc 文件中的默认路径。

.previewrc 配置文件

在项目根目录下的 .previewrc 文件中配置公共组件的默认路径。示例:

path=/src/components/common

当运行 preview 命令时,如果未指定 directory 参数,将使用这个路径。

示例

预览组件

运行以下命令:

preview-skr-component preview

如果 .previewrc 配置了路径,命令将自动使用该路径。

新增组件

运行以下命令:

preview-skr-component add

如果 .previewrc 配置了路径,命令将自动使用该路径。并进行交互式提示,输入组件名称。

注意事项

确保 .previewrc 文件放置在项目根目录下。 如果未找到 .previewrc 文件,工具将要求手动指定组件目录。