{"library":"methods","title":"HTTP Methods List","description":"The `methods` package, currently at version 1.1.2, provides a normalized, lower-cased array of HTTP method names supported by the Node.js runtime. This module serves as a robust alternative or enhancement to Node.js core's `http.METHODS`, especially for environments requiring broader compatibility. Its key differentiators include automatically lower-casing all method names for consistent usage and offering a fallback list for older Node.js versions (0.10 and below) that predate the `http.METHODS` export. Furthermore, it's designed to function seamlessly with browser bundling tools like Browserify without inadvertently pulling in the larger `http` shim module, making it lightweight for client-side use cases where a list of standard HTTP verbs is needed. The package is very stable, with infrequent updates, reflecting its foundational role and mature status within the Node.js ecosystem, particularly as a utility for web frameworks like Express.","language":"javascript","status":"maintenance","last_verified":"Sun Apr 19","install":{"commands":["npm install methods"],"cli":null},"imports":["const methods = require('methods')","import methods from 'methods'","const METHODS_ARRAY = require('methods')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const methods = require('methods');\n\nconsole.log('Supported HTTP methods (lower-cased):');\nmethods.forEach(method => {\n  console.log(`- ${method.toUpperCase()}`);\n});\n\n// Example: Check if a method is supported\nconst isSupported = (method) => methods.includes(method.toLowerCase());\nconsole.log('\\nIs GET supported?', isSupported('GET'));\nconsole.log('Is TRACE supported?', isSupported('TRACE'));\nconsole.log('Is INVALID supported?', isSupported('INVALID'));","lang":"javascript","description":"Demonstrates how to import the `methods` array and iterate through the supported HTTP verbs. It also shows a simple function to check if a specific HTTP method is included in the list.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}