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

publication-check

v0.0.3

Published

A tool helps verify if the publication tar/zip file valid as expect

Downloads

6

Readme

publication-check

NPM

简介

publication-check 顾名思义, 一个用于为发布包而开发的校验工具。项目开发完成后,项目可以使用gulp,fis,webpack等构建工具打包成zip,tar 等存档包并上传到自己的而是环境或正式环境。但在前后端分离的情况下,项目可变性是很大的。例如:后端接口重构,需要对所有前端请求API接口做相应 更新,我们通过自动化工具甚至全局替换的方式去更新,但是往往这会导致替换错误,漏替换等不稳定的场景发生。又例如,在开发环境和正式环境的部署过程中, 由于环境不同我们往往需要定制不同的配置文件从而达到切换开发环境和正式环境的效果。而这里在日常部署环节下仍出现不小心部署错误的或旧版的配置文件导致 正式环境崩溃。这并不能怪程序员,因为在多次版本迭代变更等不稳定因素下,出错是难免的。 所以publication-check就是编写一个部署的环节,从而大大减少甚至 杜绝不稳定变更下部署出错。

安装

npm install publication-check -g

环境

  • NodeJS

如何使用

打开命令行工具键入:

publication-check -z <你的压缩文件路径> -m <你的manifest配置文件路径>

  Usage: index [options]

  Options:

    -h, --help            输出命令帮助信息
    -V, --version         输出版本号
    -z, --zip <value>     输入压缩文件路径
    -m, --dest <value>    输入manifest配置文件路径

manifest文件配置

配置文件必须包含: > checkList > blackList

checkList在这里表示当前发布包的某文件下必须包含 <某字段> 或 <某正则> blackList在这里表示当前发布包的某文件下禁止包含 <某字段> 或 <某正则>

例子#1 - 空manifest配置文件:

    {
      "checkList": {

      },
      "blackList": {

      }
    }

例子#2 - 所有js文件必须包含<Author:Ailun She>:

    {
      "checkList": {
        "**/*.js": [
          "Author:Ailun She"
        ]
      },
      "blackList": {

      }
    }

例子#3 - 所有js文件必须包含<Author:Ailun She>, 且不能出现console.log等关键字:

    {
      "Web.config": {
        "**/*.js": [
          "Author:Ailun She"
        ]
      },
      "blackList": {
        "**/*.js": [
          "console.log"
        ]
      }
    }

例子#4 - 确保Web.config中不能出现kph.开头若干字符.com的关键字, 且必须出现taobao.com的关键字

    {
      "checkList": {
        "**/*.js": [
          "taobao.com"
        ]
      },
      "blackList": {
        "**/*.js": [
          "/kph\..*?\.com/"
        ]
      }
    }