# libmq

> A simple media query library for web browsers.

Latest version **0.1.5** (published 2019-09-19) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2019-09-19 |
| First published | 2019-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | soulofmischief |
| Maintainers | soulofmischief |
| Keywords | media query, node, browser |

## Links

- npm: https://www.npmjs.com/package/libmq
- Repository: https://github.com/soulofmischief/libmq
- npm.io page: https://npm.io/package/libmq

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2019-09-19
- 0.1.4 — 2019-09-13
- 0.1.3 — 2019-09-13
- 0.1.2 — 2019-09-13
- 0.1.1 — 2019-09-13
- 0.1.0 — 2019-09-13

## README

# libmq
A simple Javascript media query library for web browsers.

[![coverage](https://img.shields.io/codecov/c/github/soulofmischief/libmq/master.svg?style=flat-square)](http://codecov.io/gh/soulofmischief/libmq?branch=master)
[![size](https://img.shields.io/bundlephobia/min/libmq.svg?style=flat-square)](https://www.npmjs.com/package/libmq)

## Install

```$ npm install libmq --save```

## About

This module runs media queries on either the window's width/height or a provided value. 

## Example

```js
import { query, screenWidths as w } from 'libmq'

if ( query.desktopUp()) 
  console.log( `Width is at least ${ w.desktopUp }`)

else if ( query.phoneOnly())
  console.log( `Width is no more than ${ w.phoneOnly }`)

if ( query.desktopUp( w.bigDesktopUp ))
  console.log( "This module isn't broken." )

```

## API

Each method tests window.innerWidth or a provided value against the following conditions:

* bigDesktopUp() - Above 1800px
* desktopUp() - Above 1200px
* phoneOnly() - Below 599px
* tabletPortraitDown() - Below 899px
* tabletPortraitUp() - Above 600px
* tabletLandscapeDown() - Below 899px
* tabletLandscapeUp() - Above 600px
* landscape() - Greater than or equal to window.innerHeight
* portrait() - Less than window.innerHeight

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