<commit_before># checkMQ

[![Build Status](https://travis-ci.org/jonnyhaynes/checkmq.svg?branch=master)](https://travis-ci.org/jonnyhaynes/checkmq) [![Code Climate](https://codeclimate.com/github/jonnyhaynes/checkmq/badges/gpa.svg)](https://codeclimate.com/github/jonnyhaynes/checkmq) [![Bower](https://img.shields.io/bower/v/checkmq.svg)](https://github.com/jonnyhaynes/checkmq) [![Dependency Status](https://david-dm.org/jonnyhaynes/checkmq.svg)](https://david-dm.org/jonnyhaynes/checkmq) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jonnyhaynes/checkmq?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

This project uses [matchMedia](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) event listeners to provide you with access to media queries in Javascript as you would in CSS.

## Usage

First you need to add your function to the checkMQ `theFunctions` array like so:

```javascript
checkMQ.addFunction(myFunction);
```

**N.B.** This is best done in some form of document ready and needs to be called after the function.

Then you can check against your specified media queries in your function like so:

```javascript
var myFunction = function(theMQ) {

  var whichMQ;

  if (theMQ === 'mqCore') {
    // functions for core media query
    whichMQ = 'mqCore';
  } else if (theMQ === 'mq600') {
    // functions for the 600 media query
    whichMQ = 'mq600';
  } else if ((theMQ === 'mq960') || (theMQ === 'mq1200')) {
    // functions for the 960 and 1200 media queries<commit_msg>Adding npm badge<commit_after># checkMQ

[![Build Status](https://travis-ci.org/jonnyhaynes/checkmq.svg?branch=master)](https://travis-ci.org/jonnyhaynes/checkmq) [![Code Climate](https://codeclimate.com/github/jonnyhaynes/checkmq/badges/gpa.svg)](https://codeclimate.com/github/jonnyhaynes/checkmq) [![npm](https://img.shields.io/npm/v/npm.svg)](https://www.npmjs.com/package/checkmq) [![Bower](https://img.shields.io/bower/v/checkmq.svg)](https://github.com/jonnyhaynes/checkmq) [![Dependency Status](https://david-dm.org/jonnyhaynes/checkmq.svg)](https://david-dm.org/jonnyhaynes/checkmq) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jonnyhaynes/checkmq?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

This project uses [matchMedia](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) event listeners to provide you with access to media queries in Javascript as you would in CSS.

## Usage

First you need to add your function to the checkMQ `theFunctions` array like so:

```javascript
checkMQ.addFunction(myFunction);
```

**N.B.** This is best done in some form of document ready and needs to be called after the function.

Then you can check against your specified media queries in your function like so:

```javascript
var myFunction = function(theMQ) {

  var whichMQ;

  if (theMQ === 'mqCore') {
    // functions for core media query
    whichMQ = 'mqCore';
  } else if (theMQ === 'mq600') {
    // functions for the 600 media query
    whichMQ = 'mq600';
  } else if ((theMQ === 'mq960') || (theMQ === 'mq1200')) {
    // functions for the 960 and 1200 media queries
{'fraction_non_alphanumeric': 0.15474314528837063, 'fraction_numerical': 0.01575795776867318, 'mean_word_length': 4.75, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 24, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '551326', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1040, 'n_words': 248}