Skip to content

zhangliu/babel-plugin-catch-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

938a47e · Feb 14, 2019

History

15 Commits
Jan 28, 2019
Jan 31, 2019
Jan 28, 2019
Jan 26, 2019
Jan 26, 2019
Jan 26, 2019
Jan 26, 2019
Jan 27, 2019
Feb 14, 2019

Repository files navigation

@qnpm/babel-plugin-catch-log

这个插件可以自动帮你收集异常到数组:window.__elog中。

Example

In

try {
  // your code
} catch (e) {
  // your exception handler code
}

Out

try {
  // your code
} catch (e) {
  __elog.push(e) // this babel plugin will add this line automatic.
  // your exception handler code
}

Installation

$ npm install @qnpm/babel-plugin-catch-log

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["@qnpm/babel-plugin-catch-log"]
}

Via CLI

$ babel --plugins @qnpm/babel-plugin-catch-log script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["@qnpm/babel-plugin-catch-log"]
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published