Giter VIP home page Giter VIP logo

js's Introduction

Javascript API

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.

Installing

To install just add the library as part of your HTML:

<script src="//jsapi.passmarked.com/v1.js"></script>

The page will now have a global passmarked object that can be used

Running a report with the API

/**
* Create a report
**/
var report = passmarked.create({

  url:    'http://example.com',
  token:  '<token-here>'

});

/**
* Start the report
**/
report.start(function(err, code) {

  if(err) {
  
    /** Something with the network went terribly wrong **/
  
  } else if(code) {
  
    /** Validation code returned **/
    
  }

});

/**
* Listen when the report is done
**/
report.on('done', function() {

  // get the data
  var page = report.getResult();
  
  // output done !
  console.log('Page scored ' + page.getScore() + '!');
  
  // get the screenshot
  console.log('preview of desktop: ' + page.getPreview('desktop'));
  
  // check if a certain rule is broken
  if(page.hasRule('heartbleed')) {
  
    // output that the server is in trouble ...
    console.log('Server is vunerable to HeartBleed !');
  
  }

});

Rules

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.

See passmarked.com/library for all the rules.

Contributing

git clone [email protected]:passmarked/js.git
npm install
gulp build / gulp watch

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.

About

To learn more visit:

License

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

http://www.apache.org/licenses/LICENSE-2.0

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.

js's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.