package.json 2.8 KB
{
  "_args": [
    [
      {
        "raw": "tryor@~0.1.2",
        "scope": null,
        "escapedName": "tryor",
        "name": "tryor",
        "rawSpec": "~0.1.2",
        "spec": ">=0.1.2 <0.2.0",
        "type": "range"
      },
      "/Users/admin/Documents/workspace/programming/node_modules/defs"
    ]
  ],
  "_from": "tryor@>=0.1.2 <0.2.0",
  "_id": "tryor@0.1.2",
  "_inCache": true,
  "_location": "/tryor",
  "_npmUser": {
    "name": "olov",
    "email": "olov.lassus@gmail.com"
  },
  "_npmVersion": "1.2.18",
  "_phantomChildren": {},
  "_requested": {
    "raw": "tryor@~0.1.2",
    "scope": null,
    "escapedName": "tryor",
    "name": "tryor",
    "rawSpec": "~0.1.2",
    "spec": ">=0.1.2 <0.2.0",
    "type": "range"
  },
  "_requiredBy": [
    "/defs"
  ],
  "_resolved": "https://registry.npmjs.org/tryor/-/tryor-0.1.2.tgz",
  "_shasum": "8145e4ca7caff40acde3ccf946e8b8bb75b4172b",
  "_shrinkwrap": null,
  "_spec": "tryor@~0.1.2",
  "_where": "/Users/admin/Documents/workspace/programming/node_modules/defs",
  "author": {
    "name": "Olov Lassus",
    "email": "olov.lassus@gmail.com"
  },
  "bugs": {
    "url": "https://github.com/olov/tryor/issues"
  },
  "dependencies": {},
  "description": "return fn() or default value (in case of exception)",
  "devDependencies": {},
  "directories": {},
  "dist": {
    "shasum": "8145e4ca7caff40acde3ccf946e8b8bb75b4172b",
    "tarball": "https://registry.npmjs.org/tryor/-/tryor-0.1.2.tgz"
  },
  "homepage": "https://github.com/olov/tryor#readme",
  "keywords": [
    "try",
    "catch",
    "default"
  ],
  "license": "MIT",
  "main": "tryor.js",
  "maintainers": [
    {
      "name": "olov",
      "email": "olov.lassus@gmail.com"
    }
  ],
  "name": "tryor",
  "optionalDependencies": {},
  "readme": "# tryor.js\nGive it a function and a default value. `tryor` will give you back the return value of\nthe function or, in case the function threw an exception, the default value.\nWorks in node and browsers.\n\n\n\n## Usage\n```javascript\n    // do this\n    var config = tryor(function() {\n        return JSON.parse(userProvidedConfigString);\n    }, {});\n\n    // instead of\n    var config; // or var config = {}; and empty catch\n    try {\n        config = JSON.parse(userProvidedConfigString);\n    } catch (e) {\n        config = {};\n    }\n```\n\nWorks extra well with ES6-style `const` variables.\n\n\n\n## Installation\n\n### Node\nInstall using npm\n\n    npm install tryor\n\n```javascript\nvar tryor = require(\"tryor\");\n```\n\n### Browser\nClone the repo and include it in a script tag\n\n    git clone https://github.com/olov/tryor.git\n\n```html\n<script src=\"tryor/tryor.js\"></script>\n```\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/olov/tryor.git"
  },
  "scripts": {},
  "version": "0.1.2"
}