{"_id":"postcss-message-helpers","_rev":"87362","name":"postcss-message-helpers","description":"PostCSS helpers to throw or output GNU style messages","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"semigradsky","email":"semigradskyd@gmail.com"}],"time":{"modified":"2021-06-03T10:28:23.000Z","created":"2014-11-24T18:36:15.264Z","2.0.0":"2015-01-26T07:19:53.112Z","1.1.1":"2014-11-25T09:02:02.488Z","1.1.0":"2014-11-24T19:30:48.115Z","1.0.0":"2014-11-24T18:36:15.264Z"},"users":{},"author":{"name":"Maxime Thirouin"},"repository":{"type":"git","url":"https://github.com/MoOx/postcss-message-helpers.git"},"versions":{"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":"moox","email":"m@moox.io"},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"semigradsky","email":"semigradskyd@gmail.com"}],"dist":{"shasum":"a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e","size":2891,"noattachment":false,"key":"/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-message-helpers/download/postcss-message-helpers-2.0.0.tgz"},"directories":{},"publish_time":1422256793112,"_cnpm_publish_time":1422256793112,"_hasShrinkwrap":false},"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":"moox","email":"m@moox.io"},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"semigradsky","email":"semigradskyd@gmail.com"}],"dist":{"shasum":"ce857447ae58c8ec1087e0d4abf0982ab4fdeaa2","size":2810,"noattachment":false,"key":"/postcss-message-helpers/-/postcss-message-helpers-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-message-helpers/download/postcss-message-helpers-1.1.1.tgz"},"directories":{},"publish_time":1416906122488,"_cnpm_publish_time":1416906122488,"_hasShrinkwrap":false},"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":"moox","email":"m@moox.io"},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"semigradsky","email":"semigradskyd@gmail.com"}],"dist":{"shasum":"689d4195b2348896ccbb4d0e4d006b1f18ee08d6","size":2718,"noattachment":false,"key":"/postcss-message-helpers/-/postcss-message-helpers-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-message-helpers/download/postcss-message-helpers-1.1.0.tgz"},"directories":{},"publish_time":1416857448115,"_cnpm_publish_time":1416857448115,"_hasShrinkwrap":false},"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":"moox","email":"m@moox.io"},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"semigradsky","email":"semigradskyd@gmail.com"}],"dist":{"shasum":"79945686a9702f9b48810e7100528829d61d4554","size":2521,"noattachment":false,"key":"/postcss-message-helpers/-/postcss-message-helpers-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-message-helpers/download/postcss-message-helpers-1.0.0.tgz"},"directories":{},"publish_time":1416854175264,"_cnpm_publish_time":1416854175264,"_hasShrinkwrap":false}},"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","_attachments":{},"homepage":"https://github.com/MoOx/postcss-message-helpers","bugs":{"url":"https://github.com/MoOx/postcss-message-helpers/issues"},"license":"MIT"}