mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-11 18:32:50 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
22
node_modules/statuses/LICENSE
generated
vendored
Normal file
22
node_modules/statuses/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
||||
|
||||
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.
|
||||
114
node_modules/statuses/README.md
generated
vendored
Normal file
114
node_modules/statuses/README.md
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
# Statuses
|
||||
|
||||
[![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 status utility for node.
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var status = require('statuses');
|
||||
```
|
||||
|
||||
### var code = status(Integer || String)
|
||||
|
||||
If `Integer` or `String` is a valid HTTP code or status message, then the appropriate `code` will be returned. Otherwise, an error will be thrown.
|
||||
|
||||
```js
|
||||
status(403) // => 'Forbidden'
|
||||
status('403') // => 'Forbidden'
|
||||
status('forbidden') // => 403
|
||||
status('Forbidden') // => 403
|
||||
status(306) // throws, as it's not supported by node.js
|
||||
```
|
||||
|
||||
### status.codes
|
||||
|
||||
Returns an array of all the status codes as `Integer`s.
|
||||
|
||||
### var msg = status[code]
|
||||
|
||||
Map of `code` to `status message`. `undefined` for invalid `code`s.
|
||||
|
||||
```js
|
||||
status[404] // => 'Not Found'
|
||||
```
|
||||
|
||||
### var code = status[msg]
|
||||
|
||||
Map of `status message` to `code`. `msg` can either be title-cased or lower-cased. `undefined` for invalid `status message`s.
|
||||
|
||||
```js
|
||||
status['not found'] // => 404
|
||||
status['Not Found'] // => 404
|
||||
```
|
||||
|
||||
### status.redirect[code]
|
||||
|
||||
Returns `true` if a status code is a valid redirect status.
|
||||
|
||||
```js
|
||||
status.redirect[200] // => undefined
|
||||
status.redirect[301] // => true
|
||||
```
|
||||
|
||||
### status.empty[code]
|
||||
|
||||
Returns `true` if a status code expects an empty body.
|
||||
|
||||
```js
|
||||
status.empty[200] // => undefined
|
||||
status.empty[204] // => true
|
||||
status.empty[304] // => true
|
||||
```
|
||||
|
||||
### status.retry[code]
|
||||
|
||||
Returns `true` if you should retry the rest.
|
||||
|
||||
```js
|
||||
status.retry[501] // => undefined
|
||||
status.retry[503] // => true
|
||||
```
|
||||
|
||||
### statuses/codes.json
|
||||
|
||||
```js
|
||||
var codes = require('statuses/codes.json');
|
||||
```
|
||||
|
||||
This is a JSON file of the status codes
|
||||
taken from `require('http').STATUS_CODES`.
|
||||
This is saved so that codes are consistent even in older node.js versions.
|
||||
For example, `308` will be added in v0.12.
|
||||
|
||||
## Adding Status Codes
|
||||
|
||||
The status codes are primarily sourced from http://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv.
|
||||
Additionally, custom codes are added from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes.
|
||||
These are added manually in the `lib/*.json` files.
|
||||
If you would like to add a status code, add it to the appropriate JSON file.
|
||||
|
||||
To rebuild `codes.json`, run the following:
|
||||
|
||||
```bash
|
||||
# update src/iana.json
|
||||
npm run update
|
||||
# build codes.json
|
||||
npm run build
|
||||
```
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/statuses.svg?style=flat
|
||||
[npm-url]: https://npmjs.org/package/statuses
|
||||
[node-version-image]: http://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat
|
||||
[node-version-url]: http://nodejs.org/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/jshttp/statuses
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
||||
[downloads-image]: http://img.shields.io/npm/dm/statuses.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/statuses
|
||||
64
node_modules/statuses/codes.json
generated
vendored
Normal file
64
node_modules/statuses/codes.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"100": "Continue",
|
||||
"101": "Switching Protocols",
|
||||
"102": "Processing",
|
||||
"200": "OK",
|
||||
"201": "Created",
|
||||
"202": "Accepted",
|
||||
"203": "Non-Authoritative Information",
|
||||
"204": "No Content",
|
||||
"205": "Reset Content",
|
||||
"206": "Partial Content",
|
||||
"207": "Multi-Status",
|
||||
"208": "Already Reported",
|
||||
"226": "IM Used",
|
||||
"300": "Multiple Choices",
|
||||
"301": "Moved Permanently",
|
||||
"302": "Found",
|
||||
"303": "See Other",
|
||||
"304": "Not Modified",
|
||||
"305": "Use Proxy",
|
||||
"306": "(Unused)",
|
||||
"307": "Temporary Redirect",
|
||||
"308": "Permanent Redirect",
|
||||
"400": "Bad Request",
|
||||
"401": "Unauthorized",
|
||||
"402": "Payment Required",
|
||||
"403": "Forbidden",
|
||||
"404": "Not Found",
|
||||
"405": "Method Not Allowed",
|
||||
"406": "Not Acceptable",
|
||||
"407": "Proxy Authentication Required",
|
||||
"408": "Request Timeout",
|
||||
"409": "Conflict",
|
||||
"410": "Gone",
|
||||
"411": "Length Required",
|
||||
"412": "Precondition Failed",
|
||||
"413": "Payload Too Large",
|
||||
"414": "URI Too Long",
|
||||
"415": "Unsupported Media Type",
|
||||
"416": "Range Not Satisfiable",
|
||||
"417": "Expectation Failed",
|
||||
"418": "I'm a teapot",
|
||||
"422": "Unprocessable Entity",
|
||||
"423": "Locked",
|
||||
"424": "Failed Dependency",
|
||||
"425": "Unordered Collection",
|
||||
"426": "Upgrade Required",
|
||||
"428": "Precondition Required",
|
||||
"429": "Too Many Requests",
|
||||
"431": "Request Header Fields Too Large",
|
||||
"451": "Unavailable For Legal Reasons",
|
||||
"500": "Internal Server Error",
|
||||
"501": "Not Implemented",
|
||||
"502": "Bad Gateway",
|
||||
"503": "Service Unavailable",
|
||||
"504": "Gateway Timeout",
|
||||
"505": "HTTP Version Not Supported",
|
||||
"506": "Variant Also Negotiates",
|
||||
"507": "Insufficient Storage",
|
||||
"508": "Loop Detected",
|
||||
"509": "Bandwidth Limit Exceeded",
|
||||
"510": "Not Extended",
|
||||
"511": "Network Authentication Required"
|
||||
}
|
||||
60
node_modules/statuses/index.js
generated
vendored
Normal file
60
node_modules/statuses/index.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
var codes = require('./codes.json');
|
||||
|
||||
module.exports = status;
|
||||
|
||||
// [Integer...]
|
||||
status.codes = Object.keys(codes).map(function (code) {
|
||||
code = ~~code;
|
||||
var msg = codes[code];
|
||||
status[code] = msg;
|
||||
status[msg] = status[msg.toLowerCase()] = code;
|
||||
return code;
|
||||
});
|
||||
|
||||
// status codes for redirects
|
||||
status.redirect = {
|
||||
300: true,
|
||||
301: true,
|
||||
302: true,
|
||||
303: true,
|
||||
305: true,
|
||||
307: true,
|
||||
308: true,
|
||||
};
|
||||
|
||||
// status codes for empty bodies
|
||||
status.empty = {
|
||||
204: true,
|
||||
205: true,
|
||||
304: true,
|
||||
};
|
||||
|
||||
// status codes for when you should retry the request
|
||||
status.retry = {
|
||||
502: true,
|
||||
503: true,
|
||||
504: true,
|
||||
};
|
||||
|
||||
function status(code) {
|
||||
if (typeof code === 'number') {
|
||||
if (!status[code]) throw new Error('invalid status code: ' + code);
|
||||
return code;
|
||||
}
|
||||
|
||||
if (typeof code !== 'string') {
|
||||
throw new TypeError('code must be a number or string');
|
||||
}
|
||||
|
||||
// '403'
|
||||
var n = parseInt(code, 10)
|
||||
if (!isNaN(n)) {
|
||||
if (!status[n]) throw new Error('invalid status code: ' + n);
|
||||
return n;
|
||||
}
|
||||
|
||||
n = status[code.toLowerCase()];
|
||||
if (!n) throw new Error('invalid status message: "' + code + '"');
|
||||
return n;
|
||||
}
|
||||
111
node_modules/statuses/package.json
generated
vendored
Normal file
111
node_modules/statuses/package.json
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"statuses@1",
|
||||
"/home/mitchell/Desktop/test-mywebsite/mywebsite/node_modules/http-errors"
|
||||
]
|
||||
],
|
||||
"_from": "statuses@>=1.0.0 <2.0.0",
|
||||
"_id": "statuses@1.2.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/statuses",
|
||||
"_npmUser": {
|
||||
"email": "doug@somethingdoug.com",
|
||||
"name": "dougwilson"
|
||||
},
|
||||
"_npmVersion": "1.4.28",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "statuses",
|
||||
"raw": "statuses@1",
|
||||
"rawSpec": "1",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/http-errors",
|
||||
"/send"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz",
|
||||
"_shasum": "dded45cc18256d51ed40aec142489d5c61026d28",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "statuses@1",
|
||||
"_where": "/home/mitchell/Desktop/test-mywebsite/mywebsite/node_modules/http-errors",
|
||||
"author": {
|
||||
"email": "me@jongleberry.com",
|
||||
"name": "Jonathan Ong",
|
||||
"url": "http://jongleberry.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/statuses/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "HTTP status utility",
|
||||
"devDependencies": {
|
||||
"csv-parse": "0.0.6",
|
||||
"istanbul": "0",
|
||||
"mocha": "1",
|
||||
"stream-to-array": "2"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "dded45cc18256d51ed40aec142489d5c61026d28",
|
||||
"tarball": "http://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"codes.json",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "49e6ac7ae4c63ee8186f56cb52112a7eeda28ed7",
|
||||
"homepage": "https://github.com/jshttp/statuses",
|
||||
"keywords": [
|
||||
"code",
|
||||
"http",
|
||||
"status"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "tjholowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
{
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "shtylman",
|
||||
"email": "shtylman@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "mscdex",
|
||||
"email": "mscdex@mscdex.net"
|
||||
},
|
||||
{
|
||||
"name": "fishrock123",
|
||||
"email": "fishrock123@rocketmail.com"
|
||||
}
|
||||
],
|
||||
"name": "statuses",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/statuses.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js",
|
||||
"test": "mocha --reporter spec --bail --check-leaks",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks",
|
||||
"update": "node scripts/update.js"
|
||||
},
|
||||
"version": "1.2.1"
|
||||
}
|
||||
Reference in New Issue
Block a user