npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jbmoelker/fetch-manifest

v1.0.0

Published

Micro service to fetch the web app manifest of any website or PWA.

Downloads

5

Readme

Fetch manifest

Micro service to fetch the web app manifest of any website or PWA.

The server fetches the given webpage, finds the manifest linked on the page (link[rel="manifest"]) and returns its contents.

Demo: fetch-manifest.now.sh/?url=https://www.voorhoede.nl.

Table of contents

Requests

Parameters

The service can be configured with the following URL query parameters:

Parameter | Description | Example --- | --- | --- url (required) | URL of the web page to find and return the manifest of. | url=https://www.voorhoede.nl

Responses

Successful response

Successful responses are indicated with a 200 HTTP code and a JSON-based payload containing the manifestUrl where the web app manifest was found and the manifest itself. Example ?url=https://www.voorhoede.nl responds with:

{
  "manifestUrl": "https://www.voorhoede.nl/assets/manifest-d110dc52f9.json",
  "manifest": {
    "short_name": "De Voorhoede",
    "name": "De Voorhoede Front-end Developers",
    "start_url": "/?homescreen=true",
    "display": "standalone",
    "orientation": "portrait",
    "gcm_sender_id": "482941778795",
    "theme_color": "#12353C",
    "background_color": "#E7D81D",
    "icons": [
      {
        "src": "/assets/images/logo-256x256.png",
        "sizes": "256x256",
        "type": "image/png"
      },
      {
        "src": "/assets/images/logo-512x512.png",
        "sizes": "512x512",
        "type": "image/png"
      }
    ]
  }
}

Error response

Error responses are served with a non-200-series HTTP code and a JSON-based payload containing a list of errors. The errors/code node will indicate a CAPS_CASE constant error code you can programmatically consume to make resolution decisions from. The errors/message node provides a human-readable description of the error. Additional fields may be attached to indicate finer-grained detail about the error.

HTTP code | Error code | Extra info --- | --- | --- 400 | MISSING_PARAMETER | error.parameter contains parameter name. 404 | MISSING_MANIFEST | 405 | METHOD_NOT_ALLOWED | 500 | FETCH_ERROR | 500 | INVALID_MANIFEST |

Example:

{
  "errors": [
    {
      "code": "MISSING_PARAMETER",
      "parameter": "url",
      "message": "'url' query parameter is required.",
      "docs": "https://github.com/jbmoelker/fetch-manifest#parameters"
    }
  ]
}

Development

This project requires Node.js (>= v8) and npm (comes with Node).

After installing dependencies using npm install the following scripts are available:

npm run ... | Description ---|--- deploy | Deploys project to now and aliases latest version to https://fetch-manifest.now.sh. dev | Starts micro service with hot reloading for development on http://localhost:3000. start | Starts micro service for production on http://localhost:3000. test | Run all tests in test.js. watch | Run tests on file changes.

License

MIT licensed © Jasper Moelker