tryor

WebJar for tryor

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

tryor
Последняя версия

Последняя версия

0.1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

tryor
WebJar for tryor
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/olov/tryor

Скачать tryor

Имя Файла Размер
tryor-0.1.2.pom
tryor-0.1.2.jar 4 KB
tryor-0.1.2-sources.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/tryor/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>tryor</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/tryor/
implementation 'org.webjars.npm:tryor:0.1.2'
// https://jarcasting.com/artifacts/org.webjars.npm/tryor/
implementation ("org.webjars.npm:tryor:0.1.2")
'org.webjars.npm:tryor:jar:0.1.2'
<dependency org="org.webjars.npm" name="tryor" rev="0.1.2">
  <artifact name="tryor" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='tryor', version='0.1.2')
)
libraryDependencies += "org.webjars.npm" % "tryor" % "0.1.2"
[org.webjars.npm/tryor "0.1.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

tryor.js

Give it a function and a default value. tryor will give you back the return value of the function or, in case the function threw an exception, the default value. Works in node and browsers.

Usage

    // do this
    var config = tryor(function() {
        return JSON.parse(userProvidedConfigString);
    }, {});

    // instead of
    var config; // or var config = {}; and empty catch
    try {
        config = JSON.parse(userProvidedConfigString);
    } catch (e) {
        config = {};
    }

Works extra well with ES6-style const variables.

Installation

Node

Install using npm

npm install tryor
var tryor = require("tryor");

Browser

Clone the repo and include it in a script tag

git clone https://github.com/olov/tryor.git
<script src="tryor/tryor.js"></script>

Версии библиотеки

Версия
0.1.2