Git Product home page Git Product logo

appmanifest's Introduction

appmanifest

Validate web app manifest (http://w3c.github.io/manifest)

* Tries to follow the Spec as it is (as much as possible)

Try it online -

https://boopathi.in/appmanifest/

This project is still under active development. Ideas and contributions welcome :)

Install

npm install appmanifest

Usage

API

// result is the processed manifest object
var result = manifestParser({
  manifest: "<manifest json string>",
  manifestUrl: "https://example.com/manifest.json", // this is required to validate some urls
  documentUrl: "https://example.com/" // this is also required to validate some urls
  logger: function() { return { warn() {}, error(){}, log(){} } } // optional
});

If you don't want to pass manifestUrl and documentUrl, just use example.com urls as mentioned above.

Capture errors and warnings

You can pass your custom logger and capture all errors and warnings to compile and display later. The signature of the logger function is this.

function Logger (name /* name of the param currently validated */) {
  return {
    warn(message) {
      // do your stuff
    },
    error (message) {
      // do your stuff
    },
    log (message) {
      // do your stuff
    }
  }
}

Node

const parse = require('appmanifest').manifestParser;

Browser

  1. You can bundle this with webpack / browserify
  2. Generate your dist - npm run dist
  3. Get it from CDN - https://unpkg.com/appmanifest@latest/dist/manifest-parser.min.js

The library when obtained as a built bundle, exports UMD with ManifestParser as the name.

Note:

If you're using the cdn URL, you need to use ManifestParser.default({});

Features

Processing

Spec: http://w3c.github.io/manifest/#processing

This helps in identifying possible mistakes in your manifest.json file in the following fields.

  • start_url
  • display
  • orientation
  • name
  • lang
  • short_name
  • icons
  • splash_screens
  • scope
  • related_applications
  • prefer_related_applications
  • theme_color
  • background_color

* The unchecked ones are not yet implemented

Installability Signals

Spec: http://w3c.github.io/manifest/#installability-signals

This tool is to identify from a URL, warnings about some of your app installability signals - to make it more installable - Does it even mean anything? Yes. It's a thing now. Live with it.

  • link associativity with manifest & contains at least name and a suitable icon
  • Served over HTTPS
  • CSP

* The unchecked ones are not yet implemented

Note: There are a few others that cannot be checked with this tool. Feel free to visit the link mentioned above to help making your manifests better and give the browser possible installability signals.

CONTRIBUTING

Contributions and ideas are always welcome. Create an issue to discuss.

Build

License

MIT License - http://boopathi.mit-license.org/

appmanifest's People

Contributors

boopathi avatar npmcdn-to-unpkg-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  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.