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

http-request-method-db

v1.0.4

Published

HTTP Request Method Database

Downloads

19

Readme

HTTP Request Method Database

NPM

NPM Version license Donate to this project using Paypal

This is a database of known HTTP Request Methods and information about them. It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources:

  • https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
  • https://www.iana.org/assignments/http-methods/http-methods.xhtml

Installation

npm i --save http-request-method-db

Database Download

If you want download the database and use it directly in the browser, you can just grab the JSON file using jsDelivr. It is recommended to replace main with a release tag as the JSON format may change in the future.

https://cdn.jsdelivr.net/gh/pichillilorenzo/http-request-method-db@main/dist/db.json

Usage

import db from 'http-request-method-db';
// .. or
const db = require('http-request-method-db').default;

const getInfo = db['get']; // An instance of HTTPRequestMethod
console.log(getInfo.syntax); // GET /index.html

Access HTTP Request Method info using the request method name in lower case as key.

Contributing

The primary way to contribute to this database is by updating the data in one of the upstream sources. Check the scripts/src/mdn-scraper.ts to check the MDN scraper implementation.

Direct Inclusion

If that is not possible / feasible, they can be added directly here as a "custom" request method.

To edit the database, only make PRs against scripts/src/custom-request-methods.json.

The scripts/src/custom-request-methods.json file is a JSON object of type HTTPRequestMethodDb, where each key is the request method name in lower case and the value is an Object of type HTTPRequestMethod.

To update the build, run npm run build:all.

HTTPRequestMethodDb Data Structure Example

{
  "connect": {...},
  "get": {
    "name": "GET",
    "description": "The HTTP GET method requests a representation of the specified resource. Requests using GET should only be used to request data (they shouldn't include data). Note: Sending body/payload in a GET request may cause some existing implementations to reject the request — while not prohibited by the specification, the semantics are undefined. It is better to just avoid sending payloads in GET requests.",
    "note": "Note: Sending body/payload in a GET request may cause some existing implementations to reject the request — while not prohibited by the specification, the semantics are undefined. It is better to just avoid sending payloads in GET requests.",
    "syntax": "GET /index.html",
    "link": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET",
    "requestHasBody": false,
    "successfulResponseHasBody": true,
    "safe": true,
    "idempotent": true,
    "cacheable": true,
    "examples": [],
    "specifications": [
      {
        "name": "HTTP Semantics # GET",
        "link": "https://httpwg.org/specs/rfc9110.html#GET"
      }
    ],
    "browserCompatibility": [
      {
        "name": "Chrome",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Edge",
        "supported": true,
        "version": "12"
      },
      {
        "name": "Firefox",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Opera",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Safari",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Chrome Android",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Firefox for Android",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Opera Android",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Safari on iOS",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Samsung Internet",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "WebView Android",
        "supported": true,
        "version": "Yes"
      }
    ]
  },
  "head": {...},
  ...
}

Check HTTPRequestMethodDb for more details.

License

Released under the ISC license.

This project is strongly inspired by the mime-db.