{"_id":"css-mediaquery","_rev":"12-328875d7197ba1c0afc9a5d86f9bbca8","name":"css-mediaquery","description":"Parses and determines if a given CSS Media Query matches a set of values.","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.0":{"name":"css-mediaquery","version":"0.0.0","description":"Parses and determines if a given CSS Media Query matches a set of values.","main":"index.js","scripts":{"test":"node_modules/.bin/mocha -R spec"},"repository":{"type":"git","url":"git://github.com/ericf/css-media-match.git"},"keywords":["css","media","query","parse","match"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"license":"BSD","bugs":{"url":"https://github.com/ericf/css-media-match/issues"},"homepage":"https://github.com/ericf/css-media-match","devDependencies":{"mocha":"~1.16.2","chai":"~1.8.1"},"_id":"css-mediaquery@0.0.0","dist":{"shasum":"a02506690a519ecf1a7350514a29000b63bcef28","tarball":"https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.0.0.tgz","integrity":"sha512-EFGZyKZ395pWMtEutobsPwqhTcjJcl0MXVMX41vJ78wW7iexWVdZFylUKCXLO4bJdKrkgSVF+ZvJXJTNZGC0pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKul5Zyz2nyzO428zqCsZmBUBPXi3RifVLH+zVxrVF1AIhAILtv4vc38vpcxqW52Ko5lDu60WGp5YVOW7+jMkjTmBt"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{}},"0.1.0":{"name":"css-mediaquery","version":"0.1.0","description":"Parses and determines if a given CSS Media Query matches a set of values.","main":"index.js","scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/ --reporter spec"},"repository":{"type":"git","url":"git://github.com/ericf/css-mediaquery.git"},"keywords":["css","media","query","mediaquery","mobile","parse","match"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"contributors":[{"name":"Tilo Mitra","email":"tilomitra@gmail.com"}],"license":"BSD","bugs":{"url":"https://github.com/ericf/css-mediaquery/issues"},"homepage":"https://github.com/ericf/css-mediaquery","devDependencies":{"mocha":"~1.16.2","chai":"~1.8.1","istanbul":"~0.2.3"},"_id":"css-mediaquery@0.1.0","dist":{"shasum":"d5f3a606fa091701c196854af3269a73c7eb3acf","tarball":"https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.0.tgz","integrity":"sha512-EslyFH0vfjywDpI8M6J7yPsVBX0rXLSuOlWIky995MTIbYQQON+BCF0kjBbwPZIOdYUEsBpYT+fvK69UYr8lOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJOK4S/PQjuOIjNhX3Y3iM677SWDyGALnPgWVsdoqBSQIgPKeQIXQNR9F7ecin0clr3knfWD9VHqbxklzBQZO8Kds="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{}},"0.1.1":{"name":"css-mediaquery","version":"0.1.1","description":"Parses and determines if a given CSS Media Query matches a set of values.","main":"index.js","scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/ --reporter spec"},"repository":{"type":"git","url":"git://github.com/ericf/css-mediaquery.git"},"keywords":["css","media","query","mediaquery","mobile","parse","match"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"contributors":[{"name":"Tilo Mitra","email":"tilomitra@gmail.com"}],"license":"BSD","bugs":{"url":"https://github.com/ericf/css-mediaquery/issues"},"homepage":"https://github.com/ericf/css-mediaquery","devDependencies":{"mocha":"~1.16.2","chai":"~1.8.1","istanbul":"~0.2.3"},"_id":"css-mediaquery@0.1.1","dist":{"shasum":"7a72f5bb6e59d474a410c02f8b86ab88647a1c92","tarball":"https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.1.tgz","integrity":"sha512-i02CqWZvFQzuz239ZwJPqbzt/BpAMKq/hyf3dtfTBuKiRBQQJkU1KZEwIi7R4aAhonazv3q3uPDk0E6knaxW7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDHdj9gCTrmNZRkfz/vJnvH04RPtskfHc67mHtIjNM6IAiEAlYERQoiRJFUrHH2aDKaYIC17GKwPudZ28hUiEbJMxuM="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{}},"0.1.2":{"name":"css-mediaquery","version":"0.1.2","description":"Parses and determines if a given CSS Media Query matches a set of values.","main":"index.js","scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/ --reporter spec"},"repository":{"type":"git","url":"git://github.com/ericf/css-mediaquery.git"},"keywords":["css","media","query","mediaquery","mobile","parse","match"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"contributors":[{"name":"Tilo Mitra","email":"tilomitra@gmail.com"}],"license":"BSD","bugs":{"url":"https://github.com/ericf/css-mediaquery/issues"},"homepage":"https://github.com/ericf/css-mediaquery","devDependencies":{"mocha":"~1.16.2","chai":"~1.8.1","istanbul":"~0.2.3"},"_id":"css-mediaquery@0.1.2","dist":{"shasum":"6a2c37344928618631c54bd33cedd301da18bea0","tarball":"https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz","integrity":"sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwoDp/vUP33kR977iGwe8rdZwIkzigKAeJvvKJbcQFygIgBBTc/9NxprpBTUWHr5oewoCVK4Y/uh90leaTDFPTOY0="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}]}},"readme":"CSS Media Query\n===============\n\n[![Build Status](https://travis-ci.org/ericf/css-mediaquery.png?branch=master)](https://travis-ci.org/ericf/css-mediaquery)\n[![Dependency Status](https://gemnasium.com/ericf/css-mediaquery.png)](https://gemnasium.com/ericf/css-mediaquery)\n[![npm Version](https://badge.fury.io/js/css-mediaquery.png)](https://npmjs.org/package/css-mediaquery)\n\nParses and determines if a given CSS Media Query matches a set of values via\nJavaScript.\n\nInstallation\n------------\n\nInstall via npm:\n\n```shell\n$ npm install css-mediaquery\n```\n\nUsage\n-----\n\nThis package has two exports: `parse()`, and `match()` which can parse CSS Media\nQueries and determine if a media query matches a given set of values.\n\n### Matching\n\nThe `match()` method lets you compare a media query expression with a JavaScript\nobject and determine if a media query matches a given set of values.\n\n```javascript\nvar mediaQuery = require('css-mediaquery');\n\nvar isMatch = mediaQuery.match('screen and (min-width: 40em)', {\n    type : 'screen',\n    width: '1024px'\n});\n\nconsole.log(isMatch); // => true\n```\n\nThe values specified to check a media query string against should be thought of\nas if they are the current state of a device/browser. A `type` value _must_ be\nspecified, and it can _not_ be `\"all\"`.\n\n### Parsing\n\nExisting CSS Parsers don't do a great job at parsing the details of media\nqueries. That's where `css-mediaquery` shines. You can parse a media query\nexpression and get an AST back by using the `parse()` method.\n\n```javascript\nvar mediaQuery = require('css-mediaquery'),\n    ast        = mediaQuery.parse('screen and (min-width: 48em)');\n```\n\nThe `ast` variable will have the following payload:\n\n```javascript\n[\n    {\n        inverse: false,\n        type   : 'screen',\n\n        expressions: [\n            {\n                modifier: 'min',\n                feature : 'width',\n                value   : '48em'\n            }\n        ]\n    }\n]\n```\n\nThis package was written with care to following the W3C Recommendations for\n[CSS3 Media Queries][w3c-mq] and [CSS3 Values and Units][w3c-vu]. It supports\nall of the [Media Features][w3c-mq-features] and will properly convert values to\na common unit before comparing them.\n\n\n[w3c-mq]: http://www.w3.org/TR/css3-mediaqueries/\n[w3c-mq-features]: http://www.w3.org/TR/css3-mediaqueries/#media1\n[w3c-vu]: http://www.w3.org/TR/css3-values/\n\n\nLicense\n-------\n\nThis software is free to use under the Yahoo! Inc. BSD license.\nSee the [LICENSE file][] for license text and copyright information.\n\n\n[LICENSE file]: https://github.com/ericf/css-mediaquery/blob/master/LICENSE\n","maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"time":{"modified":"2022-06-14T04:42:16.063Z","created":"2014-01-08T20:29:13.439Z","0.0.0":"2014-01-08T20:29:14.300Z","0.1.0":"2014-01-09T03:59:45.460Z","0.1.1":"2014-01-09T04:29:50.732Z","0.1.2":"2014-01-21T18:39:10.562Z"},"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"repository":{"type":"git","url":"git://github.com/ericf/css-mediaquery.git"},"readmeFilename":"README.md"}