0.0.8 • Published 2 years ago

nv-cli-find-catch v0.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

nv-cli-find-catch

  • cli-tool
  • find CatchClause in js/ts/json
  • this use RegExp + parser, so its slow IF too many files in path-dir, such as node_modules

install

  • npm install nv-cli-find-catch -g

usage

    Usage: nv_cli_find_catch [options]
    Options:
        -p, --path            path to search ,default ./
        -r, --regex           strlitentifier name regexp pattern
        -u, --suffixes        default js ts json
        -h, --help            usage

example

    nv-cli-find-catch# nv_cli_find_catch -r configError
    /mnt/sdb/NV5/NV5_/nvcli-/pkgs/JSCODING/nv-cli-find-catch/node_modules/@babel/core/lib/config/files/configuration.js
    Position { line: 124, column: 4 } Position { line: 126, column: 3 }
        try {
          options = _json().parse(content);
        } catch (err) {
          throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
        }
    ==================
    /mnt/sdb/NV5/NV5_/nvcli-/pkgs/JSCODING/nv-cli-find-catch/node_modules/@babel/core/lib/config/files/module-types.js
    Position { line: 126, column: 4 } Position { line: 140, column: 3 }
        try {
          return require("@babel/preset-typescript");
        } catch (error) {
          if (error.code !== "MODULE_NOT_FOUND") throw error;
          let message = "You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!";
        
          if (process.versions.pnp) {
            message += `
        If you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file:
        
        packageExtensions:
        \t"@babel/core@*":
        \t\tpeerDependencies:
        \t\t\t"@babel/preset-typescript": "*"
        `;
          }
        
          throw new _configError.default(message, filepath);
        }
    ==================
    /mnt/sdb/NV5/NV5_/nvcli-/pkgs/JSCODING/nv-cli-find-catch/node_modules/@babel/core/lib/config/validation/options.js
    Position { line: 85, column: 4 } Position { line: 89, column: 3 }
        try {
          return validateNested({
            type: "root",
            source: type
          }, opts);
        } catch (error) {
          const configError = new _configError.default(error.message, filename);
          if (error.code) configError.code = error.code;
          throw configError;
        }
    ==================
    nv-cli-find-catch# 

LICENSE

  • ISC