{"maintainers":[{"email":"npm@moox.io","name":"anonymous"}],"keywords":["css","postcss","postcss-plugins","messages","error","warning"],"dist-tags":{"latest":"2.0.0"},"author":{"name":"Maxime Thirouin"},"description":"PostCSS helpers to throw or output GNU style messages","readme":"# postcss-message-helpers [![Build Status](https://travis-ci.org/MoOx/postcss-message-helpers.png)](https://travis-ci.org/MoOx/postcss-message-helpers)\n\n> [PostCSS](https://github.com/postcss/postcss) helpers to throw or output GNU style messages.\n\nThis modules offers you some function to throw or just output messages with [GNU style](https://www.gnu.org/prep/standards/html_node/Errors.html): `sourcefile:lineno:column: message`\n\n## Installation\n\n```console\n$ npm install postcss-message-helpers\n```\n\n```js\nvar messageHelpers = require(\"postcss-message-helpers\")\n```\n\n## Usage\n\n### `var fnValue = messageHelpers.try(fn, source)`\n\nExecute `fn` an return the value.\nIf an exception is thrown during the process, the exception will be catched, enhanced from source & re-throw.\n\n### `var sourceMessage = messageHelpers.message(message, source)`\n\nReturns a message like `sourcefile:lineno:column: message`.  \n`source` should be a postcss source object from a node.\n\n### `var source = messageHelpers.source(source)`\n\nReturns `sourcefile:lineno:column` for a given `source` postcss object.\n\n### Example\n\n```js\n// dependencies\nvar fs = require(\"fs\")\nvar postcss = require(\"postcss\")\nvar messageHelpers = require(\"postcss-message-helpers\")\n\n// css to be processed\nvar css = fs.readFileSync(\"input.css\", \"utf8\")\n\n// process css\nvar output = postcss()\n  .use(function(styles) {\n    styles.eachDecl(function transformDecl(decl) {\n      // will catch, adjust error stack, line, column & message (gnu style) then re-throw\n      messageHelpers.try(function IwillThrow() {\n        if (decl.value.indexOf(\"error(\") > -1) {\n          throw new Error(\"error detected: \" + decl.value)\n        }\n      }, decl.source)\n\n      // will output a gnu style warning\n      if (decl.value.indexOf(\"warning(\") > -1) {\n        console.warning(messageHelpers.message(\"warning: \" + decl.value, decl.source))\n      }\n    })\n  })\n  .process(css)\n  .css\n```\n\nCheckout [tests](test) for more examples.\n\n---\n\n## Contributing\n\nWork on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.\n\n    $ git clone https://github.com/MoOx/postcss-message-helpers.git\n    $ git checkout -b patch-1\n    $ npm install\n    $ npm test\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE)\n","repository":{"type":"git","url":"https://github.com/MoOx/postcss-message-helpers.git"},"bugs":{"url":"https://github.com/MoOx/postcss-message-helpers/issues"},"license":"MIT","versions":{"1.0.0":{"name":"postcss-message-helpers","version":"1.0.0","description":"PostCSS helpers to throw or output GNU style messages","keywords":["css","postcss","postcss-plugins","messages","error","warning"],"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"https://github.com/postcss/postcss-message-helpers.git"},"files":["CHANGELOG.md","LICENSE","index.js"],"devDependencies":{"jscs":"^1.6.2","jshint":"^2.5.6","postcss":"^3.0.0","tape":"^3.0.0"},"scripts":{"lint":"jscs *.js **/*.js && jshint . --exclude-path .gitignore","test":"npm run lint && tape test"},"gitHead":"8874d3bb618d326c2f82f697377768a8ea759a0c","bugs":{"url":"https://github.com/postcss/postcss-message-helpers/issues"},"homepage":"https://github.com/postcss/postcss-message-helpers","_id":"postcss-message-helpers@1.0.0","_shasum":"79945686a9702f9b48810e7100528829d61d4554","_from":".","_npmVersion":"2.1.6","_nodeVersion":"0.10.33","_npmUser":{"name":"anonymous","email":"m@moox.io"},"maintainers":[{"name":"anonymous","email":"m@moox.io"}],"dist":{"shasum":"79945686a9702f9b48810e7100528829d61d4554","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/postcss-message-helpers/-/postcss-message-helpers-1.0.0.tgz","integrity":"sha512-7rWTQpP+4rTWST1xGpxeSRpfU2Yi1YY2DRcK6wkqHEQXGiu5yCau/dsLUxFJskiJ8ruRGDUCxJtgYQTfWGx+6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6RK6KHO9RqqKpOKqlHwp6PJHp62RsXmf8DwkmMA6W7AiBjw3NwpI0N/nkE58cKpM2tJ31HuXVjBPcPrrGekVIWAg=="}]},"directories":{}},"1.1.0":{"name":"postcss-message-helpers","version":"1.1.0","description":"PostCSS helpers to throw or output GNU style messages","keywords":["css","postcss","postcss-plugins","messages","error","warning"],"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"https://github.com/postcss/postcss-message-helpers.git"},"files":["CHANGELOG.md","LICENSE","index.js"],"devDependencies":{"jscs":"^1.6.2","jshint":"^2.5.6","postcss":"^3.0.0","tape":"^3.0.0"},"scripts":{"lint":"jscs *.js **/*.js && jshint . --exclude-path .gitignore","test":"npm run lint && tape test"},"gitHead":"acb523ad595323ce453ae5e1a97e1893ec758534","bugs":{"url":"https://github.com/postcss/postcss-message-helpers/issues"},"homepage":"https://github.com/postcss/postcss-message-helpers","_id":"postcss-message-helpers@1.1.0","_shasum":"689d4195b2348896ccbb4d0e4d006b1f18ee08d6","_from":".","_npmVersion":"2.1.6","_nodeVersion":"0.10.33","_npmUser":{"name":"anonymous","email":"m@moox.io"},"maintainers":[{"name":"anonymous","email":"m@moox.io"}],"dist":{"shasum":"689d4195b2348896ccbb4d0e4d006b1f18ee08d6","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/postcss-message-helpers/-/postcss-message-helpers-1.1.0.tgz","integrity":"sha512-9LQxYkaFfWQIEF0HXq1FCqDpv/sP37Z04YS+QEheNz/tnsM2XoMz9xs42oCvAh5Xf0ZXUIfH6RY0kswAZS5CIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHV93D8MwTisT0zzwkTanoKcD4wuN1DCc3r1dh1MM7C7AiAuImK/sq1TkIbSqyb9vPxCbJYDlHl/+oTonE9lRSX8DQ=="}]},"directories":{}},"1.1.1":{"name":"postcss-message-helpers","version":"1.1.1","description":"PostCSS helpers to throw or output GNU style messages","keywords":["css","postcss","postcss-plugins","messages","error","warning"],"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"https://github.com/MoOx/postcss-message-helpers.git"},"files":["CHANGELOG.md","LICENSE","index.js"],"devDependencies":{"jscs":"^1.6.2","jshint":"^2.5.6","postcss":"^3.0.0","tape":"^3.0.0"},"scripts":{"lint":"jscs *.js **/*.js && jshint . --exclude-path .gitignore","test":"npm run lint && tape test"},"gitHead":"e93bbce620eccd78ca0ab251514e831eeca0e507","bugs":{"url":"https://github.com/MoOx/postcss-message-helpers/issues"},"homepage":"https://github.com/MoOx/postcss-message-helpers","_id":"postcss-message-helpers@1.1.1","_shasum":"ce857447ae58c8ec1087e0d4abf0982ab4fdeaa2","_from":".","_npmVersion":"2.1.6","_nodeVersion":"0.10.33","_npmUser":{"name":"anonymous","email":"m@moox.io"},"maintainers":[{"name":"anonymous","email":"m@moox.io"}],"dist":{"shasum":"ce857447ae58c8ec1087e0d4abf0982ab4fdeaa2","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/postcss-message-helpers/-/postcss-message-helpers-1.1.1.tgz","integrity":"sha512-q9dKdjOU3vasjfhl0uSjuzeRSRkK9Wr4PB/eghS9yV6rGvmRkLcCe7EaaKtoy6QewdjWepoD8J6CSNaUTUWc4w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG973NjjYeD4EpORWXS6ew4As6XmwWdhhgNGF3E7Vy3VAiB3LJdtyJE1jSdEArqA36KIcgLkvI8MewJAnQ6ffoTstw=="}]},"directories":{}},"2.0.0":{"name":"postcss-message-helpers","version":"2.0.0","description":"PostCSS helpers to throw or output GNU style messages","keywords":["css","postcss","postcss-plugins","messages","error","warning"],"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"https://github.com/MoOx/postcss-message-helpers.git"},"files":["CHANGELOG.md","LICENSE","index.js"],"devDependencies":{"jscs":"^1.6.2","jshint":"^2.5.6","postcss":"^4.0.2","tape":"^3.0.0"},"scripts":{"lint":"jscs *.js **/*.js && jshint . --exclude-path .gitignore","test":"npm run lint && tape test"},"gitHead":"5f9d44c18e0aba563ac13550617378b69a4f9744","bugs":{"url":"https://github.com/MoOx/postcss-message-helpers/issues"},"homepage":"https://github.com/MoOx/postcss-message-helpers","_id":"postcss-message-helpers@2.0.0","_shasum":"a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"anonymous","email":"m@moox.io"},"maintainers":[{"name":"anonymous","email":"m@moox.io"}],"dist":{"shasum":"a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz","integrity":"sha512-tPLZzVAiIJp46TBbpXtrUAKqedXSyW5xDEo1sikrfEfnTs+49SBZR/xDdqCiJvSSbtr615xDsaMF3RrxS2jZlA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNADIc7iPGefhQvhJfAGPIovCgaKP2t+DDCgoxboeJQAiBmVJpLz4TqMFfRCwottdMcKK0c3MepbwZuYbdxU7scgQ=="}]},"directories":{}}},"name":"postcss-message-helpers","time":{"modified":"2022-11-30T11:35:12.001Z","created":"2014-11-24T18:36:15.264Z","1.0.0":"2014-11-24T18:36:15.264Z","1.1.0":"2014-11-24T19:30:48.115Z","1.1.1":"2014-11-25T09:02:02.488Z","2.0.0":"2015-01-26T07:19:53.112Z"},"readmeFilename":"README.md","homepage":"https://github.com/MoOx/postcss-message-helpers"}