{"name":"pug-error","version":"2.1.0-canary-13","description":"Standard error objects for pug","main":"./lib/index.js","types":"./lib/index.d.ts","keywords":["pug"],"repository":{"type":"git","url":"https://github.com/pugjs/pug/tree/master/packages/pug-error"},"author":{"name":"Forbes Lindesay"},"license":"MIT","readme":"# pug-error\n\nStandard error objects for pug.  This module is intended for use by the lexer, parser, loader, linker, code-generator and any plugins.\n\n[![Build Status](https://img.shields.io/travis/pugjs/pug-error/master.svg)](https://travis-ci.org/pugjs/pug-error)\n[![Dependencies Status](https://david-dm.org/pugjs/pug/status.svg?path=packages/pug-error)](https://david-dm.org/pugjs/pug?path=packages/pug-error)\n[![NPM version](https://img.shields.io/npm/v/pug-error.svg)](https://www.npmjs.org/package/pug-error)\n\n## Installation\n\n    npm install pug-error\n\n## Usage\n\n```js\nvar error = require('pug-error');\n```\n\n### `error(code, message, options)`\n\nCreate a Pug error object.\n\n`code` is a required unique code for the error type that can be used to pinpoint a certain error.\n\n`message` is a human-readable explanation of the error.\n\n`options` can contain any of the following properties:\n\n- `filename`: the name of the file causing the error\n- `line`: the offending line\n- `column`: the offending column\n- `src`: the Pug source, if available, for pretty-printing the error context\n\nThe resulting error object is a simple Error object with additional properties given in the arguments.\n\n**Caveat:** the `message` argument is stored in `err.msg`, not `err.message`, which is occupied with a better-formatted message.\n\n```js\nvar error = require('pug-error');\n\nvar err = error('MY_CODE', 'My message', {line: 3, filename: 'myfile', src: 'foo\\nbar\\nbaz\\nbash\\nbing'});\n// { code: 'PUG:MY_CODE',\n//   msg: 'My message',\n//   line: 3,\n//   column: undefined,\n//   filename: 'myfile',\n//   src: 'foo\\nbar\\nbaz\\nbash\\nbing',\n//   message: 'myfile:3\\n    1| foo\\n    2| bar\\n  > 3| baz\\n    4| bash\\n    5| bing\\n\\nMy message' }\n\nthrow err;\n```\n\n## License\n\n  MIT\n","readmeFilename":"README.md","_id":"pug-error@2.1.0-canary-13","_nodeVersion":"12.22.8","_npmVersion":"6.14.15","dist":{"integrity":"sha512-uvHQFcdv5oMvoDyyLDED+2ePo7VLR/K5CbWXu6QmSEEYkWOY1dAqVSJST9M0EMCEwXLZ84Chck1dsBuDuSj0WQ==","shasum":"5fafeb6528b0f02cc22ba88cf114643e380f8cc1","tarball":"http://registry-npm.ywwl.com/pug-error/download/pug-error-2.1.0-canary-13.tgz","fileCount":7,"unpackedSize":23063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxK8nCRA9TVsSAnZWagAAFcwP/24/+Oo8jbjwPd5aK7qA\np00cZRi+OxF2j/pgp9fRXbDzWCrlKVUj6wQm8rhlDvbzjZQBYWldQrUrXkSu\nwqeIXtFUjoLo1kWmvZnJqbstSMew7HnJUGjAFI38beK6NTJK+t/f9N0zFSAy\nTGvTcy1suW4VTS4PycOOxa77w2jwCuGF/EDtjk0ndeEiQ8MYzUD0AWVEiAEm\nXLKGG2m3bp0E6XxDd2G+jDy2Prv7UKuxr0OaTjfTjB/GWJXC2k9ztR/+uW/r\nGxJ5h0HiW9wOyVkWDMSI6VIFIctdgi49QfneMKwV5wSTvcWde2pP04E3VNel\nEa4gdcBjXj6CHUpO76Vd9xu2EYC2Bo7X7y2j/l5b638Xp1gM3b8QakX5QkOQ\n8uhPi4JtXqBwchmAfAvMMh0lwKOYYosB64/P61aC0h9U9r8aVCCurWsxmUBX\n+/p+/MENvlE7tp3GQdpDMGBDtmz8BybuHhWHkb3CqK/coSvcSE0w2B+7PV57\ngUWDupRVkI8ljzUqfqlrB9WDe9SpWX8KVaV6OHWdfvIhVVx7vPP/MV29vK44\nxkduMWeULJ8tdij2fKS2sMoj1okFjbMZEyEfggwDPpKSbXJtGkZjWRKQcAR2\n8XqfhQAl5wzAHp2fDOT72PORrmoDfAkTnRVNuqdoBjQScZlC8JkGr8STAAcj\nbAc6\r\n=ihDA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJjIV60/PHMzrToxilmfyRjpZhZN7pwgNUjwj/Cvc1kwIgbo6OHjPUvR1i79Zt2MERKIdFIUn5Vv5sRvc96w1ZfZ8="}],"size":9072,"noattachment":false,"key":"/pug-error/-/pug-error-2.1.0-canary-13.tgz"},"_npmUser":{"name":"pug-bot","email":"pug-bot@rollingversions.com"},"directories":{},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"pug-bot","email":"pug-bot@rollingversions.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pug-error_2.1.0-canary-13_1640279847559_0.428878140397021"},"_hasShrinkwrap":false,"publish_time":1640279847742,"_cnpm_publish_time":1640279847742,"dist-tags":{"canary":"2.1.0-canary-14","latest":"2.1.0"}}