1. gazeer
Command line interface for the gaze watcher
gazeer
Package: gazeer
Created by: terrykingcha
Last modified: Sat, 18 Jun 2022 05:03:43 GMT
Version: 0.1.1
License: MIT
Downloads: 10
Repository: https://github.com/terrykingcha/gazeer

Install

npm install gazeer
yarn add gazeer

Gazeer - A cli for gaze.

npm version
Build Status

Watch some files, do some things

Feature

  1. Support multiple patterns.
  2. Support multiple commands in order.
  3. High performance.

Installation

 $ npm install gazeer

Usage

 $ gazeer -p '**/*.js' -c 'babel $filepath' 

[src/index.js changes]

> babel src/index.js

Multiple patterns

gaze accepts an array of patterns, so does gazeer:

 $ gazeer -p '**/*.js' -p '!node_modules/**/*' -c 'babel $filepath'

[index.js changes]

> babel index.js

Multiple commands

gazeer also accepets multiple commands, and there will run in order. Otherwise you can specify some replacement marks.

 $ gazeer -p '**/*.js' -p '!node_modules/**/*' -c 'babel $filepath -o $dirname/../build/$basename' -c 'eslint $filepath'

[src/index.js changes]

> babel src/index.js -o src/../build/index.js
> eslint src/index.js

Arbitrary watch tasks with npm run

If you haven't read substack's post describing lightweight build steps
with npm run
, I'll
give you a moment to get up to speed.

Here's how you might use gazeer to run a build task every time a file
changes:

 {
  "scripts": {
    "lint": "eslint --fix --config .eslintrc *.js src/*.js",
    "watch-test": "./src/gazeer.js -p 'src/*.js' -c 'babel \"$filepath\" -o \"$dirname/../index.js\"' -c 'npm run lint'",
  }
}

And then start the watcher:

 $ npm run watch-test

Contributing

Bug reports and pull requests are welcome. Code should follow the existing style and pass lint.

To run lint: npm run lint.

License

(The MIT License)

Copyright (c) 2016 Jin Bo (Terry King)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin