GithubHelp home page GithubHelp logo

norfish / tryjs Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 260 KB

为代码自动加 try-catch,捕获异常。wrap function body with try-catch

JavaScript 99.66% HTML 0.34%
node-module try-catch error-handling error-reporting ast

tryjs's Introduction

安装

npm install tryjs -g

如果安装失败,请使用 sudo

使用

  1. 进入到想要执行的目录
  2. 执行 tryjs
$ tryjs

Usage

Usage: tryjs [options]

  Options:

    -h, --help                   output usage information
    -V, --version                output the version number
    -c --configFile [file]       指定 config 文件
    -f, --file [file]            指定某个文件
    -d, --directory [directory]  指定文件夹
    -i, --ignore [ignores]       忽略文件夹或文件

通过 config 文件配置,默认为项目根目录下的 tryjs.config 文件,格式为JSON

{
    include: '.js .jsx', //包含的文件类型
    ignoreFiles: [], //忽略的文件
    ignoreFolders: [], //忽略的文件夹
    compileFile: '', //指定编译的文件
    directory: ["src"], //指定编译的文件夹
    errHandler: 'ErrorHandler' //错误处理函数名
}

UPDATE LOG

  • 0.0.1 use uglifyjs2

  • 0.0.2

  • 0.1.0 rework change: change acore to parse AST change: use esgencode to gennereate code

  • 0.1.2 change: 读写操作改为同步

tryjs's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tryjs's Issues

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.