try-catch

functional try-catch wrapper


Summary

Project Name try-catch Project Url http://github.com/coderaiser/try-catch
InceptionYear 2014-12-19 15:13:37 更新时间 2020-02-24 22:40:54
IssueManagement https://github.com/coderaiser/try-catch/issues Licenses MIT
仓库地址 git://github.com/coderaiser/try-catch.git 用户数 1
Node Engine >=6 文件大小 2.0 KB
install test lint fix:lint coverage report

项目介绍

# Try Catch [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] [NPMIMGURL]: https://img.shields.io/npm/v/try-catch.svg?style=flat [BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/try-catch/master.svg?style=flat [DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/try-catch.svg?style=flat [LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat [NPMURL]: https://npmjs.org/package/try-catch "npm" [BuildStatusURL]: https://travis-ci.org/coderaiser/try-catch "Build Status" [DependencyStatusURL]: https://david-dm.org/coderaiser/try-catch "Dependency Status" [LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License" [CoverageURL]: https://coveralls.io/github/coderaiser/readify?branch=master [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/readify/badge.svg?branch=master&service=github Functional `try-catch` wrapper ## Install ``` npm i try-catch ``` ## Example ```js const tryCatch = require('try-catch'); const {parse} = JSON; const [error, result] = tryCatch(parse, 'hello'); if (error) console.error(error.message); ``` ## Related - [try-to-catch](https://github.com/coderaiser/try-to-catch "TryToCatch") - functional try-catch wrapper for promises. ## License MIT

开发依赖

GroupId ArtifactID Version 引用量
Gregg Caines coveralls 3.1.0 41856
Nicholas C. Zakas eslint 7.10.0 238059
Toru Nagashima eslint-plugin-node 11.1.0 27563
coderaiser eslint-plugin-putout 5.2.0 202
coderaiser madrun 7.0.4 201
Ben Coe nyc 15.1.0 42605
coderaiser putout 6.6.1 110
coderaiser supertape 2.0.0 150