Mobile-Friendly Test API for Node.js
JavaScript
Permalink
Failed to load latest commit information.
bin init Feb 1, 2017
.editorconfig init Feb 1, 2017
.gitignore init Feb 1, 2017
.travis.yml init Feb 1, 2017
LICENSE init Feb 1, 2017
README.md Update README.md Feb 1, 2017
index.js better error catch Feb 4, 2017
package.json 1.0.1 Feb 4, 2017
test.js init Feb 1, 2017
yarn.lock init Feb 1, 2017

README.md

Build Status

Mobile-Friendly Test API for Node.js

Test how easily a visitor can use your page on a mobile device. Just enter a page URL to see how your page scores.

CLI tool and lib to gather results about mobile friendly site using Mobile-Friendly Test API IN BETA.

2 mc administrator administrators-macbook-pro local ---localproject-brunch original bash 2017-02-02 01-21-38

Install

$ npm install --global mobile-friendly
# or
$ npm install --save mobile-friendly

CLI Usage

mbfriendly http://example.com/

# --apiKey       Google API key. You don't need to specifiy this option if it's already in process.env.API_KEY
mbfriendly http://example.com/ --apiKey=my_api_key

# --json       Reports json details to stdout.
mbfriendly http://example.com/ --json

# returns... 
# {
#   "testStatus": {
#     "status": "MOBILE_FRIENDLY"
#   }
# }
#  ...


# --requestScreenshot       Request for site screenshot
mbfriendly http://example.com/ --requestScreenshot

Read more about Mobile-Friendly Test API

Get Google API key - https://developers.google.com/webmaster-tools/search-console-api/v1/configure

API

const MobileFriendly = require('mobile-friendly');

const mobileFriendly = new MobileFriendly('http://example.com/', opts);
mobileFriendly.run(); // returns Promise

License

MIT © Artem Denysov