GithubHelp home page GithubHelp logo

jxy-precommit's Introduction

项目介绍

用来检测项目中引入的静态资源是否为三方文件,如果不在允许范围内,则报错,打印错误信息,并终止程序

项目结构

jxy-precommit
├─ components
│  ├─ cdnLinkCheck.js
│  ├─ colorText.js
│  ├─ httpString.js
│  └─ seadEmail.js
├─ demo.js
├─ index.js
├─ package-lock.json
├─ package.json
└─ readme.md

使用方法

yarn add jxy-precommit -D
npm i jxy-precommit -D

在package.json中添加script脚本

npm set-script init "jxyCommitInit" && npm run init
"init": "jxyCommitInit"

控制台打印出结果:pre-commit钩子初始化成功!!

则表示安装成功

注意

如果输入的文件目录中检测到.gitignore文件,则在检测cdn是否合法时,会自动忽略.gitignore中配置的文件 如果输入的文件目录中没有检测到.gitignore文件,则默认回检查改目录下的所有文件

默认不检查这几个文件:'package.json', 'yarn.lock', 'package-lock.json','yarn-error.log'

jxy-precommit's People

Stargazers

jiangxiaoyu avatar

Watchers

jiangxiaoyu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.