pax_global_header00006660000000000000000000000064126470502770014524gustar00rootroot0000000000000052 comment=25d257d913f1b94bd2d73581521ff72c81469140 methods-1.1.2/000077500000000000000000000000001264705027700131705ustar00rootroot00000000000000methods-1.1.2/.gitignore000066400000000000000000000000641264705027700151600ustar00rootroot00000000000000 .DS_Store* *.log *.gz node_modules coverage cache methods-1.1.2/.travis.yml000066400000000000000000000013371264705027700153050ustar00rootroot00000000000000language: node_js node_js: - "0.6" - "0.8" - "0.10" - "0.12" - "1.8" - "2.5" - "3.3" - "4.2" - "5.4" sudo: false before_install: # Setup Node.js version-specific dependencies - "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev istanbul" - "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul" - "test $TRAVIS_NODE_VERSION = '0.6' -o $TRAVIS_NODE_VERSION = '0.8' || npm install browserify@12" script: # Run test script, depending on istanbul install - "test ! -z $(npm -ps ls istanbul) || npm test" - "test -z $(npm -ps ls istanbul) || npm run-script test-travis" after_script: - "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls" methods-1.1.2/HISTORY.md000066400000000000000000000006531264705027700146570ustar00rootroot000000000000001.1.2 / 2016-01-17 ================== * perf: enable strict mode 1.1.1 / 2014-12-30 ================== * Improve `browserify` support 1.1.0 / 2014-07-05 ================== * Add `CONNECT` method 1.0.1 / 2014-06-02 ================== * Fix module to work with harmony transform 1.0.0 / 2014-05-08 ================== * Add `PURGE` method 0.1.0 / 2013-10-28 ================== * Add `http.METHODS` support methods-1.1.2/LICENSE000066400000000000000000000022341264705027700141760ustar00rootroot00000000000000(The MIT License) Copyright (c) 2013-2014 TJ Holowaychuk Copyright (c) 2015-2016 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. methods-1.1.2/README.md000066400000000000000000000032361264705027700144530ustar00rootroot00000000000000# Methods [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] HTTP verbs that Node.js core's HTTP parser supports. This module provides an export that is just like `http.METHODS` from Node.js core, with the following differences: * All method names are lower-cased. * Contains a fallback list of methods for Node.js versions that do not have a `http.METHODS` export (0.10 and lower). * Provides the fallback list when using tools like `browserify` without pulling in the `http` shim module. ## Install ```bash $ npm install methods ``` ## API ```js var methods = require('methods') ``` ### methods This is an array of lower-cased method names that Node.js supports. If Node.js provides the `http.METHODS` export, then this is the same array lower-cased, otherwise it is a snapshot of the verbs from Node.js 0.10. ## License [MIT](LICENSE) [npm-image]: https://img.shields.io/npm/v/methods.svg?style=flat [npm-url]: https://npmjs.org/package/methods [node-version-image]: https://img.shields.io/node/v/methods.svg?style=flat [node-version-url]: https://nodejs.org/en/download/ [travis-image]: https://img.shields.io/travis/jshttp/methods.svg?style=flat [travis-url]: https://travis-ci.org/jshttp/methods [coveralls-image]: https://img.shields.io/coveralls/jshttp/methods.svg?style=flat [coveralls-url]: https://coveralls.io/r/jshttp/methods?branch=master [downloads-image]: https://img.shields.io/npm/dm/methods.svg?style=flat [downloads-url]: https://npmjs.org/package/methods methods-1.1.2/index.js000066400000000000000000000020201264705027700146270ustar00rootroot00000000000000/*! * methods * Copyright(c) 2013-2014 TJ Holowaychuk * Copyright(c) 2015-2016 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module dependencies. * @private */ var http = require('http'); /** * Module exports. * @public */ module.exports = getCurrentNodeMethods() || getBasicNodeMethods(); /** * Get the current Node.js methods. * @private */ function getCurrentNodeMethods() { return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) { return method.toLowerCase(); }); } /** * Get the "basic" Node.js methods, a snapshot from Node.js 0.10. * @private */ function getBasicNodeMethods() { return [ 'get', 'post', 'put', 'head', 'delete', 'options', 'trace', 'copy', 'lock', 'mkcol', 'move', 'purge', 'propfind', 'proppatch', 'unlock', 'report', 'mkactivity', 'checkout', 'merge', 'm-search', 'notify', 'subscribe', 'unsubscribe', 'patch', 'search', 'connect' ]; } methods-1.1.2/package.json000066400000000000000000000016631264705027700154640ustar00rootroot00000000000000{ "name": "methods", "description": "HTTP methods that node supports", "version": "1.1.2", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)", "TJ Holowaychuk (http://tjholowaychuk.com)" ], "license": "MIT", "repository": "jshttp/methods", "devDependencies": { "istanbul": "0.4.1", "mocha": "1.21.5" }, "files": [ "index.js", "HISTORY.md", "LICENSE" ], "engines": { "node": ">= 0.6" }, "scripts": { "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, "browser": { "http": false }, "keywords": [ "http", "methods" ] } methods-1.1.2/test/000077500000000000000000000000001264705027700141475ustar00rootroot00000000000000methods-1.1.2/test/browserify.js000066400000000000000000000021211264705027700166740ustar00rootroot00000000000000var assert = require('assert') var browserify = tryRequire('browserify') var http = require('http') var methods = null var path = require('path') var run = browserify ? describe : describe.skip run('when browserified', function () { before(function (done) { var b = browserify() // require methods b.require(path.join(__dirname, '..'), { expose: 'methods' }) // bundle and eval b.bundle(function (err, buf) { var require = eval(buf.toString()) methods = require('methods') done() }) }) describe('methods', function () { ['get', 'post', 'put', 'patch', 'delete'].forEach(function (method) { it('should contain "' + method + '"', function () { assert.notEqual(methods.indexOf(method), -1) }) }) it('should only have lower-case entries', function() { for (var i = 0; i < methods.length; i ++) { assert(methods[i], methods[i].toLowerCase(), methods[i] + ' is lower-case') } }) }) }) function tryRequire(name) { try { return require(name) } catch (e) { return undefined } } methods-1.1.2/test/methods.js000066400000000000000000000015261264705027700161540ustar00rootroot00000000000000var http = require('http'); var assert = require('assert'); var methods = require('..'); describe('methods', function() { if (http.METHODS) { it('is a lowercased http.METHODS', function() { var lowercased = http.METHODS.map(function(method) { return method.toLowerCase(); }); assert.deepEqual(lowercased, methods); }); } else { it('contains GET, POST, PUT, and DELETE', function() { assert.notEqual(methods.indexOf('get'), -1); assert.notEqual(methods.indexOf('post'), -1); assert.notEqual(methods.indexOf('put'), -1); assert.notEqual(methods.indexOf('delete'), -1); }); it('is all lowercase', function() { for (var i = 0; i < methods.length; i ++) { assert(methods[i], methods[i].toLowerCase(), methods[i] + " isn't all lowercase"); } }); } });