강현준

first commit

Showing 574 changed files with 4766 additions and 0 deletions
1 +<!DOCTYPE html>
2 + <html>
3 + <head>
4 + <meta charset="utf-8">
5 + <title>Chatting!</title>
6 + <style>
7 + .chat_log{ width: 80%; height: 200px; }
8 + .name{ width: 10%; }
9 + .message{ width: 60%; }
10 + .chat{ width: 10%; }
11 + </style>
12 + </head>
13 + <body>
14 + <div>
15 + <textarea id="chatLog" class="chat_log" readonly></textarea>
16 + </div>
17 + <form id="chat">
18 + <input id="name" class="name" type="text" readonly>
19 + <input id="message" class="message" type="text">
20 + <input type="submit" class="chat" value="보내기"/>
21 + </form>
22 + <div id="box" class="box">
23 + <script src="/socket.io/socket.io.js"></script>
24 + <script src="http://code.jquery.com/jquery-1.11.1.js"></script>
25 + <script>
26 + var socket = io();
27 + $('#chat').on('submit', function(f){
28 + socket.emit('send message', $('#name').val(), $('#message').val());
29 + $('#message').val("");
30 + f.preventDefault();
31 + });
32 + socket.on('receive message', function(msg){
33 + $('#chatLog').append(msg+"\n");
34 + $('#chatLog').scrollTop($('#chatLog').innerHeight());
35 + });
36 + socket.on('connectLog', function(msg){
37 + $('#chatLog').append(msg+"\n");
38 + $('#chatLog').scrollTop($('#chatLog').innerHeight());
39 + });
40 + socket.on('disconnectLog', function(msg){
41 + $('#chatLog').append(msg+"\n");
42 + $('#chatLog').scrollTop($('#chatLog').innerHeight());
43 + });
44 + socket.on('change name', function(name){
45 + $('#name').val(name);
46 + });
47 + </script>
48 + </body>
49 + </html>
1 +#!/bin/sh
2 +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 +
4 +case `uname` in
5 + *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6 +esac
7 +
8 +if [ -x "$basedir/node" ]; then
9 + "$basedir/node" "$basedir/../mime/cli.js" "$@"
10 + ret=$?
11 +else
12 + node "$basedir/../mime/cli.js" "$@"
13 + ret=$?
14 +fi
15 +exit $ret
1 +@IF EXIST "%~dp0\node.exe" (
2 + "%~dp0\node.exe" "%~dp0\..\mime\cli.js" %*
3 +) ELSE (
4 + @SETLOCAL
5 + @SET PATHEXT=%PATHEXT:;.JS;=;%
6 + node "%~dp0\..\mime\cli.js" %*
7 +)
...\ No newline at end of file ...\ No newline at end of file
1 +1.3.3 / 2016-05-02
2 +==================
3 +
4 + * deps: mime-types@~2.1.11
5 + - deps: mime-db@~1.23.0
6 + * deps: negotiator@0.6.1
7 + - perf: improve `Accept` parsing speed
8 + - perf: improve `Accept-Charset` parsing speed
9 + - perf: improve `Accept-Encoding` parsing speed
10 + - perf: improve `Accept-Language` parsing speed
11 +
12 +1.3.2 / 2016-03-08
13 +==================
14 +
15 + * deps: mime-types@~2.1.10
16 + - Fix extension of `application/dash+xml`
17 + - Update primary extension for `audio/mp4`
18 + - deps: mime-db@~1.22.0
19 +
20 +1.3.1 / 2016-01-19
21 +==================
22 +
23 + * deps: mime-types@~2.1.9
24 + - deps: mime-db@~1.21.0
25 +
26 +1.3.0 / 2015-09-29
27 +==================
28 +
29 + * deps: mime-types@~2.1.7
30 + - deps: mime-db@~1.19.0
31 + * deps: negotiator@0.6.0
32 + - Fix including type extensions in parameters in `Accept` parsing
33 + - Fix parsing `Accept` parameters with quoted equals
34 + - Fix parsing `Accept` parameters with quoted semicolons
35 + - Lazy-load modules from main entry point
36 + - perf: delay type concatenation until needed
37 + - perf: enable strict mode
38 + - perf: hoist regular expressions
39 + - perf: remove closures getting spec properties
40 + - perf: remove a closure from media type parsing
41 + - perf: remove property delete from media type parsing
42 +
43 +1.2.13 / 2015-09-06
44 +===================
45 +
46 + * deps: mime-types@~2.1.6
47 + - deps: mime-db@~1.18.0
48 +
49 +1.2.12 / 2015-07-30
50 +===================
51 +
52 + * deps: mime-types@~2.1.4
53 + - deps: mime-db@~1.16.0
54 +
55 +1.2.11 / 2015-07-16
56 +===================
57 +
58 + * deps: mime-types@~2.1.3
59 + - deps: mime-db@~1.15.0
60 +
61 +1.2.10 / 2015-07-01
62 +===================
63 +
64 + * deps: mime-types@~2.1.2
65 + - deps: mime-db@~1.14.0
66 +
67 +1.2.9 / 2015-06-08
68 +==================
69 +
70 + * deps: mime-types@~2.1.1
71 + - perf: fix deopt during mapping
72 +
73 +1.2.8 / 2015-06-07
74 +==================
75 +
76 + * deps: mime-types@~2.1.0
77 + - deps: mime-db@~1.13.0
78 + * perf: avoid argument reassignment & argument slice
79 + * perf: avoid negotiator recursive construction
80 + * perf: enable strict mode
81 + * perf: remove unnecessary bitwise operator
82 +
83 +1.2.7 / 2015-05-10
84 +==================
85 +
86 + * deps: negotiator@0.5.3
87 + - Fix media type parameter matching to be case-insensitive
88 +
89 +1.2.6 / 2015-05-07
90 +==================
91 +
92 + * deps: mime-types@~2.0.11
93 + - deps: mime-db@~1.9.1
94 + * deps: negotiator@0.5.2
95 + - Fix comparing media types with quoted values
96 + - Fix splitting media types with quoted commas
97 +
98 +1.2.5 / 2015-03-13
99 +==================
100 +
101 + * deps: mime-types@~2.0.10
102 + - deps: mime-db@~1.8.0
103 +
104 +1.2.4 / 2015-02-14
105 +==================
106 +
107 + * Support Node.js 0.6
108 + * deps: mime-types@~2.0.9
109 + - deps: mime-db@~1.7.0
110 + * deps: negotiator@0.5.1
111 + - Fix preference sorting to be stable for long acceptable lists
112 +
113 +1.2.3 / 2015-01-31
114 +==================
115 +
116 + * deps: mime-types@~2.0.8
117 + - deps: mime-db@~1.6.0
118 +
119 +1.2.2 / 2014-12-30
120 +==================
121 +
122 + * deps: mime-types@~2.0.7
123 + - deps: mime-db@~1.5.0
124 +
125 +1.2.1 / 2014-12-30
126 +==================
127 +
128 + * deps: mime-types@~2.0.5
129 + - deps: mime-db@~1.3.1
130 +
131 +1.2.0 / 2014-12-19
132 +==================
133 +
134 + * deps: negotiator@0.5.0
135 + - Fix list return order when large accepted list
136 + - Fix missing identity encoding when q=0 exists
137 + - Remove dynamic building of Negotiator class
138 +
139 +1.1.4 / 2014-12-10
140 +==================
141 +
142 + * deps: mime-types@~2.0.4
143 + - deps: mime-db@~1.3.0
144 +
145 +1.1.3 / 2014-11-09
146 +==================
147 +
148 + * deps: mime-types@~2.0.3
149 + - deps: mime-db@~1.2.0
150 +
151 +1.1.2 / 2014-10-14
152 +==================
153 +
154 + * deps: negotiator@0.4.9
155 + - Fix error when media type has invalid parameter
156 +
157 +1.1.1 / 2014-09-28
158 +==================
159 +
160 + * deps: mime-types@~2.0.2
161 + - deps: mime-db@~1.1.0
162 + * deps: negotiator@0.4.8
163 + - Fix all negotiations to be case-insensitive
164 + - Stable sort preferences of same quality according to client order
165 +
166 +1.1.0 / 2014-09-02
167 +==================
168 +
169 + * update `mime-types`
170 +
171 +1.0.7 / 2014-07-04
172 +==================
173 +
174 + * Fix wrong type returned from `type` when match after unknown extension
175 +
176 +1.0.6 / 2014-06-24
177 +==================
178 +
179 + * deps: negotiator@0.4.7
180 +
181 +1.0.5 / 2014-06-20
182 +==================
183 +
184 + * fix crash when unknown extension given
185 +
186 +1.0.4 / 2014-06-19
187 +==================
188 +
189 + * use `mime-types`
190 +
191 +1.0.3 / 2014-06-11
192 +==================
193 +
194 + * deps: negotiator@0.4.6
195 + - Order by specificity when quality is the same
196 +
197 +1.0.2 / 2014-05-29
198 +==================
199 +
200 + * Fix interpretation when header not in request
201 + * deps: pin negotiator@0.4.5
202 +
203 +1.0.1 / 2014-01-18
204 +==================
205 +
206 + * Identity encoding isn't always acceptable
207 + * deps: negotiator@~0.4.0
208 +
209 +1.0.0 / 2013-12-27
210 +==================
211 +
212 + * Genesis
1 +(The MIT License)
2 +
3 +Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
4 +Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
5 +
6 +Permission is hereby granted, free of charge, to any person obtaining
7 +a copy of this software and associated documentation files (the
8 +'Software'), to deal in the Software without restriction, including
9 +without limitation the rights to use, copy, modify, merge, publish,
10 +distribute, sublicense, and/or sell copies of the Software, and to
11 +permit persons to whom the Software is furnished to do so, subject to
12 +the following conditions:
13 +
14 +The above copyright notice and this permission notice shall be
15 +included in all copies or substantial portions of the Software.
16 +
17 +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 +# accepts
2 +
3 +[![NPM Version][npm-image]][npm-url]
4 +[![NPM Downloads][downloads-image]][downloads-url]
5 +[![Node.js Version][node-version-image]][node-version-url]
6 +[![Build Status][travis-image]][travis-url]
7 +[![Test Coverage][coveralls-image]][coveralls-url]
8 +
9 +Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
10 +
11 +In addition to negotiator, it allows:
12 +
13 +- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`.
14 +- Allows type shorthands such as `json`.
15 +- Returns `false` when no types match
16 +- Treats non-existent headers as `*`
17 +
18 +## Installation
19 +
20 +```sh
21 +npm install accepts
22 +```
23 +
24 +## API
25 +
26 +```js
27 +var accepts = require('accepts')
28 +```
29 +
30 +### accepts(req)
31 +
32 +Create a new `Accepts` object for the given `req`.
33 +
34 +#### .charset(charsets)
35 +
36 +Return the first accepted charset. If nothing in `charsets` is accepted,
37 +then `false` is returned.
38 +
39 +#### .charsets()
40 +
41 +Return the charsets that the request accepts, in the order of the client's
42 +preference (most preferred first).
43 +
44 +#### .encoding(encodings)
45 +
46 +Return the first accepted encoding. If nothing in `encodings` is accepted,
47 +then `false` is returned.
48 +
49 +#### .encodings()
50 +
51 +Return the encodings that the request accepts, in the order of the client's
52 +preference (most preferred first).
53 +
54 +#### .language(languages)
55 +
56 +Return the first accepted language. If nothing in `languages` is accepted,
57 +then `false` is returned.
58 +
59 +#### .languages()
60 +
61 +Return the languages that the request accepts, in the order of the client's
62 +preference (most preferred first).
63 +
64 +#### .type(types)
65 +
66 +Return the first accepted type (and it is returned as the same text as what
67 +appears in the `types` array). If nothing in `types` is accepted, then `false`
68 +is returned.
69 +
70 +The `types` array can contain full MIME types or file extensions. Any value
71 +that is not a full MIME types is passed to `require('mime-types').lookup`.
72 +
73 +#### .types()
74 +
75 +Return the types that the request accepts, in the order of the client's
76 +preference (most preferred first).
77 +
78 +## Examples
79 +
80 +### Simple type negotiation
81 +
82 +This simple example shows how to use `accepts` to return a different typed
83 +respond body based on what the client wants to accept. The server lists it's
84 +preferences in order and will get back the best match between the client and
85 +server.
86 +
87 +```js
88 +var accepts = require('accepts')
89 +var http = require('http')
90 +
91 +function app(req, res) {
92 + var accept = accepts(req)
93 +
94 + // the order of this list is significant; should be server preferred order
95 + switch(accept.type(['json', 'html'])) {
96 + case 'json':
97 + res.setHeader('Content-Type', 'application/json')
98 + res.write('{"hello":"world!"}')
99 + break
100 + case 'html':
101 + res.setHeader('Content-Type', 'text/html')
102 + res.write('<b>hello, world!</b>')
103 + break
104 + default:
105 + // the fallback is text/plain, so no need to specify it above
106 + res.setHeader('Content-Type', 'text/plain')
107 + res.write('hello, world!')
108 + break
109 + }
110 +
111 + res.end()
112 +}
113 +
114 +http.createServer(app).listen(3000)
115 +```
116 +
117 +You can test this out with the cURL program:
118 +```sh
119 +curl -I -H'Accept: text/html' http://localhost:3000/
120 +```
121 +
122 +## License
123 +
124 +[MIT](LICENSE)
125 +
126 +[npm-image]: https://img.shields.io/npm/v/accepts.svg
127 +[npm-url]: https://npmjs.org/package/accepts
128 +[node-version-image]: https://img.shields.io/node/v/accepts.svg
129 +[node-version-url]: http://nodejs.org/download/
130 +[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg
131 +[travis-url]: https://travis-ci.org/jshttp/accepts
132 +[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg
133 +[coveralls-url]: https://coveralls.io/r/jshttp/accepts
134 +[downloads-image]: https://img.shields.io/npm/dm/accepts.svg
135 +[downloads-url]: https://npmjs.org/package/accepts
1 +/*!
2 + * accepts
3 + * Copyright(c) 2014 Jonathan Ong
4 + * Copyright(c) 2015 Douglas Christopher Wilson
5 + * MIT Licensed
6 + */
7 +
8 +'use strict'
9 +
10 +/**
11 + * Module dependencies.
12 + * @private
13 + */
14 +
15 +var Negotiator = require('negotiator')
16 +var mime = require('mime-types')
17 +
18 +/**
19 + * Module exports.
20 + * @public
21 + */
22 +
23 +module.exports = Accepts
24 +
25 +/**
26 + * Create a new Accepts object for the given req.
27 + *
28 + * @param {object} req
29 + * @public
30 + */
31 +
32 +function Accepts(req) {
33 + if (!(this instanceof Accepts))
34 + return new Accepts(req)
35 +
36 + this.headers = req.headers
37 + this.negotiator = new Negotiator(req)
38 +}
39 +
40 +/**
41 + * Check if the given `type(s)` is acceptable, returning
42 + * the best match when true, otherwise `undefined`, in which
43 + * case you should respond with 406 "Not Acceptable".
44 + *
45 + * The `type` value may be a single mime type string
46 + * such as "application/json", the extension name
47 + * such as "json" or an array `["json", "html", "text/plain"]`. When a list
48 + * or array is given the _best_ match, if any is returned.
49 + *
50 + * Examples:
51 + *
52 + * // Accept: text/html
53 + * this.types('html');
54 + * // => "html"
55 + *
56 + * // Accept: text/*, application/json
57 + * this.types('html');
58 + * // => "html"
59 + * this.types('text/html');
60 + * // => "text/html"
61 + * this.types('json', 'text');
62 + * // => "json"
63 + * this.types('application/json');
64 + * // => "application/json"
65 + *
66 + * // Accept: text/*, application/json
67 + * this.types('image/png');
68 + * this.types('png');
69 + * // => undefined
70 + *
71 + * // Accept: text/*;q=.5, application/json
72 + * this.types(['html', 'json']);
73 + * this.types('html', 'json');
74 + * // => "json"
75 + *
76 + * @param {String|Array} types...
77 + * @return {String|Array|Boolean}
78 + * @public
79 + */
80 +
81 +Accepts.prototype.type =
82 +Accepts.prototype.types = function (types_) {
83 + var types = types_
84 +
85 + // support flattened arguments
86 + if (types && !Array.isArray(types)) {
87 + types = new Array(arguments.length)
88 + for (var i = 0; i < types.length; i++) {
89 + types[i] = arguments[i]
90 + }
91 + }
92 +
93 + // no types, return all requested types
94 + if (!types || types.length === 0) {
95 + return this.negotiator.mediaTypes()
96 + }
97 +
98 + if (!this.headers.accept) return types[0];
99 + var mimes = types.map(extToMime);
100 + var accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
101 + var first = accepts[0];
102 + if (!first) return false;
103 + return types[mimes.indexOf(first)];
104 +}
105 +
106 +/**
107 + * Return accepted encodings or best fit based on `encodings`.
108 + *
109 + * Given `Accept-Encoding: gzip, deflate`
110 + * an array sorted by quality is returned:
111 + *
112 + * ['gzip', 'deflate']
113 + *
114 + * @param {String|Array} encodings...
115 + * @return {String|Array}
116 + * @public
117 + */
118 +
119 +Accepts.prototype.encoding =
120 +Accepts.prototype.encodings = function (encodings_) {
121 + var encodings = encodings_
122 +
123 + // support flattened arguments
124 + if (encodings && !Array.isArray(encodings)) {
125 + encodings = new Array(arguments.length)
126 + for (var i = 0; i < encodings.length; i++) {
127 + encodings[i] = arguments[i]
128 + }
129 + }
130 +
131 + // no encodings, return all requested encodings
132 + if (!encodings || encodings.length === 0) {
133 + return this.negotiator.encodings()
134 + }
135 +
136 + return this.negotiator.encodings(encodings)[0] || false
137 +}
138 +
139 +/**
140 + * Return accepted charsets or best fit based on `charsets`.
141 + *
142 + * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
143 + * an array sorted by quality is returned:
144 + *
145 + * ['utf-8', 'utf-7', 'iso-8859-1']
146 + *
147 + * @param {String|Array} charsets...
148 + * @return {String|Array}
149 + * @public
150 + */
151 +
152 +Accepts.prototype.charset =
153 +Accepts.prototype.charsets = function (charsets_) {
154 + var charsets = charsets_
155 +
156 + // support flattened arguments
157 + if (charsets && !Array.isArray(charsets)) {
158 + charsets = new Array(arguments.length)
159 + for (var i = 0; i < charsets.length; i++) {
160 + charsets[i] = arguments[i]
161 + }
162 + }
163 +
164 + // no charsets, return all requested charsets
165 + if (!charsets || charsets.length === 0) {
166 + return this.negotiator.charsets()
167 + }
168 +
169 + return this.negotiator.charsets(charsets)[0] || false
170 +}
171 +
172 +/**
173 + * Return accepted languages or best fit based on `langs`.
174 + *
175 + * Given `Accept-Language: en;q=0.8, es, pt`
176 + * an array sorted by quality is returned:
177 + *
178 + * ['es', 'pt', 'en']
179 + *
180 + * @param {String|Array} langs...
181 + * @return {Array|String}
182 + * @public
183 + */
184 +
185 +Accepts.prototype.lang =
186 +Accepts.prototype.langs =
187 +Accepts.prototype.language =
188 +Accepts.prototype.languages = function (languages_) {
189 + var languages = languages_
190 +
191 + // support flattened arguments
192 + if (languages && !Array.isArray(languages)) {
193 + languages = new Array(arguments.length)
194 + for (var i = 0; i < languages.length; i++) {
195 + languages[i] = arguments[i]
196 + }
197 + }
198 +
199 + // no languages, return all requested languages
200 + if (!languages || languages.length === 0) {
201 + return this.negotiator.languages()
202 + }
203 +
204 + return this.negotiator.languages(languages)[0] || false
205 +}
206 +
207 +/**
208 + * Convert extnames to mime.
209 + *
210 + * @param {String} type
211 + * @return {String}
212 + * @private
213 + */
214 +
215 +function extToMime(type) {
216 + return type.indexOf('/') === -1
217 + ? mime.lookup(type)
218 + : type
219 +}
220 +
221 +/**
222 + * Check if mime is valid.
223 + *
224 + * @param {String} type
225 + * @return {String}
226 + * @private
227 + */
228 +
229 +function validMime(type) {
230 + return typeof type === 'string';
231 +}
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "accepts@~1.3.3",
6 + "scope": null,
7 + "escapedName": "accepts",
8 + "name": "accepts",
9 + "rawSpec": "~1.3.3",
10 + "spec": ">=1.3.3 <1.4.0",
11 + "type": "range"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\express"
14 + ]
15 + ],
16 + "_from": "accepts@>=1.3.3 <1.4.0",
17 + "_id": "accepts@1.3.3",
18 + "_inCache": true,
19 + "_location": "/accepts",
20 + "_nodeVersion": "4.4.3",
21 + "_npmOperationalInternal": {
22 + "host": "packages-16-east.internal.npmjs.com",
23 + "tmp": "tmp/accepts-1.3.3.tgz_1462251932032_0.7092335098423064"
24 + },
25 + "_npmUser": {
26 + "name": "dougwilson",
27 + "email": "doug@somethingdoug.com"
28 + },
29 + "_npmVersion": "2.15.1",
30 + "_phantomChildren": {},
31 + "_requested": {
32 + "raw": "accepts@~1.3.3",
33 + "scope": null,
34 + "escapedName": "accepts",
35 + "name": "accepts",
36 + "rawSpec": "~1.3.3",
37 + "spec": ">=1.3.3 <1.4.0",
38 + "type": "range"
39 + },
40 + "_requiredBy": [
41 + "/engine.io",
42 + "/express"
43 + ],
44 + "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz",
45 + "_shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca",
46 + "_shrinkwrap": null,
47 + "_spec": "accepts@~1.3.3",
48 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\express",
49 + "bugs": {
50 + "url": "https://github.com/jshttp/accepts/issues"
51 + },
52 + "contributors": [
53 + {
54 + "name": "Douglas Christopher Wilson",
55 + "email": "doug@somethingdoug.com"
56 + },
57 + {
58 + "name": "Jonathan Ong",
59 + "email": "me@jongleberry.com",
60 + "url": "http://jongleberry.com"
61 + }
62 + ],
63 + "dependencies": {
64 + "mime-types": "~2.1.11",
65 + "negotiator": "0.6.1"
66 + },
67 + "description": "Higher-level content negotiation",
68 + "devDependencies": {
69 + "istanbul": "0.4.3",
70 + "mocha": "~1.21.5"
71 + },
72 + "directories": {},
73 + "dist": {
74 + "shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca",
75 + "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz"
76 + },
77 + "engines": {
78 + "node": ">= 0.6"
79 + },
80 + "files": [
81 + "LICENSE",
82 + "HISTORY.md",
83 + "index.js"
84 + ],
85 + "gitHead": "3e925b1e65ed7da2798849683d49814680dfa426",
86 + "homepage": "https://github.com/jshttp/accepts#readme",
87 + "keywords": [
88 + "content",
89 + "negotiation",
90 + "accept",
91 + "accepts"
92 + ],
93 + "license": "MIT",
94 + "maintainers": [
95 + {
96 + "name": "dougwilson",
97 + "email": "doug@somethingdoug.com"
98 + }
99 + ],
100 + "name": "accepts",
101 + "optionalDependencies": {},
102 + "readme": "ERROR: No README data found!",
103 + "repository": {
104 + "type": "git",
105 + "url": "git+https://github.com/jshttp/accepts.git"
106 + },
107 + "scripts": {
108 + "test": "mocha --reporter spec --check-leaks --bail test/",
109 + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
110 + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
111 + },
112 + "version": "1.3.3"
113 +}
1 +node_modules
2 +.monitor
1 +language: node_js
2 +node_js:
3 + - 0.6
4 + - 0.8
5 + - 0.9
6 + - 0.10
7 + - 0.12
8 + - 4.2.4
9 + - 5.4.1
10 + - iojs-1
11 + - iojs-2
12 + - iojs-3
1 +Copyright (c) 2011 Raynos.
2 +
3 +Permission is hereby granted, free of charge, to any person obtaining a copy
4 +of this software and associated documentation files (the "Software"), to deal
5 +in the Software without restriction, including without limitation the rights
6 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 +copies of the Software, and to permit persons to whom the Software is
8 +furnished to do so, subject to the following conditions:
9 +
10 +The above copyright notice and this permission notice shall be included in
11 +all copies or substantial portions of the Software.
12 +
13 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 +THE SOFTWARE.
...\ No newline at end of file ...\ No newline at end of file
1 +# After [![Build Status][1]][2]
2 +
3 +Invoke callback after n calls
4 +
5 +## Status: production ready
6 +
7 +## Example
8 +
9 +```js
10 +var after = require("after")
11 +var db = require("./db") // some db.
12 +
13 +var updateUser = function (req, res) {
14 + // use after to run two tasks in parallel,
15 + // namely get request body and get session
16 + // then run updateUser with the results
17 + var next = after(2, updateUser)
18 + var results = {}
19 +
20 + getJSONBody(req, res, function (err, body) {
21 + if (err) return next(err)
22 +
23 + results.body = body
24 + next(null, results)
25 + })
26 +
27 + getSessionUser(req, res, function (err, user) {
28 + if (err) return next(err)
29 +
30 + results.user = user
31 + next(null, results)
32 + })
33 +
34 + // now do the thing!
35 + function updateUser(err, result) {
36 + if (err) {
37 + res.statusCode = 500
38 + return res.end("Unexpected Error")
39 + }
40 +
41 + if (!result.user || result.user.role !== "admin") {
42 + res.statusCode = 403
43 + return res.end("Permission Denied")
44 + }
45 +
46 + db.put("users:" + req.params.userId, result.body, function (err) {
47 + if (err) {
48 + res.statusCode = 500
49 + return res.end("Unexpected Error")
50 + }
51 +
52 + res.statusCode = 200
53 + res.end("Ok")
54 + })
55 + }
56 +}
57 +```
58 +
59 +## Naive Example
60 +
61 +```js
62 +var after = require("after")
63 + , next = after(3, logItWorks)
64 +
65 +next()
66 +next()
67 +next() // it works
68 +
69 +function logItWorks() {
70 + console.log("it works!")
71 +}
72 +```
73 +
74 +## Example with error handling
75 +
76 +```js
77 +var after = require("after")
78 + , next = after(3, logError)
79 +
80 +next()
81 +next(new Error("oops")) // logs oops
82 +next() // does nothing
83 +
84 +// This callback is only called once.
85 +// If there is an error the callback gets called immediately
86 +// this avoids the situation where errors get lost.
87 +function logError(err) {
88 + console.log(err)
89 +}
90 +```
91 +
92 +## Installation
93 +
94 +`npm install after`
95 +
96 +## Tests
97 +
98 +`npm test`
99 +
100 +## Contributors
101 +
102 + - Raynos
103 + - defunctzombie
104 +
105 +## MIT Licenced
106 +
107 + [1]: https://secure.travis-ci.org/Raynos/after.png
108 + [2]: http://travis-ci.org/Raynos/after
109 + [3]: http://raynos.org/blog/2/Flow-control-in-node.js
110 + [4]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307
111 + [5]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031
112 + [6]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419
113 + [7]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091
114 + [8]: http://github.com/Raynos/iterators
115 + [9]: http://github.com/Raynos/composite
1 +module.exports = after
2 +
3 +function after(count, callback, err_cb) {
4 + var bail = false
5 + err_cb = err_cb || noop
6 + proxy.count = count
7 +
8 + return (count === 0) ? callback() : proxy
9 +
10 + function proxy(err, result) {
11 + if (proxy.count <= 0) {
12 + throw new Error('after called too many times')
13 + }
14 + --proxy.count
15 +
16 + // after first error, rest are passed to err_cb
17 + if (err) {
18 + bail = true
19 + callback(err)
20 + // future error callbacks will go to error handler
21 + callback = err_cb
22 + } else if (proxy.count === 0 && !bail) {
23 + callback(null, result)
24 + }
25 + }
26 +}
27 +
28 +function noop() {}
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "after@0.8.2",
6 + "scope": null,
7 + "escapedName": "after",
8 + "name": "after",
9 + "rawSpec": "0.8.2",
10 + "spec": "0.8.2",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser"
14 + ]
15 + ],
16 + "_from": "after@0.8.2",
17 + "_id": "after@0.8.2",
18 + "_inCache": true,
19 + "_location": "/after",
20 + "_nodeVersion": "0.10.32",
21 + "_npmOperationalInternal": {
22 + "host": "packages-12-west.internal.npmjs.com",
23 + "tmp": "tmp/after-0.8.2.tgz_1471308639186_0.9132961586583406"
24 + },
25 + "_npmUser": {
26 + "name": "raynos",
27 + "email": "raynos2@gmail.com"
28 + },
29 + "_npmVersion": "2.15.9",
30 + "_phantomChildren": {},
31 + "_requested": {
32 + "raw": "after@0.8.2",
33 + "scope": null,
34 + "escapedName": "after",
35 + "name": "after",
36 + "rawSpec": "0.8.2",
37 + "spec": "0.8.2",
38 + "type": "version"
39 + },
40 + "_requiredBy": [
41 + "/engine.io-parser"
42 + ],
43 + "_resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz",
44 + "_shasum": "fedb394f9f0e02aa9768e702bda23b505fae7e1f",
45 + "_shrinkwrap": null,
46 + "_spec": "after@0.8.2",
47 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser",
48 + "author": {
49 + "name": "Raynos",
50 + "email": "raynos2@gmail.com"
51 + },
52 + "bugs": {
53 + "url": "https://github.com/Raynos/after/issues"
54 + },
55 + "contributors": [
56 + {
57 + "name": "Raynos",
58 + "email": "raynos2@gmail.com",
59 + "url": "http://raynos.org"
60 + }
61 + ],
62 + "dependencies": {},
63 + "description": "after - tiny flow control",
64 + "devDependencies": {
65 + "mocha": "~1.8.1"
66 + },
67 + "directories": {},
68 + "dist": {
69 + "shasum": "fedb394f9f0e02aa9768e702bda23b505fae7e1f",
70 + "tarball": "https://registry.npmjs.org/after/-/after-0.8.2.tgz"
71 + },
72 + "gitHead": "e8c26046f36962b90e68dc5df33a9672a54b25f5",
73 + "homepage": "https://github.com/Raynos/after#readme",
74 + "keywords": [
75 + "flowcontrol",
76 + "after",
77 + "flow",
78 + "control",
79 + "arch"
80 + ],
81 + "license": "MIT",
82 + "maintainers": [
83 + {
84 + "name": "raynos",
85 + "email": "raynos2@gmail.com"
86 + },
87 + {
88 + "name": "defunctzombie",
89 + "email": "shtylman@gmail.com"
90 + }
91 + ],
92 + "name": "after",
93 + "optionalDependencies": {},
94 + "readme": "ERROR: No README data found!",
95 + "repository": {
96 + "type": "git",
97 + "url": "git://github.com/Raynos/after.git"
98 + },
99 + "scripts": {
100 + "test": "mocha --ui tdd --reporter spec test/*.js"
101 + },
102 + "version": "0.8.2"
103 +}
1 +/*global suite, test*/
2 +
3 +var assert = require("assert")
4 + , after = require("../")
5 +
6 +test("exists", function () {
7 + assert(typeof after === "function", "after is not a function")
8 +})
9 +
10 +test("after when called with 0 invokes", function (done) {
11 + after(0, done)
12 +});
13 +
14 +test("after 1", function (done) {
15 + var next = after(1, done)
16 + next()
17 +})
18 +
19 +test("after 5", function (done) {
20 + var next = after(5, done)
21 + , i = 5
22 +
23 + while (i--) {
24 + next()
25 + }
26 +})
27 +
28 +test("manipulate count", function (done) {
29 + var next = after(1, done)
30 + , i = 5
31 +
32 + next.count = i
33 + while (i--) {
34 + next()
35 + }
36 +})
37 +
38 +test("after terminates on error", function (done) {
39 + var next = after(2, function(err) {
40 + assert.equal(err.message, 'test');
41 + done();
42 + })
43 + next(new Error('test'))
44 + next(new Error('test2'))
45 +})
46 +
47 +test('gee', function(done) {
48 + done = after(2, done)
49 +
50 + function cb(err) {
51 + assert.equal(err.message, 1);
52 + done()
53 + }
54 +
55 + var next = after(3, cb, function(err) {
56 + assert.equal(err.message, 2)
57 + done()
58 + });
59 +
60 + next()
61 + next(new Error(1))
62 + next(new Error(2))
63 +})
64 +
65 +test('eee', function(done) {
66 + done = after(3, done)
67 +
68 + function cb(err) {
69 + assert.equal(err.message, 1);
70 + done()
71 + }
72 +
73 + var next = after(3, cb, function(err) {
74 + assert.equal(err.message, 2)
75 + done()
76 + });
77 +
78 + next(new Error(1))
79 + next(new Error(2))
80 + next(new Error(2))
81 +})
82 +
83 +test('gge', function(done) {
84 + function cb(err) {
85 + assert.equal(err.message, 1);
86 + done()
87 + }
88 +
89 + var next = after(3, cb, function(err) {
90 + // should not happen
91 + assert.ok(false);
92 + });
93 +
94 + next()
95 + next()
96 + next(new Error(1))
97 +})
98 +
99 +test('egg', function(done) {
100 + function cb(err) {
101 + assert.equal(err.message, 1);
102 + done()
103 + }
104 +
105 + var next = after(3, cb, function(err) {
106 + // should not happen
107 + assert.ok(false);
108 + });
109 +
110 + next(new Error(1))
111 + next()
112 + next()
113 +})
114 +
115 +test('throws on too many calls', function(done) {
116 + var next = after(1, done);
117 + next()
118 + assert.throws(next, /after called too many times/);
119 +});
120 +
1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.
1 +# Array Flatten
2 +
3 +[![NPM version][npm-image]][npm-url]
4 +[![NPM downloads][downloads-image]][downloads-url]
5 +[![Build status][travis-image]][travis-url]
6 +[![Test coverage][coveralls-image]][coveralls-url]
7 +
8 +> Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
9 +
10 +## Installation
11 +
12 +```
13 +npm install array-flatten --save
14 +```
15 +
16 +## Usage
17 +
18 +```javascript
19 +var flatten = require('array-flatten')
20 +
21 +flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
22 +//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
23 +
24 +flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
25 +//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
26 +
27 +(function () {
28 + flatten(arguments) //=> [1, 2, 3]
29 +})(1, [2, 3])
30 +```
31 +
32 +## License
33 +
34 +MIT
35 +
36 +[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
37 +[npm-url]: https://npmjs.org/package/array-flatten
38 +[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
39 +[downloads-url]: https://npmjs.org/package/array-flatten
40 +[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
41 +[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
42 +[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
43 +[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
1 +'use strict'
2 +
3 +/**
4 + * Expose `arrayFlatten`.
5 + */
6 +module.exports = arrayFlatten
7 +
8 +/**
9 + * Recursive flatten function with depth.
10 + *
11 + * @param {Array} array
12 + * @param {Array} result
13 + * @param {Number} depth
14 + * @return {Array}
15 + */
16 +function flattenWithDepth (array, result, depth) {
17 + for (var i = 0; i < array.length; i++) {
18 + var value = array[i]
19 +
20 + if (depth > 0 && Array.isArray(value)) {
21 + flattenWithDepth(value, result, depth - 1)
22 + } else {
23 + result.push(value)
24 + }
25 + }
26 +
27 + return result
28 +}
29 +
30 +/**
31 + * Recursive flatten function. Omitting depth is slightly faster.
32 + *
33 + * @param {Array} array
34 + * @param {Array} result
35 + * @return {Array}
36 + */
37 +function flattenForever (array, result) {
38 + for (var i = 0; i < array.length; i++) {
39 + var value = array[i]
40 +
41 + if (Array.isArray(value)) {
42 + flattenForever(value, result)
43 + } else {
44 + result.push(value)
45 + }
46 + }
47 +
48 + return result
49 +}
50 +
51 +/**
52 + * Flatten an array, with the ability to define a depth.
53 + *
54 + * @param {Array} array
55 + * @param {Number} depth
56 + * @return {Array}
57 + */
58 +function arrayFlatten (array, depth) {
59 + if (depth == null) {
60 + return flattenForever(array, [])
61 + }
62 +
63 + return flattenWithDepth(array, [], depth)
64 +}
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "array-flatten@1.1.1",
6 + "scope": null,
7 + "escapedName": "array-flatten",
8 + "name": "array-flatten",
9 + "rawSpec": "1.1.1",
10 + "spec": "1.1.1",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\express"
14 + ]
15 + ],
16 + "_from": "array-flatten@1.1.1",
17 + "_id": "array-flatten@1.1.1",
18 + "_inCache": true,
19 + "_location": "/array-flatten",
20 + "_nodeVersion": "2.3.3",
21 + "_npmUser": {
22 + "name": "blakeembrey",
23 + "email": "hello@blakeembrey.com"
24 + },
25 + "_npmVersion": "2.11.3",
26 + "_phantomChildren": {},
27 + "_requested": {
28 + "raw": "array-flatten@1.1.1",
29 + "scope": null,
30 + "escapedName": "array-flatten",
31 + "name": "array-flatten",
32 + "rawSpec": "1.1.1",
33 + "spec": "1.1.1",
34 + "type": "version"
35 + },
36 + "_requiredBy": [
37 + "/express"
38 + ],
39 + "_resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
40 + "_shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
41 + "_shrinkwrap": null,
42 + "_spec": "array-flatten@1.1.1",
43 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\express",
44 + "author": {
45 + "name": "Blake Embrey",
46 + "email": "hello@blakeembrey.com",
47 + "url": "http://blakeembrey.me"
48 + },
49 + "bugs": {
50 + "url": "https://github.com/blakeembrey/array-flatten/issues"
51 + },
52 + "dependencies": {},
53 + "description": "Flatten an array of nested arrays into a single flat array",
54 + "devDependencies": {
55 + "istanbul": "^0.3.13",
56 + "mocha": "^2.2.4",
57 + "pre-commit": "^1.0.7",
58 + "standard": "^3.7.3"
59 + },
60 + "directories": {},
61 + "dist": {
62 + "shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
63 + "tarball": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
64 + },
65 + "files": [
66 + "array-flatten.js",
67 + "LICENSE"
68 + ],
69 + "gitHead": "1963a9189229d408e1e8f585a00c8be9edbd1803",
70 + "homepage": "https://github.com/blakeembrey/array-flatten",
71 + "keywords": [
72 + "array",
73 + "flatten",
74 + "arguments",
75 + "depth"
76 + ],
77 + "license": "MIT",
78 + "main": "array-flatten.js",
79 + "maintainers": [
80 + {
81 + "name": "blakeembrey",
82 + "email": "hello@blakeembrey.com"
83 + }
84 + ],
85 + "name": "array-flatten",
86 + "optionalDependencies": {},
87 + "readme": "ERROR: No README data found!",
88 + "repository": {
89 + "type": "git",
90 + "url": "git://github.com/blakeembrey/array-flatten.git"
91 + },
92 + "scripts": {
93 + "test": "istanbul cover _mocha -- -R spec"
94 + },
95 + "version": "1.1.1"
96 +}
1 +lib-cov
2 +lcov.info
3 +*.seed
4 +*.log
5 +*.csv
6 +*.dat
7 +*.out
8 +*.pid
9 +*.gz
10 +
11 +pids
12 +logs
13 +results
14 +build
15 +.grunt
16 +
17 +node_modules
1 +
2 +REPORTER = dot
3 +
4 +test:
5 + @./node_modules/.bin/mocha \
6 + --reporter $(REPORTER)
7 +
8 +.PHONY: test
1 +# How to
2 +```javascript
3 +var sliceBuffer = require('arraybuffer.slice');
4 +var ab = (new Int8Array(5)).buffer;
5 +var sliced = sliceBuffer(ab, 1, 3);
6 +sliced = sliceBuffer(ab, 1);
7 +```
8 +
9 +# Licence (MIT)
10 +Copyright (C) 2013 Rase-
11 +
12 +
13 +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:
14 +
15 +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16 +
17 +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.
1 +/**
2 + * An abstraction for slicing an arraybuffer even when
3 + * ArrayBuffer.prototype.slice is not supported
4 + *
5 + * @api public
6 + */
7 +
8 +module.exports = function(arraybuffer, start, end) {
9 + var bytes = arraybuffer.byteLength;
10 + start = start || 0;
11 + end = end || bytes;
12 +
13 + if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
14 +
15 + if (start < 0) { start += bytes; }
16 + if (end < 0) { end += bytes; }
17 + if (end > bytes) { end = bytes; }
18 +
19 + if (start >= bytes || start >= end || bytes === 0) {
20 + return new ArrayBuffer(0);
21 + }
22 +
23 + var abv = new Uint8Array(arraybuffer);
24 + var result = new Uint8Array(end - start);
25 + for (var i = start, ii = 0; i < end; i++, ii++) {
26 + result[ii] = abv[i];
27 + }
28 + return result.buffer;
29 +};
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "arraybuffer.slice@0.0.6",
6 + "scope": null,
7 + "escapedName": "arraybuffer.slice",
8 + "name": "arraybuffer.slice",
9 + "rawSpec": "0.0.6",
10 + "spec": "0.0.6",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser"
14 + ]
15 + ],
16 + "_from": "arraybuffer.slice@0.0.6",
17 + "_id": "arraybuffer.slice@0.0.6",
18 + "_inCache": true,
19 + "_location": "/arraybuffer.slice",
20 + "_npmUser": {
21 + "name": "rase-",
22 + "email": "tonykovanen@hotmail.com"
23 + },
24 + "_npmVersion": "1.3.5",
25 + "_phantomChildren": {},
26 + "_requested": {
27 + "raw": "arraybuffer.slice@0.0.6",
28 + "scope": null,
29 + "escapedName": "arraybuffer.slice",
30 + "name": "arraybuffer.slice",
31 + "rawSpec": "0.0.6",
32 + "spec": "0.0.6",
33 + "type": "version"
34 + },
35 + "_requiredBy": [
36 + "/engine.io-parser"
37 + ],
38 + "_resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz",
39 + "_shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca",
40 + "_shrinkwrap": null,
41 + "_spec": "arraybuffer.slice@0.0.6",
42 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser",
43 + "bugs": {
44 + "url": "https://github.com/rase-/arraybuffer.slice/issues"
45 + },
46 + "dependencies": {},
47 + "description": "Exports a function for slicing ArrayBuffers (no polyfilling)",
48 + "devDependencies": {
49 + "expect.js": "0.2.0",
50 + "mocha": "1.17.1"
51 + },
52 + "directories": {},
53 + "dist": {
54 + "shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca",
55 + "tarball": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz"
56 + },
57 + "homepage": "https://github.com/rase-/arraybuffer.slice",
58 + "maintainers": [
59 + {
60 + "name": "rase-",
61 + "email": "tonykovanen@hotmail.com"
62 + }
63 + ],
64 + "name": "arraybuffer.slice",
65 + "optionalDependencies": {},
66 + "readme": "ERROR: No README data found!",
67 + "repository": {
68 + "type": "git",
69 + "url": "git+ssh://git@github.com/rase-/arraybuffer.slice.git"
70 + },
71 + "version": "0.0.6"
72 +}
1 +/*
2 + * Test dependencies
3 + */
4 +
5 +var sliceBuffer = require('../index.js');
6 +var expect = require('expect.js');
7 +
8 +/**
9 + * Tests
10 + */
11 +
12 +describe('sliceBuffer', function() {
13 + describe('using standard slice', function() {
14 + it('should slice correctly with only start provided', function() {
15 + var abv = new Uint8Array(10);
16 + for (var i = 0; i < abv.length; i++) {
17 + abv[i] = i;
18 + }
19 +
20 + var sliced = sliceBuffer(abv.buffer, 3);
21 + var sabv = new Uint8Array(sliced);
22 + for (var i = 3, ii = 0; i < abv.length; i++, ii++) {
23 + expect(abv[i]).to.equal(sabv[ii]);
24 + }
25 + });
26 +
27 + it('should slice correctly with start and end provided', function() {
28 + var abv = new Uint8Array(10);
29 + for (var i = 0; i < abv.length; i++) {
30 + abv[i] = i;
31 + }
32 +
33 + var sliced = sliceBuffer(abv.buffer, 3, 8);
34 + var sabv = new Uint8Array(sliced);
35 + for (var i = 3, ii = 0; i < 8; i++, ii++) {
36 + expect(abv[i]).to.equal(sabv[ii]);
37 + }
38 + });
39 +
40 + it('should slice correctly with negative start', function() {
41 + var abv = new Uint8Array(10);
42 + for (var i = 0; i < abv.length; i++) {
43 + abv[i] = i;
44 + }
45 +
46 + var sliced = sliceBuffer(abv.buffer, -3);
47 + var sabv = new Uint8Array(sliced);
48 + for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) {
49 + expect(abv[i]).to.equal(sabv[ii]);
50 + }
51 + });
52 +
53 + it('should slice correctly with negative end', function() {
54 + var abv = new Uint8Array(10);
55 + for (var i = 0; i < abv.length; i++) {
56 + abv[i] = i;
57 + }
58 +
59 + var sliced = sliceBuffer(abv.buffer, 0, -3);
60 + var sabv = new Uint8Array(sliced);
61 + for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) {
62 + expect(abv[i]).to.equal(sabv[ii]);
63 + }
64 + });
65 +
66 + it('should slice correctly with negative start and end', function() {
67 + var abv = new Uint8Array(10);
68 + for (var i = 0; i < abv.length; i++) {
69 + abv[i] = i;
70 + }
71 +
72 + var sliced = sliceBuffer(abv.buffer, -6, -3);
73 + var sabv = new Uint8Array(sliced);
74 + for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) {
75 + expect(abv[i]).to.equal(sabv[ii]);
76 + }
77 + });
78 +
79 + it('should slice correctly with equal start and end', function() {
80 + var abv = new Uint8Array(10);
81 + for (var i = 0; i < abv.length; i++) {
82 + abv[i] = i;
83 + }
84 +
85 + var sliced = sliceBuffer(abv.buffer, 1, 1);
86 + expect(sliced.byteLength).to.equal(0);
87 + });
88 +
89 + it('should slice correctly when end larger than buffer', function() {
90 + var abv = new Uint8Array(10);
91 + for (var i = 0; i < abv.length; i++) {
92 + abv[i] = i;
93 + }
94 +
95 + var sliced = sliceBuffer(abv.buffer, 0, 100);
96 + expect(new Uint8Array(sliced)).to.eql(abv);
97 + });
98 +
99 + it('shoud slice correctly when start larger than end', function() {
100 + var abv = new Uint8Array(10);
101 + for (var i = 0; i < abv.length; i++) {
102 + abv[i] = i;
103 + }
104 +
105 + var sliced = sliceBuffer(abv.buffer, 6, 5);
106 + expect(sliced.byteLength).to.equal(0);
107 + });
108 + });
109 +
110 + describe('using fallback', function() {
111 + it('should slice correctly with only start provided', function() {
112 + var abv = new Uint8Array(10);
113 + for (var i = 0; i < abv.length; i++) {
114 + abv[i] = i;
115 + }
116 + var ab = abv.buffer;
117 + ab.slice = undefined;
118 +
119 + var sliced = sliceBuffer(ab, 3);
120 + var sabv = new Uint8Array(sliced);
121 + for (var i = 3, ii = 0; i < abv.length; i++, ii++) {
122 + expect(abv[i]).to.equal(sabv[ii]);
123 + }
124 + });
125 +
126 + it('should slice correctly with start and end provided', function() {
127 + var abv = new Uint8Array(10);
128 + for (var i = 0; i < abv.length; i++) {
129 + abv[i] = i;
130 + }
131 + var ab = abv.buffer;
132 + ab.slice = undefined;
133 +
134 +
135 + var sliced = sliceBuffer(ab, 3, 8);
136 + var sabv = new Uint8Array(sliced);
137 + for (var i = 3, ii = 0; i < 8; i++, ii++) {
138 + expect(abv[i]).to.equal(sabv[ii]);
139 + }
140 + });
141 +
142 + it('should slice correctly with negative start', function() {
143 + var abv = new Uint8Array(10);
144 + for (var i = 0; i < abv.length; i++) {
145 + abv[i] = i;
146 + }
147 + var ab = abv.buffer;
148 + ab.slice = undefined;
149 +
150 +
151 + var sliced = sliceBuffer(ab, -3);
152 + var sabv = new Uint8Array(sliced);
153 + for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) {
154 + expect(abv[i]).to.equal(sabv[ii]);
155 + }
156 + });
157 +
158 + it('should slice correctly with negative end', function() {
159 + var abv = new Uint8Array(10);
160 + for (var i = 0; i < abv.length; i++) {
161 + abv[i] = i;
162 + }
163 + var ab = abv.buffer;
164 + ab.slice = undefined;
165 +
166 + var sliced = sliceBuffer(ab, 0, -3);
167 + var sabv = new Uint8Array(sliced);
168 + for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) {
169 + expect(abv[i]).to.equal(sabv[ii]);
170 + }
171 + });
172 +
173 + it('should slice correctly with negative start and end', function() {
174 + var abv = new Uint8Array(10);
175 + for (var i = 0; i < abv.length; i++) {
176 + abv[i] = i;
177 + }
178 + var ab = abv.buffer;
179 + ab.slice = undefined;
180 +
181 + var sliced = sliceBuffer(ab, -6, -3);
182 + var sabv = new Uint8Array(sliced);
183 + for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) {
184 + expect(abv[i]).to.equal(sabv[ii]);
185 + }
186 + });
187 +
188 + it('should slice correctly with equal start and end', function() {
189 + var abv = new Uint8Array(10);
190 + for (var i = 0; i < abv.length; i++) {
191 + abv[i] = i;
192 + }
193 + var ab = abv.buffer;
194 + ab.slice = undefined;
195 +
196 + var sliced = sliceBuffer(ab, 1, 1);
197 + expect(sliced.byteLength).to.equal(0);
198 + });
199 +
200 + it('should slice correctly when end larger than buffer', function() {
201 + var abv = new Uint8Array(10);
202 + for (var i = 0; i < abv.length; i++) {
203 + abv[i] = i;
204 + }
205 + var ab = abv.buffer;
206 + ab.slice = undefined;
207 +
208 + var sliced = sliceBuffer(ab, 0, 100);
209 + var sabv = new Uint8Array(sliced);
210 + for (var i = 0; i < abv.length; i++) {
211 + expect(abv[i]).to.equal(sabv[i]);
212 + }
213 + });
214 +
215 + it('shoud slice correctly when start larger than end', function() {
216 + var abv = new Uint8Array(10);
217 + for (var i = 0; i < abv.length; i++) {
218 + abv[i] = i;
219 + }
220 + var ab = abv.buffer;
221 + ab.slice = undefined;
222 +
223 + var sliced = sliceBuffer(ab, 6, 5);
224 + expect(sliced.byteLength).to.equal(0);
225 + });
226 + });
227 +});
1 +
2 +1.0.1 / 2014-02-17
3 +==================
4 +
5 + * go away decimal point
6 + * history
7 +
8 +1.0.0 / 2014-02-17
9 +==================
10 +
11 + * add jitter option
12 + * Initial commit
1 +
2 +test:
3 + @./node_modules/.bin/mocha \
4 + --require should \
5 + --reporter dot \
6 + --bail
7 +
8 +.PHONY: test
...\ No newline at end of file ...\ No newline at end of file
1 +# backo
2 +
3 + Simple exponential backoff because the others seem to have weird abstractions.
4 +
5 +## Installation
6 +
7 +```
8 +$ npm install backo
9 +```
10 +
11 +## Options
12 +
13 + - `min` initial timeout in milliseconds [100]
14 + - `max` max timeout [10000]
15 + - `jitter` [0]
16 + - `factor` [2]
17 +
18 +## Example
19 +
20 +```js
21 +var Backoff = require('backo');
22 +var backoff = new Backoff({ min: 100, max: 20000 });
23 +
24 +setTimeout(function(){
25 + something.reconnect();
26 +}, backoff.duration());
27 +
28 +// later when something works
29 +backoff.reset()
30 +```
31 +
32 +# License
33 +
34 + MIT
1 +{
2 + "name": "backo",
3 + "repo": "segmentio/backo",
4 + "dependencies": {},
5 + "version": "1.0.1",
6 + "description": "simple backoff without the weird abstractions",
7 + "keywords": ["backoff"],
8 + "license": "MIT",
9 + "scripts": ["index.js"],
10 + "main": "index.js"
11 +}
1 +
2 +/**
3 + * Expose `Backoff`.
4 + */
5 +
6 +module.exports = Backoff;
7 +
8 +/**
9 + * Initialize backoff timer with `opts`.
10 + *
11 + * - `min` initial timeout in milliseconds [100]
12 + * - `max` max timeout [10000]
13 + * - `jitter` [0]
14 + * - `factor` [2]
15 + *
16 + * @param {Object} opts
17 + * @api public
18 + */
19 +
20 +function Backoff(opts) {
21 + opts = opts || {};
22 + this.ms = opts.min || 100;
23 + this.max = opts.max || 10000;
24 + this.factor = opts.factor || 2;
25 + this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
26 + this.attempts = 0;
27 +}
28 +
29 +/**
30 + * Return the backoff duration.
31 + *
32 + * @return {Number}
33 + * @api public
34 + */
35 +
36 +Backoff.prototype.duration = function(){
37 + var ms = this.ms * Math.pow(this.factor, this.attempts++);
38 + if (this.jitter) {
39 + var rand = Math.random();
40 + var deviation = Math.floor(rand * this.jitter * ms);
41 + ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
42 + }
43 + return Math.min(ms, this.max) | 0;
44 +};
45 +
46 +/**
47 + * Reset the number of attempts.
48 + *
49 + * @api public
50 + */
51 +
52 +Backoff.prototype.reset = function(){
53 + this.attempts = 0;
54 +};
55 +
56 +/**
57 + * Set the minimum duration
58 + *
59 + * @api public
60 + */
61 +
62 +Backoff.prototype.setMin = function(min){
63 + this.ms = min;
64 +};
65 +
66 +/**
67 + * Set the maximum duration
68 + *
69 + * @api public
70 + */
71 +
72 +Backoff.prototype.setMax = function(max){
73 + this.max = max;
74 +};
75 +
76 +/**
77 + * Set the jitter
78 + *
79 + * @api public
80 + */
81 +
82 +Backoff.prototype.setJitter = function(jitter){
83 + this.jitter = jitter;
84 +};
85 +
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "backo2@1.0.2",
6 + "scope": null,
7 + "escapedName": "backo2",
8 + "name": "backo2",
9 + "rawSpec": "1.0.2",
10 + "spec": "1.0.2",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\socket.io-client"
14 + ]
15 + ],
16 + "_from": "backo2@1.0.2",
17 + "_id": "backo2@1.0.2",
18 + "_inCache": true,
19 + "_location": "/backo2",
20 + "_npmUser": {
21 + "name": "mokesmokes",
22 + "email": "mokesmokes@gmail.com"
23 + },
24 + "_npmVersion": "1.4.28",
25 + "_phantomChildren": {},
26 + "_requested": {
27 + "raw": "backo2@1.0.2",
28 + "scope": null,
29 + "escapedName": "backo2",
30 + "name": "backo2",
31 + "rawSpec": "1.0.2",
32 + "spec": "1.0.2",
33 + "type": "version"
34 + },
35 + "_requiredBy": [
36 + "/socket.io-client"
37 + ],
38 + "_resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
39 + "_shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947",
40 + "_shrinkwrap": null,
41 + "_spec": "backo2@1.0.2",
42 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\socket.io-client",
43 + "bugs": {
44 + "url": "https://github.com/mokesmokes/backo/issues"
45 + },
46 + "dependencies": {},
47 + "description": "simple backoff based on segmentio/backo",
48 + "devDependencies": {
49 + "mocha": "*",
50 + "should": "*"
51 + },
52 + "directories": {},
53 + "dist": {
54 + "shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947",
55 + "tarball": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz"
56 + },
57 + "gitHead": "3e695bade7756fef2295e8883bf3570a06e5d9ec",
58 + "homepage": "https://github.com/mokesmokes/backo",
59 + "keywords": [
60 + "backoff"
61 + ],
62 + "license": "MIT",
63 + "maintainers": [
64 + {
65 + "name": "mokesmokes",
66 + "email": "mokesmokes@gmail.com"
67 + }
68 + ],
69 + "name": "backo2",
70 + "optionalDependencies": {},
71 + "readme": "ERROR: No README data found!",
72 + "repository": {
73 + "type": "git",
74 + "url": "git+https://github.com/mokesmokes/backo.git"
75 + },
76 + "scripts": {},
77 + "version": "1.0.2"
78 +}
1 +
2 +var Backoff = require('..');
3 +var assert = require('assert');
4 +
5 +describe('.duration()', function(){
6 + it('should increase the backoff', function(){
7 + var b = new Backoff;
8 +
9 + assert(100 == b.duration());
10 + assert(200 == b.duration());
11 + assert(400 == b.duration());
12 + assert(800 == b.duration());
13 +
14 + b.reset();
15 + assert(100 == b.duration());
16 + assert(200 == b.duration());
17 + })
18 +})
...\ No newline at end of file ...\ No newline at end of file
1 +/node_modules/
2 +Gruntfile.js
3 +/test/
1 +language: node_js
2 +node_js:
3 +- '0.12'
4 +- iojs-1
5 +- iojs-2
6 +- iojs-3
7 +- '4.1'
8 +before_script:
9 +- npm install
10 +before_install: npm install -g npm@'>=2.13.5'
11 +deploy:
12 + provider: npm
13 + email: niklasvh@gmail.com
14 + api_key:
15 + secure: oHV9ArprTj5WOk7MP1UF7QMJ70huXw+y7xXb5wF4+V2H8Hyfa5TfE0DiOmqrube1WXTeH1FLgq54shp/sJWi47Hkg/GyeoB5NnsPhYEaJkaON9UG5blML+ODiNVsEnq/1kNBQ8e0+0JItMPLGySKyFmuZ3yflulXKS8O88mfINo=
16 + on:
17 + tags: true
18 + branch: master
19 + repo: niklasvh/base64-arraybuffer
1 +Copyright (c) 2012 Niklas von Hertzen
2 +
3 +Permission is hereby granted, free of charge, to any person
4 +obtaining a copy of this software and associated documentation
5 +files (the "Software"), to deal in the Software without
6 +restriction, including without limitation the rights to use,
7 +copy, modify, merge, publish, distribute, sublicense, and/or sell
8 +copies of the Software, and to permit persons to whom the
9 +Software is furnished to do so, subject to the following
10 +conditions:
11 +
12 +The above copyright notice and this permission notice shall be
13 +included in all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 +OTHER DEALINGS IN THE SOFTWARE.
1 +# base64-arraybuffer
2 +
3 +[![Build Status](https://travis-ci.org/niklasvh/base64-arraybuffer.png)](https://travis-ci.org/niklasvh/base64-arraybuffer)
4 +[![NPM Downloads](https://img.shields.io/npm/dm/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer)
5 +[![NPM Version](https://img.shields.io/npm/v/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer)
6 +
7 +Encode/decode base64 data into ArrayBuffers
8 +
9 +## Getting Started
10 +Install the module with: `npm install base64-arraybuffer`
11 +
12 +## API
13 +The library encodes and decodes base64 to and from ArrayBuffers
14 +
15 + - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string
16 + - __decode(str)__ - Decodes base64 string to `ArrayBuffer`
17 +
18 +## License
19 +Copyright (c) 2012 Niklas von Hertzen
20 +Licensed under the MIT license.
1 +/*
2 + * base64-arraybuffer
3 + * https://github.com/niklasvh/base64-arraybuffer
4 + *
5 + * Copyright (c) 2012 Niklas von Hertzen
6 + * Licensed under the MIT license.
7 + */
8 +(function(){
9 + "use strict";
10 +
11 + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
12 +
13 + // Use a lookup table to find the index.
14 + var lookup = new Uint8Array(256);
15 + for (var i = 0; i < chars.length; i++) {
16 + lookup[chars.charCodeAt(i)] = i;
17 + }
18 +
19 + exports.encode = function(arraybuffer) {
20 + var bytes = new Uint8Array(arraybuffer),
21 + i, len = bytes.length, base64 = "";
22 +
23 + for (i = 0; i < len; i+=3) {
24 + base64 += chars[bytes[i] >> 2];
25 + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
26 + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
27 + base64 += chars[bytes[i + 2] & 63];
28 + }
29 +
30 + if ((len % 3) === 2) {
31 + base64 = base64.substring(0, base64.length - 1) + "=";
32 + } else if (len % 3 === 1) {
33 + base64 = base64.substring(0, base64.length - 2) + "==";
34 + }
35 +
36 + return base64;
37 + };
38 +
39 + exports.decode = function(base64) {
40 + var bufferLength = base64.length * 0.75,
41 + len = base64.length, i, p = 0,
42 + encoded1, encoded2, encoded3, encoded4;
43 +
44 + if (base64[base64.length - 1] === "=") {
45 + bufferLength--;
46 + if (base64[base64.length - 2] === "=") {
47 + bufferLength--;
48 + }
49 + }
50 +
51 + var arraybuffer = new ArrayBuffer(bufferLength),
52 + bytes = new Uint8Array(arraybuffer);
53 +
54 + for (i = 0; i < len; i+=4) {
55 + encoded1 = lookup[base64.charCodeAt(i)];
56 + encoded2 = lookup[base64.charCodeAt(i+1)];
57 + encoded3 = lookup[base64.charCodeAt(i+2)];
58 + encoded4 = lookup[base64.charCodeAt(i+3)];
59 +
60 + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
61 + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
62 + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
63 + }
64 +
65 + return arraybuffer;
66 + };
67 +})();
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "base64-arraybuffer@0.1.5",
6 + "scope": null,
7 + "escapedName": "base64-arraybuffer",
8 + "name": "base64-arraybuffer",
9 + "rawSpec": "0.1.5",
10 + "spec": "0.1.5",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser"
14 + ]
15 + ],
16 + "_from": "base64-arraybuffer@0.1.5",
17 + "_id": "base64-arraybuffer@0.1.5",
18 + "_inCache": true,
19 + "_location": "/base64-arraybuffer",
20 + "_nodeVersion": "2.5.0",
21 + "_npmUser": {
22 + "name": "niklasvh",
23 + "email": "niklasvh@gmail.com"
24 + },
25 + "_npmVersion": "3.4.0",
26 + "_phantomChildren": {},
27 + "_requested": {
28 + "raw": "base64-arraybuffer@0.1.5",
29 + "scope": null,
30 + "escapedName": "base64-arraybuffer",
31 + "name": "base64-arraybuffer",
32 + "rawSpec": "0.1.5",
33 + "spec": "0.1.5",
34 + "type": "version"
35 + },
36 + "_requiredBy": [
37 + "/engine.io-parser",
38 + "/socket.io-client"
39 + ],
40 + "_resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
41 + "_shasum": "73926771923b5a19747ad666aa5cd4bf9c6e9ce8",
42 + "_shrinkwrap": null,
43 + "_spec": "base64-arraybuffer@0.1.5",
44 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser",
45 + "author": {
46 + "name": "Niklas von Hertzen",
47 + "email": "niklasvh@gmail.com",
48 + "url": "http://hertzen.com"
49 + },
50 + "bugs": {
51 + "url": "https://github.com/niklasvh/base64-arraybuffer/issues"
52 + },
53 + "dependencies": {},
54 + "description": "Encode/decode base64 data into ArrayBuffers",
55 + "devDependencies": {
56 + "grunt": "^0.4.5",
57 + "grunt-cli": "^0.1.13",
58 + "grunt-contrib-jshint": "^0.11.2",
59 + "grunt-contrib-nodeunit": "^0.4.1",
60 + "grunt-contrib-watch": "^0.6.1"
61 + },
62 + "directories": {},
63 + "dist": {
64 + "shasum": "73926771923b5a19747ad666aa5cd4bf9c6e9ce8",
65 + "tarball": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz"
66 + },
67 + "engines": {
68 + "node": ">= 0.6.0"
69 + },
70 + "gitHead": "e9457ccb7b140f5ae54a2880c8e9b967ffb03a7d",
71 + "homepage": "https://github.com/niklasvh/base64-arraybuffer",
72 + "keywords": [],
73 + "licenses": [
74 + {
75 + "type": "MIT",
76 + "url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT"
77 + }
78 + ],
79 + "main": "lib/base64-arraybuffer",
80 + "maintainers": [
81 + {
82 + "name": "niklasvh",
83 + "email": "niklasvh@gmail.com"
84 + }
85 + ],
86 + "name": "base64-arraybuffer",
87 + "optionalDependencies": {},
88 + "readme": "ERROR: No README data found!",
89 + "repository": {
90 + "type": "git",
91 + "url": "git+https://github.com/niklasvh/base64-arraybuffer.git"
92 + },
93 + "scripts": {
94 + "test": "grunt nodeunit"
95 + },
96 + "version": "0.1.5"
97 +}
1 +support
2 +test
3 +examples
1 +(The MIT License)
2 +
3 +Copyright (c) 2012-2016 Kristian Faeldt <faeldt_kristian@cyberagent.co.jp>
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining
6 +a copy of this software and associated documentation files (the
7 +'Software'), to deal in the Software without restriction, including
8 +without limitation the rights to use, copy, modify, merge, publish,
9 +distribute, sublicense, and/or sell copies of the Software, and to
10 +permit persons to whom the Software is furnished to do so, subject to
11 +the following conditions:
12 +
13 +The above copyright notice and this permission notice shall be
14 +included in all copies or substantial portions of the Software.
15 +
16 +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 +base64id
2 +========
3 +
4 +Node.js module that generates a base64 id.
5 +
6 +Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4.
7 +
8 +To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes.
9 +
10 +## Installation
11 +
12 + $ npm install base64id
13 +
14 +## Usage
15 +
16 + var base64id = require('base64id');
17 +
18 + var id = base64id.generateId();
1 +/*!
2 + * base64id v0.1.0
3 + */
4 +
5 +/**
6 + * Module dependencies
7 + */
8 +
9 +var crypto = require('crypto');
10 +
11 +/**
12 + * Constructor
13 + */
14 +
15 +var Base64Id = function() { };
16 +
17 +/**
18 + * Get random bytes
19 + *
20 + * Uses a buffer if available, falls back to crypto.randomBytes
21 + */
22 +
23 +Base64Id.prototype.getRandomBytes = function(bytes) {
24 +
25 + var BUFFER_SIZE = 4096
26 + var self = this;
27 +
28 + bytes = bytes || 12;
29 +
30 + if (bytes > BUFFER_SIZE) {
31 + return crypto.randomBytes(bytes);
32 + }
33 +
34 + var bytesInBuffer = parseInt(BUFFER_SIZE/bytes);
35 + var threshold = parseInt(bytesInBuffer*0.85);
36 +
37 + if (!threshold) {
38 + return crypto.randomBytes(bytes);
39 + }
40 +
41 + if (this.bytesBufferIndex == null) {
42 + this.bytesBufferIndex = -1;
43 + }
44 +
45 + if (this.bytesBufferIndex == bytesInBuffer) {
46 + this.bytesBuffer = null;
47 + this.bytesBufferIndex = -1;
48 + }
49 +
50 + // No buffered bytes available or index above threshold
51 + if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) {
52 +
53 + if (!this.isGeneratingBytes) {
54 + this.isGeneratingBytes = true;
55 + crypto.randomBytes(BUFFER_SIZE, function(err, bytes) {
56 + self.bytesBuffer = bytes;
57 + self.bytesBufferIndex = 0;
58 + self.isGeneratingBytes = false;
59 + });
60 + }
61 +
62 + // Fall back to sync call when no buffered bytes are available
63 + if (this.bytesBufferIndex == -1) {
64 + return crypto.randomBytes(bytes);
65 + }
66 + }
67 +
68 + var result = this.bytesBuffer.slice(bytes*this.bytesBufferIndex, bytes*(this.bytesBufferIndex+1));
69 + this.bytesBufferIndex++;
70 +
71 + return result;
72 +}
73 +
74 +/**
75 + * Generates a base64 id
76 + *
77 + * (Original version from socket.io <http://socket.io>)
78 + */
79 +
80 +Base64Id.prototype.generateId = function () {
81 + var rand = new Buffer(15); // multiple of 3 for base64
82 + if (!rand.writeInt32BE) {
83 + return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString()
84 + + Math.abs(Math.random() * Math.random() * Date.now() | 0).toString();
85 + }
86 + this.sequenceNumber = (this.sequenceNumber + 1) | 0;
87 + rand.writeInt32BE(this.sequenceNumber, 11);
88 + if (crypto.randomBytes) {
89 + this.getRandomBytes(12).copy(rand);
90 + } else {
91 + // not secure for node 0.4
92 + [0, 4, 8].forEach(function(i) {
93 + rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i);
94 + });
95 + }
96 + return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-');
97 +};
98 +
99 +/**
100 + * Export
101 + */
102 +
103 +exports = module.exports = new Base64Id();
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "base64id@1.0.0",
6 + "scope": null,
7 + "escapedName": "base64id",
8 + "name": "base64id",
9 + "rawSpec": "1.0.0",
10 + "spec": "1.0.0",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io"
14 + ]
15 + ],
16 + "_from": "base64id@1.0.0",
17 + "_id": "base64id@1.0.0",
18 + "_inCache": true,
19 + "_location": "/base64id",
20 + "_nodeVersion": "4.4.7",
21 + "_npmOperationalInternal": {
22 + "host": "packages-18-east.internal.npmjs.com",
23 + "tmp": "tmp/base64id-1.0.0.tgz_1480551701495_0.042360062478110194"
24 + },
25 + "_npmUser": {
26 + "name": "darrachequesne",
27 + "email": "damien.arrachequesne@gmail.com"
28 + },
29 + "_npmVersion": "2.15.8",
30 + "_phantomChildren": {},
31 + "_requested": {
32 + "raw": "base64id@1.0.0",
33 + "scope": null,
34 + "escapedName": "base64id",
35 + "name": "base64id",
36 + "rawSpec": "1.0.0",
37 + "spec": "1.0.0",
38 + "type": "version"
39 + },
40 + "_requiredBy": [
41 + "/engine.io"
42 + ],
43 + "_resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
44 + "_shasum": "47688cb99bb6804f0e06d3e763b1c32e57d8e6b6",
45 + "_shrinkwrap": null,
46 + "_spec": "base64id@1.0.0",
47 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io",
48 + "author": {
49 + "name": "Kristian Faeldt",
50 + "email": "faeldt_kristian@cyberagent.co.jp"
51 + },
52 + "bugs": {
53 + "url": "https://github.com/faeldt/base64id/issues"
54 + },
55 + "dependencies": {},
56 + "description": "Generates a base64 id",
57 + "devDependencies": {},
58 + "directories": {},
59 + "dist": {
60 + "shasum": "47688cb99bb6804f0e06d3e763b1c32e57d8e6b6",
61 + "tarball": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz"
62 + },
63 + "engines": {
64 + "node": ">= 0.4.0"
65 + },
66 + "gitHead": "3c846f0818ff88b683ad39fde2f8e015ce0f9807",
67 + "homepage": "https://github.com/faeldt/base64id#readme",
68 + "license": "MIT",
69 + "main": "./lib/base64id.js",
70 + "maintainers": [
71 + {
72 + "name": "darrachequesne",
73 + "email": "damien.arrachequesne@gmail.com"
74 + },
75 + {
76 + "name": "faeldt_kristian",
77 + "email": "kristian.faeldt@gmail.com"
78 + }
79 + ],
80 + "name": "base64id",
81 + "optionalDependencies": {},
82 + "readme": "ERROR: No README data found!",
83 + "repository": {
84 + "type": "git",
85 + "url": "git+https://github.com/faeldt/base64id.git"
86 + },
87 + "scripts": {},
88 + "version": "1.0.0"
89 +}
1 +support
2 +test
3 +examples
4 +*.sock
1 +
2 +1.0.0 / 2013-02-03
3 +==================
4 +
5 + * Stop using the removed magic __stack global getter
6 +
7 +0.1.0 / 2012-10-04
8 +==================
9 +
10 + * add throwing of AssertionError for test frameworks etc
11 +
12 +0.0.1 / 2010-01-03
13 +==================
14 +
15 + * Initial release
1 +
2 +test:
3 + @echo "populate me"
4 +
5 +.PHONY: test
...\ No newline at end of file ...\ No newline at end of file
1 +
2 +# better-assert
3 +
4 + Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for
5 + self-documenting failure messages.
6 +
7 +## Installation
8 +
9 + $ npm install better-assert
10 +
11 +## Example
12 +
13 + By default assertions are enabled, however the __NO_ASSERT__ environment variable
14 + will deactivate them when truthy.
15 +
16 +```js
17 +var assert = require('better-assert');
18 +
19 +test();
20 +
21 +function test() {
22 + var user = { name: 'tobi' };
23 + assert('tobi' == user.name);
24 + assert('number' == typeof user.age);
25 +}
26 +
27 +AssertionError: 'number' == typeof user.age
28 + at test (/Users/tj/projects/better-assert/example.js:9:3)
29 + at Object.<anonymous> (/Users/tj/projects/better-assert/example.js:4:1)
30 + at Module._compile (module.js:449:26)
31 + at Object.Module._extensions..js (module.js:467:10)
32 + at Module.load (module.js:356:32)
33 + at Function.Module._load (module.js:312:12)
34 + at Module.runMain (module.js:492:10)
35 + at process.startup.processNextTick.process._tickCallback (node.js:244:9)
36 +```
37 +
38 +## License
39 +
40 +(The MIT License)
41 +
42 +Copyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
43 +
44 +Permission is hereby granted, free of charge, to any person obtaining
45 +a copy of this software and associated documentation files (the
46 +'Software'), to deal in the Software without restriction, including
47 +without limitation the rights to use, copy, modify, merge, publish,
48 +distribute, sublicense, and/or sell copies of the Software, and to
49 +permit persons to whom the Software is furnished to do so, subject to
50 +the following conditions:
51 +
52 +The above copyright notice and this permission notice shall be
53 +included in all copies or substantial portions of the Software.
54 +
55 +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
56 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
57 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
58 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
59 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
60 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
61 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
...\ No newline at end of file ...\ No newline at end of file
1 +
2 +var assert = require('./');
3 +
4 +test();
5 +
6 +function test() {
7 + var user = { name: 'tobi' };
8 + assert('tobi' == user.name);
9 + assert('number' == typeof user.age);
10 +}
...\ No newline at end of file ...\ No newline at end of file
1 +/**
2 + * Module dependencies.
3 + */
4 +
5 +var AssertionError = require('assert').AssertionError
6 + , callsite = require('callsite')
7 + , fs = require('fs')
8 +
9 +/**
10 + * Expose `assert`.
11 + */
12 +
13 +module.exports = process.env.NO_ASSERT
14 + ? function(){}
15 + : assert;
16 +
17 +/**
18 + * Assert the given `expr`.
19 + */
20 +
21 +function assert(expr) {
22 + if (expr) return;
23 +
24 + var stack = callsite();
25 + var call = stack[1];
26 + var file = call.getFileName();
27 + var lineno = call.getLineNumber();
28 + var src = fs.readFileSync(file, 'utf8');
29 + var line = src.split('\n')[lineno-1];
30 + var src = line.match(/assert\((.*)\)/)[1];
31 +
32 + var err = new AssertionError({
33 + message: src,
34 + stackStartFunction: stack[0].getFunction()
35 + });
36 +
37 + throw err;
38 +}
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "better-assert@~1.0.0",
6 + "scope": null,
7 + "escapedName": "better-assert",
8 + "name": "better-assert",
9 + "rawSpec": "~1.0.0",
10 + "spec": ">=1.0.0 <1.1.0",
11 + "type": "range"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\parsejson"
14 + ]
15 + ],
16 + "_from": "better-assert@>=1.0.0 <1.1.0",
17 + "_id": "better-assert@1.0.2",
18 + "_inCache": true,
19 + "_location": "/better-assert",
20 + "_npmUser": {
21 + "name": "tony_ado",
22 + "email": "coolhzb@163.com"
23 + },
24 + "_npmVersion": "1.4.9",
25 + "_phantomChildren": {},
26 + "_requested": {
27 + "raw": "better-assert@~1.0.0",
28 + "scope": null,
29 + "escapedName": "better-assert",
30 + "name": "better-assert",
31 + "rawSpec": "~1.0.0",
32 + "spec": ">=1.0.0 <1.1.0",
33 + "type": "range"
34 + },
35 + "_requiredBy": [
36 + "/parsejson",
37 + "/parseqs",
38 + "/parseuri"
39 + ],
40 + "_resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
41 + "_shasum": "40866b9e1b9e0b55b481894311e68faffaebc522",
42 + "_shrinkwrap": null,
43 + "_spec": "better-assert@~1.0.0",
44 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\parsejson",
45 + "author": {
46 + "name": "TJ Holowaychuk",
47 + "email": "tj@vision-media.ca"
48 + },
49 + "bugs": {
50 + "url": "https://github.com/visionmedia/better-assert/issues"
51 + },
52 + "contributors": [
53 + {
54 + "name": "TonyHe",
55 + "email": "coolhzb@163.com"
56 + },
57 + {
58 + "name": "ForbesLindesay"
59 + }
60 + ],
61 + "dependencies": {
62 + "callsite": "1.0.0"
63 + },
64 + "description": "Better assertions for node, reporting the expr, filename, lineno etc",
65 + "devDependencies": {},
66 + "directories": {},
67 + "dist": {
68 + "shasum": "40866b9e1b9e0b55b481894311e68faffaebc522",
69 + "tarball": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz"
70 + },
71 + "engines": {
72 + "node": "*"
73 + },
74 + "homepage": "https://github.com/visionmedia/better-assert",
75 + "keywords": [
76 + "assert",
77 + "stack",
78 + "trace",
79 + "debug"
80 + ],
81 + "main": "index",
82 + "maintainers": [
83 + {
84 + "name": "tjholowaychuk",
85 + "email": "tj@vision-media.ca"
86 + },
87 + {
88 + "name": "tony_ado",
89 + "email": "coolhzb@163.com"
90 + }
91 + ],
92 + "name": "better-assert",
93 + "optionalDependencies": {},
94 + "readme": "ERROR: No README data found!",
95 + "repository": {
96 + "type": "git",
97 + "url": "git+https://github.com/visionmedia/better-assert.git"
98 + },
99 + "version": "1.0.2"
100 +}
1 +node_modules
2 +blob.js
1 +ui: mocha-bdd
2 +browsers:
3 + - name: chrome
4 + version: 8..latest
5 + - name: firefox
6 + version: 7..latest
7 + - name: safari
8 + version: 6..latest
9 + - name: opera
10 + version: 12.1..latest
11 + - name: ie
12 + version: 10..latest
13 + - name: android
14 + version: latest
1 +REPORTER = dot
2 +
3 +build: blob.js
4 +
5 +blob.js:
6 + @./node_modules/.bin/browserify --standalone blob index.js > blob.js
7 +
8 +test:
9 + @./node_modules/.bin/zuul -- test/index.js
10 +
11 +clean:
12 + rm blob.js
13 +
14 +.PHONY: test blob.js
1 +Blob
2 +====
3 +
4 +A module that exports a constructor that uses window.Blob when available, and a BlobBuilder with any vendor prefix in other cases. If neither is available, it exports undefined.
5 +
6 +Usage:
7 +
8 +```javascript
9 +var Blob = require('blob');
10 +var b = new Blob(['hi', 'constructing', 'a', 'blob']);
11 +```
12 +
13 +## Licence
14 +MIT
1 +/**
2 + * Create a blob builder even when vendor prefixes exist
3 + */
4 +
5 +var BlobBuilder = global.BlobBuilder
6 + || global.WebKitBlobBuilder
7 + || global.MSBlobBuilder
8 + || global.MozBlobBuilder;
9 +
10 +/**
11 + * Check if Blob constructor is supported
12 + */
13 +
14 +var blobSupported = (function() {
15 + try {
16 + var a = new Blob(['hi']);
17 + return a.size === 2;
18 + } catch(e) {
19 + return false;
20 + }
21 +})();
22 +
23 +/**
24 + * Check if Blob constructor supports ArrayBufferViews
25 + * Fails in Safari 6, so we need to map to ArrayBuffers there.
26 + */
27 +
28 +var blobSupportsArrayBufferView = blobSupported && (function() {
29 + try {
30 + var b = new Blob([new Uint8Array([1,2])]);
31 + return b.size === 2;
32 + } catch(e) {
33 + return false;
34 + }
35 +})();
36 +
37 +/**
38 + * Check if BlobBuilder is supported
39 + */
40 +
41 +var blobBuilderSupported = BlobBuilder
42 + && BlobBuilder.prototype.append
43 + && BlobBuilder.prototype.getBlob;
44 +
45 +/**
46 + * Helper function that maps ArrayBufferViews to ArrayBuffers
47 + * Used by BlobBuilder constructor and old browsers that didn't
48 + * support it in the Blob constructor.
49 + */
50 +
51 +function mapArrayBufferViews(ary) {
52 + for (var i = 0; i < ary.length; i++) {
53 + var chunk = ary[i];
54 + if (chunk.buffer instanceof ArrayBuffer) {
55 + var buf = chunk.buffer;
56 +
57 + // if this is a subarray, make a copy so we only
58 + // include the subarray region from the underlying buffer
59 + if (chunk.byteLength !== buf.byteLength) {
60 + var copy = new Uint8Array(chunk.byteLength);
61 + copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
62 + buf = copy.buffer;
63 + }
64 +
65 + ary[i] = buf;
66 + }
67 + }
68 +}
69 +
70 +function BlobBuilderConstructor(ary, options) {
71 + options = options || {};
72 +
73 + var bb = new BlobBuilder();
74 + mapArrayBufferViews(ary);
75 +
76 + for (var i = 0; i < ary.length; i++) {
77 + bb.append(ary[i]);
78 + }
79 +
80 + return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
81 +};
82 +
83 +function BlobConstructor(ary, options) {
84 + mapArrayBufferViews(ary);
85 + return new Blob(ary, options || {});
86 +};
87 +
88 +module.exports = (function() {
89 + if (blobSupported) {
90 + return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;
91 + } else if (blobBuilderSupported) {
92 + return BlobBuilderConstructor;
93 + } else {
94 + return undefined;
95 + }
96 +})();
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "blob@0.0.4",
6 + "scope": null,
7 + "escapedName": "blob",
8 + "name": "blob",
9 + "rawSpec": "0.0.4",
10 + "spec": "0.0.4",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser"
14 + ]
15 + ],
16 + "_from": "blob@0.0.4",
17 + "_id": "blob@0.0.4",
18 + "_inCache": true,
19 + "_location": "/blob",
20 + "_npmUser": {
21 + "name": "rase-",
22 + "email": "tonykovanen@hotmail.com"
23 + },
24 + "_npmVersion": "1.4.6",
25 + "_phantomChildren": {},
26 + "_requested": {
27 + "raw": "blob@0.0.4",
28 + "scope": null,
29 + "escapedName": "blob",
30 + "name": "blob",
31 + "rawSpec": "0.0.4",
32 + "spec": "0.0.4",
33 + "type": "version"
34 + },
35 + "_requiredBy": [
36 + "/engine.io-parser"
37 + ],
38 + "_resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz",
39 + "_shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921",
40 + "_shrinkwrap": null,
41 + "_spec": "blob@0.0.4",
42 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-parser",
43 + "bugs": {
44 + "url": "https://github.com/rase-/blob/issues"
45 + },
46 + "dependencies": {},
47 + "description": "Abstracts out Blob and uses BlobBulder in cases where it is supported with any vendor prefix.",
48 + "devDependencies": {
49 + "browserify": "3.30.1",
50 + "expect.js": "0.2.0",
51 + "mocha": "1.17.1",
52 + "zuul": "1.5.4"
53 + },
54 + "directories": {},
55 + "dist": {
56 + "shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921",
57 + "tarball": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz"
58 + },
59 + "homepage": "https://github.com/rase-/blob",
60 + "maintainers": [
61 + {
62 + "name": "rase-",
63 + "email": "tonykovanen@hotmail.com"
64 + }
65 + ],
66 + "name": "blob",
67 + "optionalDependencies": {},
68 + "readme": "ERROR: No README data found!",
69 + "repository": {
70 + "type": "git",
71 + "url": "git+ssh://git@github.com/rase-/blob.git"
72 + },
73 + "scripts": {
74 + "test": "make test"
75 + },
76 + "version": "0.0.4"
77 +}
1 +var Blob = require('../');
2 +var expect = require('expect.js');
3 +
4 +describe('blob', function() {
5 + if (!Blob) {
6 + it('should not have a blob or a blob builder in the global namespace, or blob should not be a constructor function if the module exports false', function() {
7 + try {
8 + var ab = (new Uint8Array(5)).buffer;
9 + global.Blob([ab]);
10 + expect().fail('Blob shouldn\'t be constructable');
11 + } catch (e) {}
12 +
13 + var BlobBuilder = global.BlobBuilder
14 + || global.WebKitBlobBuilder
15 + || global.MSBlobBuilder
16 + || global.MozBlobBuilder;
17 + expect(BlobBuilder).to.be(undefined);
18 + });
19 + } else {
20 + it('should encode a proper sized blob when given a string argument', function() {
21 + var b = new Blob(['hi']);
22 + expect(b.size).to.be(2);
23 + });
24 +
25 + it('should encode a blob with proper size when given two strings as arguments', function() {
26 + var b = new Blob(['hi', 'hello']);
27 + expect(b.size).to.be(7);
28 + });
29 +
30 + it('should encode arraybuffers with right content', function(done) {
31 + var ary = new Uint8Array(5);
32 + for (var i = 0; i < 5; i++) ary[i] = i;
33 + var b = new Blob([ary.buffer]);
34 + var fr = new FileReader();
35 + fr.onload = function() {
36 + var newAry = new Uint8Array(this.result);
37 + for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
38 + done();
39 + };
40 + fr.readAsArrayBuffer(b);
41 + });
42 +
43 + it('should encode typed arrays with right content', function(done) {
44 + var ary = new Uint8Array(5);
45 + for (var i = 0; i < 5; i++) ary[i] = i;
46 + var b = new Blob([ary]);
47 + var fr = new FileReader();
48 + fr.onload = function() {
49 + var newAry = new Uint8Array(this.result);
50 + for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
51 + done();
52 + };
53 + fr.readAsArrayBuffer(b);
54 + });
55 +
56 + it('should encode sliced typed arrays with right content', function(done) {
57 + var ary = new Uint8Array(5);
58 + for (var i = 0; i < 5; i++) ary[i] = i;
59 + var b = new Blob([ary.subarray(2)]);
60 + var fr = new FileReader();
61 + fr.onload = function() {
62 + var newAry = new Uint8Array(this.result);
63 + for (var i = 0; i < 3; i++) expect(newAry[i]).to.be(i + 2);
64 + done();
65 + };
66 + fr.readAsArrayBuffer(b);
67 + });
68 +
69 + it('should encode with blobs', function(done) {
70 + var ary = new Uint8Array(5);
71 + for (var i = 0; i < 5; i++) ary[i] = i;
72 + var b = new Blob([new Blob([ary.buffer])]);
73 + var fr = new FileReader();
74 + fr.onload = function() {
75 + var newAry = new Uint8Array(this.result);
76 + for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
77 + done();
78 + };
79 + fr.readAsArrayBuffer(b);
80 + });
81 +
82 + it('should enode mixed contents to right size', function() {
83 + var ary = new Uint8Array(5);
84 + for (var i = 0; i < 5; i++) ary[i] = i;
85 + var b = new Blob([ary.buffer, 'hello']);
86 + expect(b.size).to.be(10);
87 + });
88 +
89 + it('should accept mime type', function() {
90 + var b = new Blob(['hi', 'hello'], { type: 'text/html' });
91 + expect(b.type).to.be('text/html');
92 + });
93 + }
94 +});
1 +support
2 +test
3 +examples
4 +*.sock
1 +
2 +1.0.0 / 2013-01-24
3 +==================
4 +
5 + * remove lame magical getters
6 +
7 +0.0.1 / 2010-01-03
8 +==================
9 +
10 + * Initial release
1 +
2 +test:
3 + @./node_modules/.bin/mocha \
4 + --require should
5 +
6 +.PHONY: test
...\ No newline at end of file ...\ No newline at end of file
1 +# callstack
2 +
3 + Access to v8's "raw" `CallSite`s.
4 +
5 +## Installation
6 +
7 + $ npm install callsite
8 +
9 +## Example
10 +
11 +```js
12 +var stack = require('callsite');
13 +
14 +foo();
15 +
16 +function foo() {
17 + bar();
18 +}
19 +
20 +function bar() {
21 + baz();
22 +}
23 +
24 +function baz() {
25 + console.log();
26 + stack().forEach(function(site){
27 + console.log(' \033[36m%s\033[90m in %s:%d\033[0m'
28 + , site.getFunctionName() || 'anonymous'
29 + , site.getFileName()
30 + , site.getLineNumber());
31 + });
32 + console.log();
33 +}
34 +```
35 +
36 +## Why?
37 +
38 + Because you can do weird, stupid, clever, wacky things such as:
39 +
40 + - [better-assert](https://github.com/visionmedia/better-assert)
41 +
42 +## License
43 +
44 + MIT
1 +
2 +module.exports = function(){
3 + var orig = Error.prepareStackTrace;
4 + Error.prepareStackTrace = function(_, stack){ return stack; };
5 + var err = new Error;
6 + Error.captureStackTrace(err, arguments.callee);
7 + var stack = err.stack;
8 + Error.prepareStackTrace = orig;
9 + return stack;
10 +};
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "callsite@1.0.0",
6 + "scope": null,
7 + "escapedName": "callsite",
8 + "name": "callsite",
9 + "rawSpec": "1.0.0",
10 + "spec": "1.0.0",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\better-assert"
14 + ]
15 + ],
16 + "_from": "callsite@1.0.0",
17 + "_id": "callsite@1.0.0",
18 + "_inCache": true,
19 + "_location": "/callsite",
20 + "_npmUser": {
21 + "name": "tjholowaychuk",
22 + "email": "tj@vision-media.ca"
23 + },
24 + "_npmVersion": "1.2.2",
25 + "_phantomChildren": {},
26 + "_requested": {
27 + "raw": "callsite@1.0.0",
28 + "scope": null,
29 + "escapedName": "callsite",
30 + "name": "callsite",
31 + "rawSpec": "1.0.0",
32 + "spec": "1.0.0",
33 + "type": "version"
34 + },
35 + "_requiredBy": [
36 + "/better-assert"
37 + ],
38 + "_resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
39 + "_shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20",
40 + "_shrinkwrap": null,
41 + "_spec": "callsite@1.0.0",
42 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\better-assert",
43 + "author": {
44 + "name": "TJ Holowaychuk",
45 + "email": "tj@vision-media.ca"
46 + },
47 + "dependencies": {},
48 + "description": "access to v8's CallSites",
49 + "devDependencies": {
50 + "mocha": "*",
51 + "should": "*"
52 + },
53 + "directories": {},
54 + "dist": {
55 + "shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20",
56 + "tarball": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz"
57 + },
58 + "engines": {
59 + "node": "*"
60 + },
61 + "keywords": [
62 + "stack",
63 + "trace",
64 + "line"
65 + ],
66 + "main": "index",
67 + "maintainers": [
68 + {
69 + "name": "tjholowaychuk",
70 + "email": "tj@vision-media.ca"
71 + }
72 + ],
73 + "name": "callsite",
74 + "optionalDependencies": {},
75 + "readme": "ERROR: No README data found!",
76 + "version": "1.0.0"
77 +}
1 +support
2 +test
3 +examples
4 +*.sock
1 +
2 +1.0.0 / 2014-05-27
3 +==================
4 +
5 + * index: use slice ref (#7, @viatropos)
6 + * package: rename package to "component-bind"
7 + * package: add "repository" field (#6, @repoify)
8 + * package: add "component" section
9 +
10 +0.0.1 / 2010-01-03
11 +==================
12 +
13 + * Initial release
1 +
2 +test:
3 + @./node_modules/.bin/mocha \
4 + --require should \
5 + --reporter spec
6 +
7 +.PHONY: test
...\ No newline at end of file ...\ No newline at end of file
1 +# bind
2 +
3 + Function binding utility.
4 +
5 +## Installation
6 +
7 +```
8 +$ component install component/bind
9 +```
10 +
11 +## API
12 +
13 + - [bind(obj, fn)](#bindobj-fn)
14 + - [bind(obj, fn, ...)](#bindobj-fn-)
15 + - [bind(obj, name)](#bindobj-name)
16 +<a name=""></a>
17 +
18 +<a name="bindobj-fn"></a>
19 +### bind(obj, fn)
20 +should bind the function to the given object.
21 +
22 +```js
23 +var tobi = { name: 'tobi' };
24 +
25 +function name() {
26 + return this.name;
27 +}
28 +
29 +var fn = bind(tobi, name);
30 +fn().should.equal('tobi');
31 +```
32 +
33 +<a name="bindobj-fn-"></a>
34 +### bind(obj, fn, ...)
35 +should curry the remaining arguments.
36 +
37 +```js
38 +function add(a, b) {
39 + return a + b;
40 +}
41 +
42 +bind(null, add)(1, 2).should.equal(3);
43 +bind(null, add, 1)(2).should.equal(3);
44 +bind(null, add, 1, 2)().should.equal(3);
45 +```
46 +
47 +<a name="bindobj-name"></a>
48 +### bind(obj, name)
49 +should bind the method of the given name.
50 +
51 +```js
52 +var tobi = { name: 'tobi' };
53 +
54 +tobi.getName = function() {
55 + return this.name;
56 +};
57 +
58 +var fn = bind(tobi, 'getName');
59 +fn().should.equal('tobi');
60 +```
61 +
62 +## License
63 +
64 + MIT
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "name": "bind",
3 + "version": "1.0.0",
4 + "description": "function binding utility",
5 + "keywords": [
6 + "bind",
7 + "utility"
8 + ],
9 + "dependencies": {},
10 + "scripts": [
11 + "index.js"
12 + ]
13 +}
1 +/**
2 + * Slice reference.
3 + */
4 +
5 +var slice = [].slice;
6 +
7 +/**
8 + * Bind `obj` to `fn`.
9 + *
10 + * @param {Object} obj
11 + * @param {Function|String} fn or string
12 + * @return {Function}
13 + * @api public
14 + */
15 +
16 +module.exports = function(obj, fn){
17 + if ('string' == typeof fn) fn = obj[fn];
18 + if ('function' != typeof fn) throw new Error('bind() requires a function');
19 + var args = slice.call(arguments, 2);
20 + return function(){
21 + return fn.apply(obj, args.concat(slice.call(arguments)));
22 + }
23 +};
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "component-bind@1.0.0",
6 + "scope": null,
7 + "escapedName": "component-bind",
8 + "name": "component-bind",
9 + "rawSpec": "1.0.0",
10 + "spec": "1.0.0",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\socket.io-client"
14 + ]
15 + ],
16 + "_from": "component-bind@1.0.0",
17 + "_id": "component-bind@1.0.0",
18 + "_inCache": true,
19 + "_location": "/component-bind",
20 + "_npmUser": {
21 + "name": "tootallnate",
22 + "email": "nathan@tootallnate.net"
23 + },
24 + "_npmVersion": "1.4.9",
25 + "_phantomChildren": {},
26 + "_requested": {
27 + "raw": "component-bind@1.0.0",
28 + "scope": null,
29 + "escapedName": "component-bind",
30 + "name": "component-bind",
31 + "rawSpec": "1.0.0",
32 + "spec": "1.0.0",
33 + "type": "version"
34 + },
35 + "_requiredBy": [
36 + "/socket.io-client"
37 + ],
38 + "_resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
39 + "_shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1",
40 + "_shrinkwrap": null,
41 + "_spec": "component-bind@1.0.0",
42 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\socket.io-client",
43 + "bugs": {
44 + "url": "https://github.com/component/bind/issues"
45 + },
46 + "component": {
47 + "scripts": {
48 + "bind/index.js": "index.js"
49 + }
50 + },
51 + "dependencies": {},
52 + "description": "function binding utility",
53 + "devDependencies": {
54 + "mocha": "*",
55 + "should": "*"
56 + },
57 + "directories": {},
58 + "dist": {
59 + "shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1",
60 + "tarball": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz"
61 + },
62 + "homepage": "https://github.com/component/bind",
63 + "keywords": [
64 + "bind",
65 + "utility"
66 + ],
67 + "maintainers": [
68 + {
69 + "name": "tootallnate",
70 + "email": "nathan@tootallnate.net"
71 + }
72 + ],
73 + "name": "component-bind",
74 + "optionalDependencies": {},
75 + "readme": "ERROR: No README data found!",
76 + "repository": {
77 + "type": "git",
78 + "url": "git+https://github.com/component/bind.git"
79 + },
80 + "version": "1.0.0"
81 +}
1 +
2 +1.2.1 / 2016-04-18
3 +==================
4 +
5 + * enable client side use
6 +
7 +1.2.0 / 2014-02-12
8 +==================
9 +
10 + * prefix events with `$` to support object prototype method names
11 +
12 +1.1.3 / 2014-06-20
13 +==================
14 +
15 + * republish for npm
16 + * add LICENSE file
17 +
18 +1.1.2 / 2014-02-10
19 +==================
20 +
21 + * package: rename to "component-emitter"
22 + * package: update "main" and "component" fields
23 + * Add license to Readme (same format as the other components)
24 + * created .npmignore
25 + * travis stuff
26 +
27 +1.1.1 / 2013-12-01
28 +==================
29 +
30 + * fix .once adding .on to the listener
31 + * docs: Emitter#off()
32 + * component: add `.repo` prop
33 +
34 +1.1.0 / 2013-10-20
35 +==================
36 +
37 + * add `.addEventListener()` and `.removeEventListener()` aliases
38 +
39 +1.0.1 / 2013-06-27
40 +==================
41 +
42 + * add support for legacy ie
43 +
44 +1.0.0 / 2013-02-26
45 +==================
46 +
47 + * add `.off()` support for removing all listeners
48 +
49 +0.0.6 / 2012-10-08
50 +==================
51 +
52 + * add `this._callbacks` initialization to prevent funky gotcha
53 +
54 +0.0.5 / 2012-09-07
55 +==================
56 +
57 + * fix `Emitter.call(this)` usage
58 +
59 +0.0.3 / 2012-07-11
60 +==================
61 +
62 + * add `.listeners()`
63 + * rename `.has()` to `.hasListeners()`
64 +
65 +0.0.2 / 2012-06-28
66 +==================
67 +
68 + * fix `.off()` with `.once()`-registered callbacks
1 +(The MIT License)
2 +
3 +Copyright (c) 2014 Component contributors <dev@component.io>
4 +
5 +Permission is hereby granted, free of charge, to any person
6 +obtaining a copy of this software and associated documentation
7 +files (the "Software"), to deal in the Software without
8 +restriction, including without limitation the rights to use,
9 +copy, modify, merge, publish, distribute, sublicense, and/or sell
10 +copies of the Software, and to permit persons to whom the
11 +Software is furnished to do so, subject to the following
12 +conditions:
13 +
14 +The above copyright notice and this permission notice shall be
15 +included in all copies or substantial portions of the Software.
16 +
17 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 +OTHER DEALINGS IN THE SOFTWARE.
1 +# Emitter [![Build Status](https://travis-ci.org/component/emitter.png)](https://travis-ci.org/component/emitter)
2 +
3 + Event emitter component.
4 +
5 +## Installation
6 +
7 +```
8 +$ component install component/emitter
9 +```
10 +
11 +## API
12 +
13 +### Emitter(obj)
14 +
15 + The `Emitter` may also be used as a mixin. For example
16 + a "plain" object may become an emitter, or you may
17 + extend an existing prototype.
18 +
19 + As an `Emitter` instance:
20 +
21 +```js
22 +var Emitter = require('emitter');
23 +var emitter = new Emitter;
24 +emitter.emit('something');
25 +```
26 +
27 + As a mixin:
28 +
29 +```js
30 +var Emitter = require('emitter');
31 +var user = { name: 'tobi' };
32 +Emitter(user);
33 +
34 +user.emit('im a user');
35 +```
36 +
37 + As a prototype mixin:
38 +
39 +```js
40 +var Emitter = require('emitter');
41 +Emitter(User.prototype);
42 +```
43 +
44 +### Emitter#on(event, fn)
45 +
46 + Register an `event` handler `fn`.
47 +
48 +### Emitter#once(event, fn)
49 +
50 + Register a single-shot `event` handler `fn`,
51 + removed immediately after it is invoked the
52 + first time.
53 +
54 +### Emitter#off(event, fn)
55 +
56 + * Pass `event` and `fn` to remove a listener.
57 + * Pass `event` to remove all listeners on that event.
58 + * Pass nothing to remove all listeners on all events.
59 +
60 +### Emitter#emit(event, ...)
61 +
62 + Emit an `event` with variable option args.
63 +
64 +### Emitter#listeners(event)
65 +
66 + Return an array of callbacks, or an empty array.
67 +
68 +### Emitter#hasListeners(event)
69 +
70 + Check if this emitter has `event` handlers.
71 +
72 +## License
73 +
74 +MIT
1 +
2 +/**
3 + * Expose `Emitter`.
4 + */
5 +
6 +if (typeof module !== 'undefined') {
7 + module.exports = Emitter;
8 +}
9 +
10 +/**
11 + * Initialize a new `Emitter`.
12 + *
13 + * @api public
14 + */
15 +
16 +function Emitter(obj) {
17 + if (obj) return mixin(obj);
18 +};
19 +
20 +/**
21 + * Mixin the emitter properties.
22 + *
23 + * @param {Object} obj
24 + * @return {Object}
25 + * @api private
26 + */
27 +
28 +function mixin(obj) {
29 + for (var key in Emitter.prototype) {
30 + obj[key] = Emitter.prototype[key];
31 + }
32 + return obj;
33 +}
34 +
35 +/**
36 + * Listen on the given `event` with `fn`.
37 + *
38 + * @param {String} event
39 + * @param {Function} fn
40 + * @return {Emitter}
41 + * @api public
42 + */
43 +
44 +Emitter.prototype.on =
45 +Emitter.prototype.addEventListener = function(event, fn){
46 + this._callbacks = this._callbacks || {};
47 + (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
48 + .push(fn);
49 + return this;
50 +};
51 +
52 +/**
53 + * Adds an `event` listener that will be invoked a single
54 + * time then automatically removed.
55 + *
56 + * @param {String} event
57 + * @param {Function} fn
58 + * @return {Emitter}
59 + * @api public
60 + */
61 +
62 +Emitter.prototype.once = function(event, fn){
63 + function on() {
64 + this.off(event, on);
65 + fn.apply(this, arguments);
66 + }
67 +
68 + on.fn = fn;
69 + this.on(event, on);
70 + return this;
71 +};
72 +
73 +/**
74 + * Remove the given callback for `event` or all
75 + * registered callbacks.
76 + *
77 + * @param {String} event
78 + * @param {Function} fn
79 + * @return {Emitter}
80 + * @api public
81 + */
82 +
83 +Emitter.prototype.off =
84 +Emitter.prototype.removeListener =
85 +Emitter.prototype.removeAllListeners =
86 +Emitter.prototype.removeEventListener = function(event, fn){
87 + this._callbacks = this._callbacks || {};
88 +
89 + // all
90 + if (0 == arguments.length) {
91 + this._callbacks = {};
92 + return this;
93 + }
94 +
95 + // specific event
96 + var callbacks = this._callbacks['$' + event];
97 + if (!callbacks) return this;
98 +
99 + // remove all handlers
100 + if (1 == arguments.length) {
101 + delete this._callbacks['$' + event];
102 + return this;
103 + }
104 +
105 + // remove specific handler
106 + var cb;
107 + for (var i = 0; i < callbacks.length; i++) {
108 + cb = callbacks[i];
109 + if (cb === fn || cb.fn === fn) {
110 + callbacks.splice(i, 1);
111 + break;
112 + }
113 + }
114 + return this;
115 +};
116 +
117 +/**
118 + * Emit `event` with the given args.
119 + *
120 + * @param {String} event
121 + * @param {Mixed} ...
122 + * @return {Emitter}
123 + */
124 +
125 +Emitter.prototype.emit = function(event){
126 + this._callbacks = this._callbacks || {};
127 + var args = [].slice.call(arguments, 1)
128 + , callbacks = this._callbacks['$' + event];
129 +
130 + if (callbacks) {
131 + callbacks = callbacks.slice(0);
132 + for (var i = 0, len = callbacks.length; i < len; ++i) {
133 + callbacks[i].apply(this, args);
134 + }
135 + }
136 +
137 + return this;
138 +};
139 +
140 +/**
141 + * Return array of callbacks for `event`.
142 + *
143 + * @param {String} event
144 + * @return {Array}
145 + * @api public
146 + */
147 +
148 +Emitter.prototype.listeners = function(event){
149 + this._callbacks = this._callbacks || {};
150 + return this._callbacks['$' + event] || [];
151 +};
152 +
153 +/**
154 + * Check if this emitter has `event` handlers.
155 + *
156 + * @param {String} event
157 + * @return {Boolean}
158 + * @api public
159 + */
160 +
161 +Emitter.prototype.hasListeners = function(event){
162 + return !! this.listeners(event).length;
163 +};
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "component-emitter@1.2.1",
6 + "scope": null,
7 + "escapedName": "component-emitter",
8 + "name": "component-emitter",
9 + "rawSpec": "1.2.1",
10 + "spec": "1.2.1",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\socket.io-client"
14 + ]
15 + ],
16 + "_from": "component-emitter@1.2.1",
17 + "_id": "component-emitter@1.2.1",
18 + "_inCache": true,
19 + "_location": "/component-emitter",
20 + "_nodeVersion": "0.12.4",
21 + "_npmOperationalInternal": {
22 + "host": "packages-12-west.internal.npmjs.com",
23 + "tmp": "tmp/component-emitter-1.2.1.tgz_1461005707641_0.14232611074112356"
24 + },
25 + "_npmUser": {
26 + "name": "nami-doc",
27 + "email": "karp@hotmail.fr"
28 + },
29 + "_npmVersion": "2.10.1",
30 + "_phantomChildren": {},
31 + "_requested": {
32 + "raw": "component-emitter@1.2.1",
33 + "scope": null,
34 + "escapedName": "component-emitter",
35 + "name": "component-emitter",
36 + "rawSpec": "1.2.1",
37 + "spec": "1.2.1",
38 + "type": "version"
39 + },
40 + "_requiredBy": [
41 + "/engine.io-client",
42 + "/socket.io-client",
43 + "/socket.io-parser"
44 + ],
45 + "_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
46 + "_shasum": "137918d6d78283f7df7a6b7c5a63e140e69425e6",
47 + "_shrinkwrap": null,
48 + "_spec": "component-emitter@1.2.1",
49 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\socket.io-client",
50 + "bugs": {
51 + "url": "https://github.com/component/emitter/issues"
52 + },
53 + "component": {
54 + "scripts": {
55 + "emitter/index.js": "index.js"
56 + }
57 + },
58 + "dependencies": {},
59 + "description": "Event emitter",
60 + "devDependencies": {
61 + "mocha": "*",
62 + "should": "*"
63 + },
64 + "directories": {},
65 + "dist": {
66 + "shasum": "137918d6d78283f7df7a6b7c5a63e140e69425e6",
67 + "tarball": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz"
68 + },
69 + "files": [
70 + "index.js",
71 + "LICENSE"
72 + ],
73 + "gitHead": "187492ab8028c7221b589bdfd482b715149cd868",
74 + "homepage": "https://github.com/component/emitter#readme",
75 + "license": "MIT",
76 + "main": "index.js",
77 + "maintainers": [
78 + {
79 + "name": "tootallnate",
80 + "email": "nathan@tootallnate.net"
81 + },
82 + {
83 + "name": "hughsk",
84 + "email": "hughskennedy@gmail.com"
85 + },
86 + {
87 + "name": "trevorgerhardt",
88 + "email": "trevorgerhardt@gmail.com"
89 + },
90 + {
91 + "name": "timaschew",
92 + "email": "timaschew@gmail.com"
93 + },
94 + {
95 + "name": "tjholowaychuk",
96 + "email": "tj@vision-media.ca"
97 + },
98 + {
99 + "name": "rauchg",
100 + "email": "rauchg@gmail.com"
101 + },
102 + {
103 + "name": "retrofox",
104 + "email": "rdsuarez@gmail.com"
105 + },
106 + {
107 + "name": "coreh",
108 + "email": "thecoreh@gmail.com"
109 + },
110 + {
111 + "name": "forbeslindesay",
112 + "email": "forbes@lindesay.co.uk"
113 + },
114 + {
115 + "name": "kelonye",
116 + "email": "kelonyemitchel@gmail.com"
117 + },
118 + {
119 + "name": "mattmueller",
120 + "email": "mattmuelle@gmail.com"
121 + },
122 + {
123 + "name": "yields",
124 + "email": "yields@icloud.com"
125 + },
126 + {
127 + "name": "anthonyshort",
128 + "email": "antshort@gmail.com"
129 + },
130 + {
131 + "name": "jongleberry",
132 + "email": "jonathanrichardong@gmail.com"
133 + },
134 + {
135 + "name": "ianstormtaylor",
136 + "email": "ian@ianstormtaylor.com"
137 + },
138 + {
139 + "name": "cristiandouce",
140 + "email": "cristian@gravityonmars.com"
141 + },
142 + {
143 + "name": "swatinem",
144 + "email": "arpad.borsos@googlemail.com"
145 + },
146 + {
147 + "name": "stagas",
148 + "email": "gstagas@gmail.com"
149 + },
150 + {
151 + "name": "amasad",
152 + "email": "amjad.masad@gmail.com"
153 + },
154 + {
155 + "name": "juliangruber",
156 + "email": "julian@juliangruber.com"
157 + },
158 + {
159 + "name": "calvinfo",
160 + "email": "calvin@calv.info"
161 + },
162 + {
163 + "name": "dominicbarnes",
164 + "email": "dominic@dbarnes.info"
165 + },
166 + {
167 + "name": "blakeembrey",
168 + "email": "hello@blakeembrey.com"
169 + },
170 + {
171 + "name": "timoxley",
172 + "email": "secoif@gmail.com"
173 + },
174 + {
175 + "name": "jonathanong",
176 + "email": "jonathanrichardong@gmail.com"
177 + },
178 + {
179 + "name": "queckezz",
180 + "email": "fabian.eichenberger@gmail.com"
181 + },
182 + {
183 + "name": "nami-doc",
184 + "email": "vendethiel@hotmail.fr"
185 + },
186 + {
187 + "name": "clintwood",
188 + "email": "clint@anotherway.co.za"
189 + },
190 + {
191 + "name": "thehydroimpulse",
192 + "email": "dnfagnan@gmail.com"
193 + },
194 + {
195 + "name": "stephenmathieson",
196 + "email": "me@stephenmathieson.com"
197 + },
198 + {
199 + "name": "dfcreative",
200 + "email": "df.creative@gmail.com"
201 + },
202 + {
203 + "name": "defunctzombie",
204 + "email": "shtylman@gmail.com"
205 + }
206 + ],
207 + "name": "component-emitter",
208 + "optionalDependencies": {},
209 + "readme": "ERROR: No README data found!",
210 + "repository": {
211 + "type": "git",
212 + "url": "git+https://github.com/component/emitter.git"
213 + },
214 + "scripts": {
215 + "test": "make test"
216 + },
217 + "version": "1.2.1"
218 +}
1 +components
2 +build
3 +node_modules
1 +
2 +0.0.2 / 2012-09-03
3 +==================
4 +
5 + * fix typo in package.json
1 +
2 +build: components index.js
3 + @component build
4 +
5 +components:
6 + @Component install
7 +
8 +clean:
9 + rm -fr build components template.js
10 +
11 +test:
12 + @node_modules/.bin/mocha \
13 + --require should \
14 + --reporter spec
15 +
16 +.PHONY: clean test
1 +# inherit
2 +
3 + Prototype inheritance utility.
4 +
5 +## Installation
6 +
7 +```
8 +$ component install component/inherit
9 +```
10 +
11 +## Example
12 +
13 +```js
14 +var inherit = require('inherit');
15 +
16 +function Human() {}
17 +function Woman() {}
18 +
19 +inherit(Woman, Human);
20 +```
21 +
22 +## License
23 +
24 + MIT
1 +{
2 + "name": "inherit",
3 + "description": "Prototype inheritance utility",
4 + "version": "0.0.3",
5 + "keywords": ["inherit", "utility"],
6 + "dependencies": {},
7 + "scripts": [
8 + "index.js"
9 + ]
10 +}
1 +
2 +module.exports = function(a, b){
3 + var fn = function(){};
4 + fn.prototype = b.prototype;
5 + a.prototype = new fn;
6 + a.prototype.constructor = a;
7 +};
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "component-inherit@0.0.3",
6 + "scope": null,
7 + "escapedName": "component-inherit",
8 + "name": "component-inherit",
9 + "rawSpec": "0.0.3",
10 + "spec": "0.0.3",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-client"
14 + ]
15 + ],
16 + "_from": "component-inherit@0.0.3",
17 + "_id": "component-inherit@0.0.3",
18 + "_inCache": true,
19 + "_location": "/component-inherit",
20 + "_npmUser": {
21 + "name": "coreh",
22 + "email": "thecoreh@gmail.com"
23 + },
24 + "_npmVersion": "1.3.24",
25 + "_phantomChildren": {},
26 + "_requested": {
27 + "raw": "component-inherit@0.0.3",
28 + "scope": null,
29 + "escapedName": "component-inherit",
30 + "name": "component-inherit",
31 + "rawSpec": "0.0.3",
32 + "spec": "0.0.3",
33 + "type": "version"
34 + },
35 + "_requiredBy": [
36 + "/engine.io-client"
37 + ],
38 + "_resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
39 + "_shasum": "645fc4adf58b72b649d5cae65135619db26ff143",
40 + "_shrinkwrap": null,
41 + "_spec": "component-inherit@0.0.3",
42 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\engine.io-client",
43 + "bugs": {
44 + "url": "https://github.com/component/inherit/issues"
45 + },
46 + "component": {
47 + "scripts": {
48 + "inherit/index.js": "index.js"
49 + }
50 + },
51 + "dependencies": {},
52 + "description": "Prototype inheritance utility",
53 + "devDependencies": {},
54 + "directories": {},
55 + "dist": {
56 + "shasum": "645fc4adf58b72b649d5cae65135619db26ff143",
57 + "tarball": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz"
58 + },
59 + "homepage": "https://github.com/component/inherit",
60 + "keywords": [
61 + "inherit",
62 + "utility"
63 + ],
64 + "maintainers": [
65 + {
66 + "name": "coreh",
67 + "email": "thecoreh@gmail.com"
68 + }
69 + ],
70 + "name": "component-inherit",
71 + "optionalDependencies": {},
72 + "readme": "ERROR: No README data found!",
73 + "repository": {
74 + "type": "git",
75 + "url": "git+https://github.com/component/inherit.git"
76 + },
77 + "version": "0.0.3"
78 +}
1 +
2 +/**
3 + * Module dependencies.
4 + */
5 +
6 +var inherit = require('..');
7 +
8 +describe('inherit(a, b)', function(){
9 + it('should inherit b\'s prototype', function(){
10 + function Loki(){}
11 + function Animal(){}
12 +
13 + Animal.prototype.species = 'unknown';
14 +
15 + inherit(Loki, Animal);
16 +
17 + var loki = new Loki;
18 + loki.species.should.equal('unknown');
19 + loki.constructor.should.equal(Loki);
20 + })
21 +})
...\ No newline at end of file ...\ No newline at end of file
1 +0.5.2 / 2016-12-08
2 +==================
3 +
4 + * Fix `parse` to accept any linear whitespace character
5 +
6 +0.5.1 / 2016-01-17
7 +==================
8 +
9 + * perf: enable strict mode
10 +
11 +0.5.0 / 2014-10-11
12 +==================
13 +
14 + * Add `parse` function
15 +
16 +0.4.0 / 2014-09-21
17 +==================
18 +
19 + * Expand non-Unicode `filename` to the full ISO-8859-1 charset
20 +
21 +0.3.0 / 2014-09-20
22 +==================
23 +
24 + * Add `fallback` option
25 + * Add `type` option
26 +
27 +0.2.0 / 2014-09-19
28 +==================
29 +
30 + * Reduce ambiguity of file names with hex escape in buggy browsers
31 +
32 +0.1.2 / 2014-09-19
33 +==================
34 +
35 + * Fix periodic invalid Unicode filename header
36 +
37 +0.1.1 / 2014-09-19
38 +==================
39 +
40 + * Fix invalid characters appearing in `filename*` parameter
41 +
42 +0.1.0 / 2014-09-18
43 +==================
44 +
45 + * Make the `filename` argument optional
46 +
47 +0.0.0 / 2014-09-18
48 +==================
49 +
50 + * Initial release
1 +(The MIT License)
2 +
3 +Copyright (c) 2014 Douglas Christopher Wilson
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining
6 +a copy of this software and associated documentation files (the
7 +'Software'), to deal in the Software without restriction, including
8 +without limitation the rights to use, copy, modify, merge, publish,
9 +distribute, sublicense, and/or sell copies of the Software, and to
10 +permit persons to whom the Software is furnished to do so, subject to
11 +the following conditions:
12 +
13 +The above copyright notice and this permission notice shall be
14 +included in all copies or substantial portions of the Software.
15 +
16 +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 +# content-disposition
2 +
3 +[![NPM Version][npm-image]][npm-url]
4 +[![NPM Downloads][downloads-image]][downloads-url]
5 +[![Node.js Version][node-version-image]][node-version-url]
6 +[![Build Status][travis-image]][travis-url]
7 +[![Test Coverage][coveralls-image]][coveralls-url]
8 +
9 +Create and parse HTTP `Content-Disposition` header
10 +
11 +## Installation
12 +
13 +```sh
14 +$ npm install content-disposition
15 +```
16 +
17 +## API
18 +
19 +```js
20 +var contentDisposition = require('content-disposition')
21 +```
22 +
23 +### contentDisposition(filename, options)
24 +
25 +Create an attachment `Content-Disposition` header value using the given file name,
26 +if supplied. The `filename` is optional and if no file name is desired, but you
27 +want to specify `options`, set `filename` to `undefined`.
28 +
29 +```js
30 +res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf'))
31 +```
32 +
33 +**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this
34 +header through a means different from `setHeader` in Node.js, you'll want to specify
35 +the `'binary'` encoding in Node.js.
36 +
37 +#### Options
38 +
39 +`contentDisposition` accepts these properties in the options object.
40 +
41 +##### fallback
42 +
43 +If the `filename` option is outside ISO-8859-1, then the file name is actually
44 +stored in a supplemental field for clients that support Unicode file names and
45 +a ISO-8859-1 version of the file name is automatically generated.
46 +
47 +This specifies the ISO-8859-1 file name to override the automatic generation or
48 +disables the generation all together, defaults to `true`.
49 +
50 + - A string will specify the ISO-8859-1 file name to use in place of automatic
51 + generation.
52 + - `false` will disable including a ISO-8859-1 file name and only include the
53 + Unicode version (unless the file name is already ISO-8859-1).
54 + - `true` will enable automatic generation if the file name is outside ISO-8859-1.
55 +
56 +If the `filename` option is ISO-8859-1 and this option is specified and has a
57 +different value, then the `filename` option is encoded in the extended field
58 +and this set as the fallback field, even though they are both ISO-8859-1.
59 +
60 +##### type
61 +
62 +Specifies the disposition type, defaults to `"attachment"`. This can also be
63 +`"inline"`, or any other value (all values except inline are treated like
64 +`attachment`, but can convey additional information if both parties agree to
65 +it). The type is normalized to lower-case.
66 +
67 +### contentDisposition.parse(string)
68 +
69 +```js
70 +var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt');
71 +```
72 +
73 +Parse a `Content-Disposition` header string. This automatically handles extended
74 +("Unicode") parameters by decoding them and providing them under the standard
75 +parameter name. This will return an object with the following properties (examples
76 +are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`):
77 +
78 + - `type`: The disposition type (always lower case). Example: `'attachment'`
79 +
80 + - `parameters`: An object of the parameters in the disposition (name of parameter
81 + always lower case and extended versions replace non-extended versions). Example:
82 + `{filename: "€ rates.txt"}`
83 +
84 +## Examples
85 +
86 +### Send a file for download
87 +
88 +```js
89 +var contentDisposition = require('content-disposition')
90 +var destroy = require('destroy')
91 +var http = require('http')
92 +var onFinished = require('on-finished')
93 +
94 +var filePath = '/path/to/public/plans.pdf'
95 +
96 +http.createServer(function onRequest(req, res) {
97 + // set headers
98 + res.setHeader('Content-Type', 'application/pdf')
99 + res.setHeader('Content-Disposition', contentDisposition(filePath))
100 +
101 + // send file
102 + var stream = fs.createReadStream(filePath)
103 + stream.pipe(res)
104 + onFinished(res, function (err) {
105 + destroy(stream)
106 + })
107 +})
108 +```
109 +
110 +## Testing
111 +
112 +```sh
113 +$ npm test
114 +```
115 +
116 +## References
117 +
118 +- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616]
119 +- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987]
120 +- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266]
121 +- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231]
122 +
123 +[rfc-2616]: https://tools.ietf.org/html/rfc2616
124 +[rfc-5987]: https://tools.ietf.org/html/rfc5987
125 +[rfc-6266]: https://tools.ietf.org/html/rfc6266
126 +[tc-2231]: http://greenbytes.de/tech/tc2231/
127 +
128 +## License
129 +
130 +[MIT](LICENSE)
131 +
132 +[npm-image]: https://img.shields.io/npm/v/content-disposition.svg?style=flat
133 +[npm-url]: https://npmjs.org/package/content-disposition
134 +[node-version-image]: https://img.shields.io/node/v/content-disposition.svg?style=flat
135 +[node-version-url]: https://nodejs.org/en/download
136 +[travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg?style=flat
137 +[travis-url]: https://travis-ci.org/jshttp/content-disposition
138 +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg?style=flat
139 +[coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master
140 +[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg?style=flat
141 +[downloads-url]: https://npmjs.org/package/content-disposition
This diff is collapsed. Click to expand it.
1 +{
2 + "_args": [
3 + [
4 + {
5 + "raw": "content-disposition@0.5.2",
6 + "scope": null,
7 + "escapedName": "content-disposition",
8 + "name": "content-disposition",
9 + "rawSpec": "0.5.2",
10 + "spec": "0.5.2",
11 + "type": "version"
12 + },
13 + "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\express"
14 + ]
15 + ],
16 + "_from": "content-disposition@0.5.2",
17 + "_id": "content-disposition@0.5.2",
18 + "_inCache": true,
19 + "_location": "/content-disposition",
20 + "_nodeVersion": "4.6.0",
21 + "_npmOperationalInternal": {
22 + "host": "packages-18-east.internal.npmjs.com",
23 + "tmp": "tmp/content-disposition-0.5.2.tgz_1481246224565_0.35659545403905213"
24 + },
25 + "_npmUser": {
26 + "name": "dougwilson",
27 + "email": "doug@somethingdoug.com"
28 + },
29 + "_npmVersion": "2.15.9",
30 + "_phantomChildren": {},
31 + "_requested": {
32 + "raw": "content-disposition@0.5.2",
33 + "scope": null,
34 + "escapedName": "content-disposition",
35 + "name": "content-disposition",
36 + "rawSpec": "0.5.2",
37 + "spec": "0.5.2",
38 + "type": "version"
39 + },
40 + "_requiredBy": [
41 + "/express"
42 + ],
43 + "_resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
44 + "_shasum": "0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4",
45 + "_shrinkwrap": null,
46 + "_spec": "content-disposition@0.5.2",
47 + "_where": "C:\\Users\\HyeonJun\\Desktop\\project\\node_modules\\express",
48 + "bugs": {
49 + "url": "https://github.com/jshttp/content-disposition/issues"
50 + },
51 + "contributors": [
52 + {
53 + "name": "Douglas Christopher Wilson",
54 + "email": "doug@somethingdoug.com"
55 + }
56 + ],
57 + "dependencies": {},
58 + "description": "Create and parse Content-Disposition header",
59 + "devDependencies": {
60 + "eslint": "3.11.1",
61 + "eslint-config-standard": "6.2.1",
62 + "eslint-plugin-promise": "3.3.0",
63 + "eslint-plugin-standard": "2.0.1",
64 + "istanbul": "0.4.5",
65 + "mocha": "1.21.5"
66 + },
67 + "directories": {},
68 + "dist": {
69 + "shasum": "0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4",
70 + "tarball": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz"
71 + },
72 + "engines": {
73 + "node": ">= 0.6"
74 + },
75 + "files": [
76 + "LICENSE",
77 + "HISTORY.md",
78 + "README.md",
79 + "index.js"
80 + ],
81 + "gitHead": "2a08417377cf55678c9f870b305f3c6c088920f3",
82 + "homepage": "https://github.com/jshttp/content-disposition#readme",
83 + "keywords": [
84 + "content-disposition",
85 + "http",
86 + "rfc6266",
87 + "res"
88 + ],
89 + "license": "MIT",
90 + "maintainers": [
91 + {
92 + "name": "dougwilson",
93 + "email": "doug@somethingdoug.com"
94 + }
95 + ],
96 + "name": "content-disposition",
97 + "optionalDependencies": {},
98 + "readme": "ERROR: No README data found!",
99 + "repository": {
100 + "type": "git",
101 + "url": "git+https://github.com/jshttp/content-disposition.git"
102 + },
103 + "scripts": {
104 + "lint": "eslint .",
105 + "test": "mocha --reporter spec --bail --check-leaks test/",
106 + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
107 + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
108 + },
109 + "version": "0.5.2"
110 +}
1 +1.0.2 / 2016-05-09
2 +==================
3 +
4 + * perf: enable strict mode
5 +
6 +1.0.1 / 2015-02-13
7 +==================
8 +
9 + * Improve missing `Content-Type` header error message
10 +
11 +1.0.0 / 2015-02-01
12 +==================
13 +
14 + * Initial implementation, derived from `media-typer@0.3.0`
1 +(The MIT License)
2 +
3 +Copyright (c) 2015 Douglas Christopher Wilson
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining
6 +a copy of this software and associated documentation files (the
7 +'Software'), to deal in the Software without restriction, including
8 +without limitation the rights to use, copy, modify, merge, publish,
9 +distribute, sublicense, and/or sell copies of the Software, and to
10 +permit persons to whom the Software is furnished to do so, subject to
11 +the following conditions:
12 +
13 +The above copyright notice and this permission notice shall be
14 +included in all copies or substantial portions of the Software.
15 +
16 +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 +# content-type
2 +
3 +[![NPM Version][npm-image]][npm-url]
4 +[![NPM Downloads][downloads-image]][downloads-url]
5 +[![Node.js Version][node-version-image]][node-version-url]
6 +[![Build Status][travis-image]][travis-url]
7 +[![Test Coverage][coveralls-image]][coveralls-url]
8 +
9 +Create and parse HTTP Content-Type header according to RFC 7231
10 +
11 +## Installation
12 +
13 +```sh
14 +$ npm install content-type
15 +```
16 +
17 +## API
18 +
19 +```js
20 +var contentType = require('content-type')
21 +```
22 +
23 +### contentType.parse(string)
24 +
25 +```js
26 +var obj = contentType.parse('image/svg+xml; charset=utf-8')
27 +```
28 +
29 +Parse a content type string. This will return an object with the following
30 +properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
31 +
32 + - `type`: The media type (the type and subtype, always lower case).
33 + Example: `'image/svg+xml'`
34 +
35 + - `parameters`: An object of the parameters in the media type (name of parameter
36 + always lower case). Example: `{charset: 'utf-8'}`
37 +
38 +Throws a `TypeError` if the string is missing or invalid.
39 +
40 +### contentType.parse(req)
41 +
42 +```js
43 +var obj = contentType.parse(req)
44 +```
45 +
46 +Parse the `content-type` header from the given `req`. Short-cut for
47 +`contentType.parse(req.headers['content-type'])`.
48 +
49 +Throws a `TypeError` if the `Content-Type` header is missing or invalid.
50 +
51 +### contentType.parse(res)
52 +
53 +```js
54 +var obj = contentType.parse(res)
55 +```
56 +
57 +Parse the `content-type` header set on the given `res`. Short-cut for
58 +`contentType.parse(res.getHeader('content-type'))`.
59 +
60 +Throws a `TypeError` if the `Content-Type` header is missing or invalid.
61 +
62 +### contentType.format(obj)
63 +
64 +```js
65 +var str = contentType.format({type: 'image/svg+xml'})
66 +```
67 +
68 +Format an object into a content type string. This will return a string of the
69 +content type for the given object with the following properties (examples are
70 +shown that produce the string `'image/svg+xml; charset=utf-8'`):
71 +
72 + - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
73 +
74 + - `parameters`: An object of the parameters in the media type (name of the
75 + parameter will be lower-cased). Example: `{charset: 'utf-8'}`
76 +
77 +Throws a `TypeError` if the object contains an invalid type or parameter names.
78 +
79 +## License
80 +
81 +[MIT](LICENSE)
82 +
83 +[npm-image]: https://img.shields.io/npm/v/content-type.svg
84 +[npm-url]: https://npmjs.org/package/content-type
85 +[node-version-image]: https://img.shields.io/node/v/content-type.svg
86 +[node-version-url]: http://nodejs.org/download/
87 +[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg
88 +[travis-url]: https://travis-ci.org/jshttp/content-type
89 +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg
90 +[coveralls-url]: https://coveralls.io/r/jshttp/content-type
91 +[downloads-image]: https://img.shields.io/npm/dm/content-type.svg
92 +[downloads-url]: https://npmjs.org/package/content-type
1 +/*!
2 + * content-type
3 + * Copyright(c) 2015 Douglas Christopher Wilson
4 + * MIT Licensed
5 + */
6 +
7 +'use strict'
8 +
9 +/**
10 + * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
11 + *
12 + * parameter = token "=" ( token / quoted-string )
13 + * token = 1*tchar
14 + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
15 + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
16 + * / DIGIT / ALPHA
17 + * ; any VCHAR, except delimiters
18 + * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
19 + * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
20 + * obs-text = %x80-FF
21 + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
22 + */
23 +var paramRegExp = /; *([!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+) */g
24 +var textRegExp = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/
25 +var tokenRegExp = /^[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+$/
26 +
27 +/**
28 + * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
29 + *
30 + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
31 + * obs-text = %x80-FF
32 + */
33 +var qescRegExp = /\\([\u000b\u0020-\u00ff])/g
34 +
35 +/**
36 + * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
37 + */
38 +var quoteRegExp = /([\\"])/g
39 +
40 +/**
41 + * RegExp to match type in RFC 6838
42 + *
43 + * media-type = type "/" subtype
44 + * type = token
45 + * subtype = token
46 + */
47 +var typeRegExp = /^[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+\/[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+$/
48 +
49 +/**
50 + * Module exports.
51 + * @public
52 + */
53 +
54 +exports.format = format
55 +exports.parse = parse
56 +
57 +/**
58 + * Format object to media type.
59 + *
60 + * @param {object} obj
61 + * @return {string}
62 + * @public
63 + */
64 +
65 +function format(obj) {
66 + if (!obj || typeof obj !== 'object') {
67 + throw new TypeError('argument obj is required')
68 + }
69 +
70 + var parameters = obj.parameters
71 + var type = obj.type
72 +
73 + if (!type || !typeRegExp.test(type)) {
74 + throw new TypeError('invalid type')
75 + }
76 +
77 + var string = type
78 +
79 + // append parameters
80 + if (parameters && typeof parameters === 'object') {
81 + var param
82 + var params = Object.keys(parameters).sort()
83 +
84 + for (var i = 0; i < params.length; i++) {
85 + param = params[i]
86 +
87 + if (!tokenRegExp.test(param)) {
88 + throw new TypeError('invalid parameter name')
89 + }
90 +
91 + string += '; ' + param + '=' + qstring(parameters[param])
92 + }
93 + }
94 +
95 + return string
96 +}
97 +
98 +/**
99 + * Parse media type to object.
100 + *
101 + * @param {string|object} string
102 + * @return {Object}
103 + * @public
104 + */
105 +
106 +function parse(string) {
107 + if (!string) {
108 + throw new TypeError('argument string is required')
109 + }
110 +
111 + if (typeof string === 'object') {
112 + // support req/res-like objects as argument
113 + string = getcontenttype(string)
114 +
115 + if (typeof string !== 'string') {
116 + throw new TypeError('content-type header is missing from object');
117 + }
118 + }
119 +
120 + if (typeof string !== 'string') {
121 + throw new TypeError('argument string is required to be a string')
122 + }
123 +
124 + var index = string.indexOf(';')
125 + var type = index !== -1
126 + ? string.substr(0, index).trim()
127 + : string.trim()
128 +
129 + if (!typeRegExp.test(type)) {
130 + throw new TypeError('invalid media type')
131 + }
132 +
133 + var key
134 + var match
135 + var obj = new ContentType(type.toLowerCase())
136 + var value
137 +
138 + paramRegExp.lastIndex = index
139 +
140 + while (match = paramRegExp.exec(string)) {
141 + if (match.index !== index) {
142 + throw new TypeError('invalid parameter format')
143 + }
144 +
145 + index += match[0].length
146 + key = match[1].toLowerCase()
147 + value = match[2]
148 +
149 + if (value[0] === '"') {
150 + // remove quotes and escapes
151 + value = value
152 + .substr(1, value.length - 2)
153 + .replace(qescRegExp, '$1')
154 + }
155 +
156 + obj.parameters[key] = value
157 + }
158 +
159 + if (index !== -1 && index !== string.length) {
160 + throw new TypeError('invalid parameter format')
161 + }
162 +
163 + return obj
164 +}
165 +
166 +/**
167 + * Get content-type from req/res objects.
168 + *
169 + * @param {object}
170 + * @return {Object}
171 + * @private
172 + */
173 +
174 +function getcontenttype(obj) {
175 + if (typeof obj.getHeader === 'function') {
176 + // res-like
177 + return obj.getHeader('content-type')
178 + }
179 +
180 + if (typeof obj.headers === 'object') {
181 + // req-like
182 + return obj.headers && obj.headers['content-type']
183 + }
184 +}
185 +
186 +/**
187 + * Quote a string if necessary.
188 + *
189 + * @param {string} val
190 + * @return {string}
191 + * @private
192 + */
193 +
194 +function qstring(val) {
195 + var str = String(val)
196 +
197 + // no need to quote tokens
198 + if (tokenRegExp.test(str)) {
199 + return str
200 + }
201 +
202 + if (str.length > 0 && !textRegExp.test(str)) {
203 + throw new TypeError('invalid parameter value')
204 + }
205 +
206 + return '"' + str.replace(quoteRegExp, '\\$1') + '"'
207 +}
208 +
209 +/**
210 + * Class to represent a content type.
211 + * @private
212 + */
213 +function ContentType(type) {
214 + this.parameters = Object.create(null)
215 + this.type = type
216 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.