{"name":"pug-error","version":"2.0.0","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","_id":"pug-error@2.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sjiUsi9M4RAGHktC1drQfCr5C5eriu24Lfbt4s+7SykztEOwVZtbFk1RRq0tzLxcMxMYTBR+zMQaG07J/btayQ==","shasum":"5c62173cb09c34de2a2ce04f17b8adfec74d8ca5","tarball":"http://registry-npm.ywwl.com/pug-error/download/pug-error-2.0.0.tgz","fileCount":4,"unpackedSize":4586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey7fFCRA9TVsSAnZWagAAqKkQAJFXgKcku485Va5baHIo\n7pLXuDI1ynjMXY6e7PeY6EQQISoj+fMQNDGtdeiovcj5aVB156mJCMO0xA+a\nM4mCQgGf9YL77QGds4imrs8jl6lX7l+wZrhI09+RgKh12ciXbOHSCsJKdNPu\nEmc3ELuV9XFT7zDvf2+7UTXTol4QCoLZv5yKZSLwbOVI759b+4UQZ3OLZHLu\nN/RlquSF7x/G0VS8KKd1I9wYkrPunsn+WDVdzkyH8wXh0dp1zX2bUpTxqts/\nqmVHDQif5MHNZvWs9yG1PxoFbgRpGpf7NZdIHzXn/snTwFg9Q2IHr1lcLsgK\nahRTHXPImRHQexcn+P+zo2ZeMjrrmBWrStcmZXtvhafo88Q/+DRohJPv/3Bg\nH9Y72WyQSngyCDRGQcC6ClUzirvq6EXW2/msxbr84Oz5Pk843uB3kCM0WYI5\nztLfu+BuBu052t/MVhrnqFGi9AqIjAFQSWGOGSSsiWXdwf65Tw6Ch488VQPm\npkf3rbolhAqZlWvhaEu2WXs52/R/5Xo8O68EZrnXxHWyqiFpsOZnnw2GSFof\nIzXA9OiDgSv7w4dmNG/t2bIiESTGS3UCZle/D3qtBqU4FrJWWAJWq4o7ZxMP\nmacGDL+aue/uLVeY9zVgydVyzkRC/gPOhlwvrzznALdbcOBtWUrmW/HroBvS\nWFpG\r\n=Kzct\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQJ89R05nAPUhjUSrFGamqcdN5nVtHfKIFB/LvBcdWPwIhAO2n9sq+9UhYv6eR7iV183avUyPIo2EHp+0QuCaUgloa"}],"size":2317,"noattachment":false,"key":"/pug-error/-/pug-error-2.0.0.tgz"},"maintainers":[{"email":"forbes@lindesay.co.uk","name":"forbeslindesay"},{"email":"pug-bot@rollingversions.com","name":"pug-bot"},{"email":"timothygu99@gmail.com","name":"timothygu"}],"_npmUser":{"name":"pug-bot","email":"pug-bot@rollingversions.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pug-error_2.0.0_1590409156678_0.602371367853187"},"_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":1590409156931,"_cnpm_publish_time":1590409156931,"dist-tags":{"canary":"2.1.0-canary-14","latest":"2.1.0"}}