# json2mq

> Generate media query string from JSON or javascript object

Latest version **0.2.0** (published 2015-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install json2mq
pnpm add json2mq
yarn add json2mq
bun add json2mq
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-01-15 |
| First published | 2014-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/json2mq) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 168 |
| Author | Kiran Abburi |
| Maintainers | akiran |

## Links

- npm: https://www.npmjs.com/package/json2mq
- Repository: https://github.com/akiran/json2mq
- Issues: https://github.com/akiran/json2mq/issues
- npm.io page: https://npm.io/package/json2mq

## Dependencies (1)

- [string-convert](https://npm.io/package/string-convert.md) ^0.2.0

## Recent versions

- 0.2.0 (latest) — 2015-01-15
- 0.1.0 — 2014-11-22

## README

# json2mq

json2mq is used to generate media query string from JSON or javascript object.

## Install
    npm install json2mq
    
## Usage
```javascript
var json2mq = require('json2mq');
json2mq({minWidth: 100, maxWidth: 200});
// -> '(min-width: 100px) and (max-width: 200px)'
```
* Media type 
```javascript
json2mq({screen: true});  // -> 'screen'
```
* Media type with negation 
```javascript
json2mq({handheld: false});  // -> 'not handheld'
```

* Media features can be specified in camel case
```javascript
json2mq({minWidth: 100, maxWidth: 200});
// -> '(min-width: 100px) and (max-width: 200px)'
```
* px is added to numeric dimension values
```javascript
json2mq({minWidth: 100, maxWidth: '20em'});
// -> '(min-width: 100px) and (max-width: 20em)'
```
* Multiple media queries can be passed as an array
```javascript
json2mq([{screen: true, minWidth: 100}, {handheld: true, orientation: 'landscape'}]); 
// -> 'screen and (min-width: 100px), handheld and (orientation: landscape)'
```



## Contributors

* Eric Schoffstall

---
_Source: https://npm.io/package/json2mq · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
