Rules related to checking if the the page is optimised and compatible for mobile devices
Last updated 2 years ago by passmarked .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @passmarked/mobile 
SYNC missed versions from official npm registry.


NPM Build Status

Passmarked is a suite of tests that can be run against any page/website to identify issues with parity to most online tools in one package.

The Terminal Client is intended for use by developers to integrate into their workflow/CI servers but also integrate into their own application that might need to test websites and provide realtime feedback.

All of the checks on Passmarked can be voted on importance and are open-sourced, to encourage community involvement in fixing and adding new rules. We are building the living Web Standard and love any contributions.


The rules checked in this module are:

  • viewport.multiple - Multiple viewport meta tags found
  • viewport.empty - The viewport found the website is empty
  • viewport.content - The viewport is expected to contain at least: width=device-width and initial-scale=1 to ensure correct scaling for responsive sites.
  • viewport.size - Off-screen rendering that was detected due to not staying loyal to the given viewport of the device.
  • target.size - Small tap target size on a anchor will make it hard for users to click
  • amp.charset - The charset was not given or not the first element in the <head> section
  • amp.head - The document is missing a <head> section
  • amp.body - The document is missing a <body> section
  • amp.script - The script for AMP is missing, and should only be defined as the last item in the head
  • amp.async - The AMP was not configured as async, <script async

The validator is used on the page itself which can produce a large list of rules, all of which are dynamic. The module produces these rules with a key that is created from the categorised key which is then slugged. See passmarked.com/library/compatibility/mobile for a list of rules that have been found and generated during the process of testing a large number of sites.


The rules are checked everytime a url is run through Passmarked or our API. To run using the hosted system head to passmarked.com or our Terminal Client use:

npm install -g passmarked
passmarked --filter=mobile example.com

The hosted version allows free runs from our homepage and the option to register a site to check in its entirety.

Using the Passmarked npm module (or directly via the API) integrations are also possible to get running reports with all the rules in a matter of seconds.

Running Locally

All rules can be run locally using our main integration library. This requires installing the package and any dependencies that the code might have such as a specific version of OpenSSL, see #dependencies

First ensure passmarked is installed:

npm install passmarked
npm install @passmarked/mobile

After which the rules will be runnable using promises:

  require('@passmarked/mobile'), // this package
  require('@passmarked/ssl'), // to test SSL
  require('@passmarked/network') // to test network performance
  url: 'http://example.com',
  body: 'body of page here',
  har: {log: {entries: []}}
}).then(function(payload) {
  if (payload.hasRule('secure')) {
    console.log('better check that ...');
  var rules = payload.getRules();
  for (var rule in rules) {
    console.log('*', rules[rule].getMessage());

Alternatively, callbacks are also available:

  url: 'http://example.com',
  body: 'body of page here',
  har: {log: {entries: []}}
}, function(err, payload) {
  if (payload.hasRule('secure')) {
    console.log("better check that ...");
  var rules = payload.getRules();
  for (var rule in rules) {
    console.log('*', rules[rule].getMessage());


This module does not need any specific external services or packages. This section will be updated if that ever changes with detailed setup steps and links for downloads.


Rules represent checks that occur in this module, all of these rules have a UID which can be used to check for specific rules. For the structure and more details see the Wiki page on Rules.

Rules also include a type which could be critical, error, warning or notice giving a better view on the importance of the rule.


git clone git@github.com:passmarked/mobile.git
npm install
npm test

Pull requests have a prerequisite of passing tests. If your contribution is accepted, it will be merged into develop (and then master after staging tests by the team) which will then be deployed live to passmarked.com and on NPM for everyone to download and test.


To learn more visit:


Copyright 2016 Passmarked Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at


Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Current Tags

  • 1.0.4                                ...           latest (2 years ago)

4 Versions

  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (1)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |