{"name":"pug-error","version":"1.3.3","description":"Standard error objects for pug","keywords":["pug"],"repository":{"type":"git","url":"https://github.com/pugjs/pug/tree/master/packages/pug-error"},"author":{"name":"Forbes Lindesay"},"license":"MIT","gitHead":"1bdf628a70fda7a0d840c52f3abce54b1c6b0130","_id":"pug-error@1.3.3","_nodeVersion":"11.14.0","_npmVersion":"lerna/3.10.8/node@v11.14.0+x64 (darwin)","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"dist":{"integrity":"sha512-qE3YhESP2mRAWMFJgKdtT5D7ckThRScXRwkfo+Erqga7dyJdY3ZquspprMCj/9sJ2ijm5hXFWQE/A3l4poMWiQ==","shasum":"f342fb008752d58034c185de03602dd9ffe15fa6","tarball":"http://registry-npm.ywwl.com/pug-error/download/pug-error-1.3.3.tgz","fileCount":4,"unpackedSize":4613,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCLKXCRA9TVsSAnZWagAApW8P/0wMk+NoiemNEXAA1i2c\nPlWWwA0yu/dyAg1Ge0MJfVBHITEjrHd2+fBz7Fi/jTXAm9HfvD+ZalMuhzwJ\njEFGGRflCQujHnX3UmR3Hba03rE/s9dRUwDYlNtmgzXZauBg01M9rGd9N5Gw\nsv6X0dIsybOex7fmafaMs4v5IYyCmbw/bop22uiLTcd15OpPtM6wegRAcwX1\n4+8Yp2+ROjmUEd/AIl+8W1iapRgZtEXJN9bDev04/1jt5Af9x2ONzAxHHMdN\ne5hUUQWy293W2thqa/0PEMtuWfU2ZT3wRISFlV4stE4aaj5oHIVPNJ4iGaHP\nUAkOuIl+D5zAGhTU07ZhtrNK3ekVXDwmynzm2dIzyoM5I3SviI8pExDx2ur4\n4auLRCN55Dj+2Za0RKA3+7iDNg/Bkc6RPyd4h7lPNsqOw+dL64jb0FMG0Ot3\njH+ktP48HZKGKTA2jRFOTrFchoR6+sxFnPXRefeOkITgk/AwtEGpWxiQHKG7\niTcpzc+J8P9xD3+ydIrLGPisFBw0EK9upRJu0toQBvqnCfQTvq6n7lHj7vEF\ntLtC26sV6ssg4ib12FIpTnmTC4jS3pr5Afw4xe6eqoO95ETcDxxC81azVGJl\nGeauYegz9k6r2LvWpLMMIjIpmaqt86UcTUPBFjgnuwtkagIM7SE1U8SRtVGF\nHDCT\r\n=xjwG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLM8h8mymBiNVVl1pknbAPk1sHBOvF8ngjllpHBjfIAgIhAOj3xAV5/9GH3ZF6Vbxxnkr7YeuPv0g5usHckI2JwZe4"}],"size":2353,"noattachment":false,"key":"/pug-error/-/pug-error-1.3.3.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"timothygu","email":"timothygu99@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pug-error_1.3.3_1560851095122_0.6161359800057267"},"_hasShrinkwrap":false,"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","publish_time":1560851095239,"_cnpm_publish_time":1560851095239,"dist-tags":{"canary":"2.1.0-canary-14","latest":"2.1.0"}}