{"_id":"postcss-helpers","_rev":"3670277","name":"postcss-helpers","description":"Some general purpose helpers for PostCSS, created to make working with url() and @import values more easy.","dist-tags":{"latest":"0.3.3"},"maintainers":[{"name":"iadramelk","email":""}],"time":{"modified":"2025-02-13T05:40:54.000Z","created":"2014-08-13T15:44:14.390Z","0.3.3":"2023-05-18T10:05:46.325Z","0.3.2":"2017-08-30T21:46:53.909Z","0.3.1":"2015-12-20T18:09:37.712Z","0.3.0":"2015-12-20T17:51:17.101Z","0.2.0":"2014-08-13T15:44:14.390Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/iAdramelk/postcss-helpers.git"},"versions":{"0.3.3":{"name":"postcss-helpers","description":"Some general purpose helpers for PostCSS, created to make working with url() and @import values more easy.","version":"0.3.3","main":"index.js","repository":{"type":"git","url":"git+https://github.com/iAdramelk/postcss-helpers.git"},"authors":["Alexey Ivanov <iadramelk@gmail.com>"],"license":"MIT","engines":{"node":">=0.12.9"},"scripts":{"test":"mocha --reporter list"},"keywords":["postcss"],"dependencies":{"urijs":"^1.18.12"},"devDependencies":{"mocha":"^3.5.0"},"gitHead":"5b076a918ff0a49ca4b9a54392122486cfa42341","bugs":{"url":"https://github.com/iAdramelk/postcss-helpers/issues"},"homepage":"https://github.com/iAdramelk/postcss-helpers#readme","_id":"postcss-helpers@0.3.3","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"shasum":"1163187ef4593eec423db8d379f2940e90876534","size":6236,"noattachment":false,"key":"/postcss-helpers/-/postcss-helpers-0.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-helpers/download/postcss-helpers-0.3.3.tgz"},"_npmUser":{"name":"iadramelk","email":"mail@alexeyivanov.info"},"directories":{},"maintainers":[{"name":"iadramelk","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-helpers_0.3.3_1684404346038_0.17324319593303317"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-18T10:05:46.325Z","publish_time":1684404346325,"_source_registry_name":"default","_cnpm_publish_time":1684404346325},"0.3.2":{"name":"postcss-helpers","description":"Some general purpose helpers for PostCSS, created to make working with url() and @import values more easy.","version":"0.3.2","main":"index.js","repository":{"type":"git","url":"git+https://github.com/iAdramelk/postcss-helpers.git"},"authors":["Alexey Ivanov <iadramelk@gmail.com>"],"license":"MIT","engines":{"node":">=0.12.9"},"scripts":{"test":"mocha --reporter list"},"keywords":["postcss"],"dependencies":{"urijs":"^1.18.12"},"devDependencies":{"mocha":"^3.5.0"},"gitHead":"ba56430d3e59ef5d8b4ae87d806a0f6aae33c53f","bugs":{"url":"https://github.com/iAdramelk/postcss-helpers/issues"},"homepage":"https://github.com/iAdramelk/postcss-helpers#readme","_id":"postcss-helpers@0.3.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"iadramelk","email":"iadramelk@gmail.com"},"dist":{"shasum":"cf8721d8d6605d2577302f966afefda1fea9929c","size":8948,"noattachment":false,"key":"/postcss-helpers/-/postcss-helpers-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-helpers/download/postcss-helpers-0.3.2.tgz"},"maintainers":[{"name":"iadramelk","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-helpers-0.3.2.tgz_1504129612895_0.14119395264424384"},"directories":{},"publish_time":1504129613909,"_hasShrinkwrap":false,"_cnpm_publish_time":1504129613909,"_cnpmcore_publish_time":"2021-12-17T11:05:39.176Z"},"0.3.1":{"name":"postcss-helpers","description":"Some general purpose helpers for PostCSS, created to make working with url() and @import values more easy.","version":"0.3.1","main":"index.js","repository":{"type":"git","url":"git+https://github.com/iAdramelk/postcss-helpers.git"},"authors":["Alexey Ivanov <iadramelk@gmail.com>"],"license":"MIT","engines":{"node":">=0.12.9"},"scripts":{"test":"mocha --reporter list"},"keywords":["postcss"],"dependencies":{"urijs":"1.17"},"devDependencies":{"mocha":"2.3.4"},"gitHead":"1f433df74efdacea323fdc3710122d41f657e6b2","bugs":{"url":"https://github.com/iAdramelk/postcss-helpers/issues"},"homepage":"https://github.com/iAdramelk/postcss-helpers#readme","_id":"postcss-helpers@0.3.1","_shasum":"386d22b4ccbf08957c372715f645fecf3b9bf113","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"iadramelk","email":"iadramelk@gmail.com"},"maintainers":[{"name":"iadramelk","email":""}],"dist":{"shasum":"386d22b4ccbf08957c372715f645fecf3b9bf113","size":6486,"noattachment":false,"key":"/postcss-helpers/-/postcss-helpers-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-helpers/download/postcss-helpers-0.3.1.tgz"},"directories":{},"publish_time":1450634977712,"_hasShrinkwrap":false,"_cnpm_publish_time":1450634977712,"_cnpmcore_publish_time":"2021-12-17T11:05:39.553Z"},"0.3.0":{"name":"postcss-helpers","description":"Some general purpose helpers for PostCSS, created to make working with url() and @import values more easy.","version":"0.3.0","main":"index.js","repository":{"type":"git","url":"git+https://github.com/iAdramelk/postcss-helpers.git"},"authors":["Alexey Ivanov <iadramelk@gmail.com>"],"license":"MIT","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha --reporter list"},"keywords":["postcss"],"dependencies":{"urijs":"1.17"},"devDependencies":{"mocha":"2.3.4"},"gitHead":"d3af85eb8483adf1258955c7147f87bcbc1b1daa","bugs":{"url":"https://github.com/iAdramelk/postcss-helpers/issues"},"homepage":"https://github.com/iAdramelk/postcss-helpers#readme","_id":"postcss-helpers@0.3.0","_shasum":"eb1c79798baf3e3d4deea320e985a36902a954cd","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"iadramelk","email":"iadramelk@gmail.com"},"maintainers":[{"name":"iadramelk","email":""}],"dist":{"shasum":"eb1c79798baf3e3d4deea320e985a36902a954cd","size":6422,"noattachment":false,"key":"/postcss-helpers/-/postcss-helpers-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-helpers/download/postcss-helpers-0.3.0.tgz"},"directories":{},"publish_time":1450633877101,"_hasShrinkwrap":false,"_cnpm_publish_time":1450633877101,"_cnpmcore_publish_time":"2021-12-17T11:05:39.763Z"},"0.2.0":{"name":"postcss-helpers","description":"Some general purpose helpers for PostCSS, created to make working with url() and @import values more easy.","version":"0.2.0","main":"index.js","repository":{"type":"git","url":"https://github.com/iAdramelk/postcss-helpers.git"},"authors":["Alexey Ivanov <iadramelk@gmail.com>"],"license":"MIT","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha --reporter list"},"keywords":["postcss"],"dependencies":{"URIjs":"~1.13"},"devDependencies":{"mocha":"^1.21.4"},"gitHead":"27aeaffc7cd354c817dc85031b0063d47b76c185","bugs":{"url":"https://github.com/iAdramelk/postcss-helpers/issues"},"homepage":"https://github.com/iAdramelk/postcss-helpers","_id":"postcss-helpers@0.2.0","_shasum":"1cb8e3d0f89b7bf324b138a177ade75f1608ae58","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"iadramelk","email":"iadramelk@gmail.com"},"maintainers":[{"name":"iadramelk","email":""}],"dist":{"shasum":"1cb8e3d0f89b7bf324b138a177ade75f1608ae58","size":13786,"noattachment":false,"key":"/postcss-helpers/-/postcss-helpers-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-helpers/download/postcss-helpers-0.2.0.tgz"},"directories":{},"publish_time":1407944654390,"_hasShrinkwrap":false,"_cnpm_publish_time":1407944654390,"_cnpmcore_publish_time":"2021-12-17T11:05:39.954Z"}},"readme":"## postcss-helpers [![Build Status](https://secure.travis-ci.org/iAdramelk/postcss-helpers.png)](https://travis-ci.org/iAdramelk/postcss-helpers)\n\n> Some general purpose helpers for PostCSS, created to make working with url() and @import values more easy. Can be used without PostCSS.\n\n### Getting Started\n\n\n```shell\nnpm install postcss-helpers\n```\n\n\n### Helpers\n\n#### #createUrlsHelper( rule )\n\nReturns new UrlsHelper object from the rule string with one or more url() (see description below).\n\n#### #createImportHelper( rule )\n\nReturns new ImportHelper object from the @import value string (see description below).\n\n\n### new UrlsHelper( rule )\n\nObject for manipulating values of rules with one or multiple url().\n\n#### #getOriginalRule\n\nReturns original rule that it was created with.\n\n#### #getOriginalURIS\n\nReturns Array of all original URI in string. NOT mutated URIs.\n\n#### #URIS\n\nArray of one or more [urijs](http://medialize.github.io/URI.js/) objects that can be used for URI manipulations.  If there is no url() in the rule returns false.\n\nFor example you can use UrlsHelper.URIS[0].href() to get value for the first url() and UrlsHelper.URIS[0].href('new_uri') to set new URI value. See [full documentation](http://medialize.github.io/URI.js/docs.html).\n\n#### #getModifiedRule\n\nAfter you finished changing values of the URIS you can get modified rule text with this command.\n\n\n### new ImportHelper( rule )\n\nObject for manipulating values of @import at-rules.\n\n#### #getOriginalRule\n\nReturns original rule that it was created with.\n\n#### #getOriginalURI\n\nReturns original URI from string. NOT mutated URI.\n\n#### #URI\n\n[urijs](http://medialize.github.io/URI.js/) objects that can be used for URI manipulations. If there is no url() in the rule returns false.\n\nFor example you can use ImportHelper.URI.href() to get import value and ImportHelper.URI.href('new_uri') to set new URI value. See [full documentation](http://medialize.github.io/URI.js/docs.html).\n\n#### #getModifiedRule\n\nAfter you finished changing values of the URI you can get modified rule text with this command.\n\n#### #getOriginalMediaQuery\n\nReturns media query from original string.\n\n#### #setMediaQuery( query )\n\nReplace old media query or creates new one.\n\n#### #getMediaQuery\n\nReturns current media query from string.\n\n\n### Other\n\n#### #regexp\n\nCollection of some useful RegExps based on CSS specification grammar rules: http://www.w3.org/TR/CSS21/grammar.html\n\n  - STRINGS – RegExp for css &lt;string&gt; with 'ig' flags.\n  - URLS – RegExp for css &lt;uri&gt; with 'ig' flags.\n\n\n### Examples\n\nModify string with multiple url() fragments:\n\n```javascript\nvar helpers = require( 'postcss-helpers' );\n\nvar rule = 'url(logo1.png)', url( 'logo2.png' ), url( \"logo3.png\");\n\nvar helper = helpers.createUrlsHelper( rule );\n\nhelper.URIS.forEach( function( uri ) {\n    uri.suffix( 'jpeg' );\n} );\n\nvar modifiedRule = helper.getModifiedRule(); // url(logo1.jpeg)', url( 'logo2.jpeg' ), url( \"logo3.jpeg\")\n```\n\nModify @import value:\n\n```javascript\nvar helpers = require( 'postcss-helpers' );\n\nvar rule = '\"src/print.css\" print';\n\nvar helper = helpers.createImportHelper( rule );\n\nhelper.URI.directory( 'dist' );\nhelper.getMediaQuery(); // print\nhelper.setMediaQuery( 'screen' );\n\nvar modifiedRule = helper.getModifiedRule(); // \"dist/print.css\" screen\n```\n\nTest if string contains url() fragments:\n\n```javascript\nvar helpers = require( 'postcss-helpers' );\n\nvar rule = 'url(logo1.png)', url( 'logo2.png' ), url( \"logo3.png\");\n\nhelpers.regexp.URIS.test( rule ); // true\n```\n\n\n### Known problems\n\nUrlsHelper() and ImportHelper() will not escape quotes in the new URI values so escape them yourself.\n\n\n### Release History\n\nSee [CHANGELOG](/CHANGELOG) for detailed changes.\n\n * 2014-08-08   0.1.0   Initial release.\n * 2014-08-11   0.1.1   Make RegExps public. Fixed ?#iefix bug.\n * 2014-08-12   0.2.0   Added methods for getting original url() values and for media query manipulations.\n","_attachments":{},"homepage":"https://github.com/iAdramelk/postcss-helpers#readme","bugs":{"url":"https://github.com/iAdramelk/postcss-helpers/issues"},"license":"MIT"}