{"name":"@arrows/error","version":"0.1.1","main":"lib/index.js","license":"ISC","scripts":{"build":"tsc","test":"jest","coverage":"jest --coverage && codecov -F error","prepublish":"yarn build"},"devDependencies":{"@types/jest":"^24.0.18","jest":"^24.9.0","ts-jest":"^24.1.0","typescript":"^3.6.3"},"dependencies":{"codecov":"^3.6.1"},"description":"![CircleCI](https://img.shields.io/circleci/build/github/caderek/arrows) ![David (path)](https://img.shields.io/david/caderek/arrows?path=packages%2Ferror)","_id":"@arrows/error@0.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.10.1","dist":{"integrity":"sha512-2/orW1fhcAkJfq0Fmji/Ra8WGg6UY9kTmJent91A+hw1UsGmN2o68WCyMjGVC2RpT487Z0BGXW0j5Z+hqYvVTw==","shasum":"07258433be63c9fa4bfd1dd1a0a7b53c4c4dba9a","tarball":"http://registry-npm.ywwl.com/@arrows/error/download/@arrows/error-0.1.1.tgz","fileCount":12,"unpackedSize":4718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhZrECRA9TVsSAnZWagAAVQgP/0k3x4JP3BlEgza47omG\n1O10bVdikiudc7yB1EGPVhYltRi/SquVxRR5h4UgOILvfPe+eBhn1X2pu7W6\nOVwq4BYuom/UihmiGwTS3VQkTQY+uKwiCsTGrfhoqSy0tD88SZFpzWm2sfV1\nUAAu6dlXtNAcqlfkRBh5XtTlZsQVK8ZyEOne+9FEyvfiv/VkAu7w9tnjHSAH\nZFsEM4TGcXeW3yit8Li5lvJt5JutyPUnac5GBd+hWtltEChem1d2MNcZ0eA9\nUvRYXJ2GBeLmzWW/elh58gDMdy5V2ds95nlZRdc0UQB2EYfhKmP/T9LYZnTQ\nSyhKSfPn285XY6PpoPd98gdFsZBPJGK1+MAaBm6LK9PROWMIGrw5nkjtPtNx\n+ORPkg+QZIATse3dcsyxzAwCJ9q6yPGXgGz0JMHhl+kE0gGpaNXRxCn2n/qW\n1imuJBqCDZ6LcNB/ed2QQ2fRB1c8am+mdySjguSZGQomXZK5A9oB1lvT3Yii\n6YVk/+HD6FCE7D7jpgfm54h+arJW+QIS+Eeg570JjucqAXsqZfuiMQDrq4ud\nzCOYQ7i6XmRNGgoOAPcwOP5Dlca0iiwg08riuwNdTnhsgJw52M4s2l06DeaC\n29TjixWO74a+RficdEKCpdUuPZ7M5vKg5EQ+vP/t4r1yYbVAoqseRKtj2Llt\njSEy\r\n=eurH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+jZEBhrYsgaacS8v4Z5ZOQOox0Md++SkQ8VeqkqC82AiEAgTg9BSxnXcvl8ZN3ayddYSiGgek0RqBen4S8JmbUWsg="}],"size":2211,"noattachment":false,"key":"/@arrows/error/-/@arrows/error-0.1.1.tgz"},"maintainers":[{"name":"caderek","email":"maciej.caderek@gmail.com"}],"_npmUser":{"name":"caderek","email":"maciej.caderek@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_0.1.1_1569036995973_0.4817430479616167"},"_hasShrinkwrap":false,"readme":"# @arrows/error\n\n![npm (scoped)](https://img.shields.io/npm/v/@arrows/error)\n![CircleCI](https://img.shields.io/circleci/build/github/caderek/arrows)\n![David (path)](https://img.shields.io/david/caderek/arrows?path=packages%2Ferror)\n![Codecov](https://img.shields.io/codecov/c/github/caderek/arrows?token=c6adb715d638431786fefe69ca08ab00)\n![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@arrows/error)\n![GitHub](https://img.shields.io/github/license/caderek/arrows)\n\n## Table of contents\n\n1. [Introduction](#introduction)\n2. [Installation](#installation)\n3. [API reference](#api-reference)\n   - [createErrorClass](#createErrorClass)\n4. [License](#license)\n\n## Introduction\n\nThe library contains a set of helper functions for error handling.\n\nThe library has **built-in type definitions**, which provide an excellent IDE support.\n\n## Installation\n\nVia NPM:\n\n```sh\nnpm i @arrows/error\n```\n\nVia Yarn:\n\n```sh\nyarn add @arrows/error\n```\n\n## API reference\n\n### createErrorClass\n\nCreates custom error class that returns extended error object that can be serialized to JSON.\n\n#### Parameters\n\n- `name` - The error name (should be the same as the name of the variable to which the class is assigned)\n- `message` - Error message\n- `serializeStacktrace` An optional boolean flag, to indicate weather a stacktrace should be serialized (default: false)\n\n#### Returns\n\n- Returns custom error class that takes one optional argument - error details\n\n#### Interface\n\n```\n(name , message, serializeStacktrace?) => custom_error_class\n```\n\n#### Examples\n\nCreate a custom error class:\n\n```javascript\nconst MyError = createErrorClass('MyError', 'some message')\n```\n\nCreate a custom error class with serializable stacktrace:\n\n```javascript\nconst MyError = createErrorClass('MyError', 'some message', true)\n```\n\n## License\n\nProject is under open, non-restrictive [ISC license](LICENSE).\n","publish_time":1569036996099,"_cnpm_publish_time":1569036996099,"dist-tags":{"latest":"1.0.2"}}