spell 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +35 -166
  2. package/package.json +17 -24
  3. package/.npmignore +0 -4
  4. package/.travis.yml +0 -6
  5. package/LICENSE +0 -14
  6. package/spell.js +0 -347
  7. package/test/css/mocha.css +0 -110
  8. package/test/index.html +0 -34
  9. package/test/lib/JSONStream/.npmignore +0 -3
  10. package/test/lib/JSONStream/bench.js +0 -35
  11. package/test/lib/JSONStream/examples/all_docs.js +0 -13
  12. package/test/lib/JSONStream/index.js +0 -118
  13. package/test/lib/JSONStream/package.json +0 -13
  14. package/test/lib/JSONStream/readme.markdown +0 -120
  15. package/test/lib/JSONStream/test/fixtures/all_docs_include.json +0 -4245
  16. package/test/lib/JSONStream/test/fixtures/all_npm.json +0 -4030
  17. package/test/lib/JSONStream/test/parsejson.js +0 -25
  18. package/test/lib/JSONStream/test/stringify.js +0 -41
  19. package/test/lib/JSONStream/test/test.js +0 -35
  20. package/test/lib/JSONStream/test/test2.js +0 -29
  21. package/test/lib/JSONStream/test/two-ways.js +0 -41
  22. package/test/lib/jquery-1.7.1.min.js +0 -4
  23. package/test/lib/json2.js +0 -487
  24. package/test/lib/mocha-0.3.6.js +0 -2672
  25. package/test/lib/request/LICENSE +0 -55
  26. package/test/lib/request/README.md +0 -285
  27. package/test/lib/request/main.js +0 -618
  28. package/test/lib/request/mimetypes.js +0 -146
  29. package/test/lib/request/oauth.js +0 -34
  30. package/test/lib/request/package.json +0 -15
  31. package/test/lib/request/tests/googledoodle.png +0 -0
  32. package/test/lib/request/tests/run.sh +0 -6
  33. package/test/lib/request/tests/server.js +0 -57
  34. package/test/lib/request/tests/test-body.js +0 -90
  35. package/test/lib/request/tests/test-cookie.js +0 -29
  36. package/test/lib/request/tests/test-cookiejar.js +0 -90
  37. package/test/lib/request/tests/test-errors.js +0 -30
  38. package/test/lib/request/tests/test-oauth.js +0 -109
  39. package/test/lib/request/tests/test-pipes.js +0 -167
  40. package/test/lib/request/tests/test-proxy.js +0 -39
  41. package/test/lib/request/tests/test-timeout.js +0 -87
  42. package/test/lib/request/uuid.js +0 -19
  43. package/test/lib/request/vendor/cookie/index.js +0 -55
  44. package/test/lib/request/vendor/cookie/jar.js +0 -72
  45. package/test/perf.js +0 -44
  46. package/test/resources/big.js +0 -9
  47. package/test/resources/big.json +0 -29159
  48. package/test/resources/big.txt +0 -128457
  49. package/test/resources/big_browser.js +0 -29159
  50. package/test/resources/npm.js +0 -26
  51. package/test/resources/npm.json +0 -84701
  52. package/test/resources/perf1.js +0 -144
  53. package/test/resources/perf2.js +0 -366
  54. package/test/spell.js +0 -295
@@ -1,55 +0,0 @@
1
- Apache License
2
-
3
- Version 2.0, January 2004
4
-
5
- http://www.apache.org/licenses/
6
-
7
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
-
9
- 1. Definitions.
10
-
11
- "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
-
17
- "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
-
19
- "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
-
21
- "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
-
23
- "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
-
25
- "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
-
27
- "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
-
29
- "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
-
31
- 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
-
33
- 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
-
35
- 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
-
37
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
-
39
- You must cause any modified files to carry prominent notices stating that You changed the files; and
40
-
41
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
-
43
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
-
45
- 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
-
47
- 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
-
49
- 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
-
51
- 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
-
53
- 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
-
55
- END OF TERMS AND CONDITIONS
@@ -1,285 +0,0 @@
1
- # Request -- Simplified HTTP request method
2
-
3
- ## Install
4
-
5
- <pre>
6
- npm install request
7
- </pre>
8
-
9
- Or from source:
10
-
11
- <pre>
12
- git clone git://github.com/mikeal/request.git
13
- cd request
14
- npm link
15
- </pre>
16
-
17
- ## Super simple to use
18
-
19
- Request is designed to be the simplest way possible to make http calls. It support HTTPS and follows redirects by default.
20
-
21
- ```javascript
22
- var request = require('request');
23
- request('http://www.google.com', function (error, response, body) {
24
- if (!error && response.statusCode == 200) {
25
- console.log(body) // Print the google web page.
26
- }
27
- })
28
- ```
29
-
30
- ## Streaming
31
-
32
- You can stream any response to a file stream.
33
-
34
- ```javascript
35
- request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))
36
- ```
37
-
38
- You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.
39
-
40
- ```javascript
41
- fs.readStream('file.json').pipe(request.put('http://mysite.com/obj.json'))
42
- ```
43
-
44
- Request can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.
45
-
46
- ```javascript
47
- request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))
48
- ```
49
-
50
- Now let's get fancy.
51
-
52
- ```javascript
53
- http.createServer(function (req, resp) {
54
- if (req.url === '/doodle.png') {
55
- if (req.method === 'PUT') {
56
- req.pipe(request.put('http://mysite.com/doodle.png'))
57
- } else if (req.method === 'GET' || req.method === 'HEAD') {
58
- request.get('http://mysite.com/doodle.png').pipe(resp)
59
- }
60
- }
61
- })
62
- ```
63
-
64
- You can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:
65
-
66
- ```javascript
67
- http.createServer(function (req, resp) {
68
- if (req.url === '/doodle.png') {
69
- var x = request('http://mysite.com/doodle.png')
70
- req.pipe(x)
71
- x.pipe(resp)
72
- }
73
- })
74
- ```
75
-
76
- And since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)
77
-
78
- ```javascript
79
- req.pipe(request('http://mysite.com/doodle.png')).pipe(resp)
80
- ```
81
-
82
- Also, none of this new functionality conflicts with requests previous features, it just expands them.
83
-
84
- ```javascript
85
- var r = request.defaults({'proxy':'http://localproxy.com'})
86
-
87
- http.createServer(function (req, resp) {
88
- if (req.url === '/doodle.png') {
89
- r.get('http://google.com/doodle.png').pipe(resp)
90
- }
91
- })
92
- ```
93
-
94
- You can still use intermediate proxies, the requests will still follow HTTP forwards, etc.
95
-
96
- ## OAuth Signing
97
-
98
- ```javascript
99
- // Twitter OAuth
100
- var qs = require('querystring')
101
- , oauth =
102
- { callback: 'http://mysite.com/callback/'
103
- , consumer_key: CONSUMER_KEY
104
- , consumer_secret: CONSUMER_SECRET
105
- }
106
- , url = 'https://api.twitter.com/oauth/request_token'
107
- ;
108
- request.post({url:url, oauth:oauth}, function (e, r, body) {
109
- // Assume by some stretch of magic you aquired the verifier
110
- var access_token = qs.parse(body)
111
- , oauth =
112
- { consumer_key: CONSUMER_KEY
113
- , consumer_secret: CONSUMER_SECRET
114
- , token: access_token.oauth_token
115
- , verifier: VERIFIER
116
- , token_secret: access_token.oauth_token_secret
117
- }
118
- , url = 'https://api.twitter.com/oauth/access_token'
119
- ;
120
- request.post({url:url, oauth:oauth}, function (e, r, body) {
121
- var perm_token = qs.parse(body)
122
- , oauth =
123
- { consumer_key: CONSUMER_KEY
124
- , consumer_secret: CONSUMER_SECRET
125
- , token: perm_token.oauth_token
126
- , token_secret: perm_token.oauth_token_secret
127
- }
128
- , url = 'https://api.twitter.com/1/users/show.json?'
129
- , params =
130
- { screen_name: perm_token.screen_name
131
- , user_id: perm_token.user_id
132
- }
133
- ;
134
- url += qs.stringify(params)
135
- request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {
136
- console.log(user)
137
- })
138
- })
139
- })
140
- ```
141
-
142
-
143
-
144
- ### request(options, callback)
145
-
146
- The first argument can be either a url or an options object. The only required option is uri, all others are optional.
147
-
148
- * `uri` || `url` - fully qualified uri or a parsed url object from url.parse()
149
- * `method` - http method, defaults to GET
150
- * `headers` - http headers, defaults to {}
151
- * `body` - entity body for POST and PUT requests. Must be buffer or string.
152
- * `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header.
153
- * `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.
154
- * `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.
155
- * `maxRedirects` - the maximum number of redirects to follow, defaults to 10.
156
- * `onResponse` - If true the callback will be fired on the "response" event instead of "end". If a function it will be called on "response" and not effect the regular semantics of the main callback on "end".
157
- * `encoding` - Encoding to be used on response.setEncoding when buffering the response data.
158
- * `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.
159
- * `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.
160
- * `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request
161
- * `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.
162
- * `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.
163
- * `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.
164
- * `jar` - Set to `false` if you don't want cookies to be remembered for future use or define your custom cookie jar (see examples section)
165
-
166
-
167
- The callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second in an http.ClientResponse object. The third is the response body buffer.
168
-
169
- ## Convenience methods
170
-
171
- There are also shorthand methods for different HTTP METHODs and some other conveniences.
172
-
173
- ### request.defaults(options)
174
-
175
- This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.
176
-
177
- ### request.put
178
-
179
- Same as request() but defaults to `method: "PUT"`.
180
-
181
- ```javascript
182
- request.put(url)
183
- ```
184
-
185
- ### request.post
186
-
187
- Same as request() but defaults to `method: "POST"`.
188
-
189
- ```javascript
190
- request.post(url)
191
- ```
192
-
193
- ### request.head
194
-
195
- Same as request() but defaults to `method: "HEAD"`.
196
-
197
- ```javascript
198
- request.head(url)
199
- ```
200
-
201
- ### request.del
202
-
203
- Same as request() but defaults to `method: "DELETE"`.
204
-
205
- ```javascript
206
- request.del(url)
207
- ```
208
-
209
- ### request.get
210
-
211
- Alias to normal request method for uniformity.
212
-
213
- ```javascript
214
- request.get(url)
215
- ```
216
- ### request.cookie
217
-
218
- Function that creates a new cookie.
219
-
220
- ```javascript
221
- request.cookie('cookie_string_here')
222
- ```
223
- ### request.jar
224
-
225
- Function that creates a new cookie jar.
226
-
227
- ```javascript
228
- request.jar()
229
- ```
230
-
231
-
232
- ## Examples:
233
-
234
- ```javascript
235
- var request = require('request')
236
- , rand = Math.floor(Math.random()*100000000).toString()
237
- ;
238
- request(
239
- { method: 'PUT'
240
- , uri: 'http://mikeal.iriscouch.com/testjs/' + rand
241
- , multipart:
242
- [ { 'content-type': 'application/json'
243
- , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
244
- }
245
- , { body: 'I am an attachment' }
246
- ]
247
- }
248
- , function (error, response, body) {
249
- if(response.statusCode == 201){
250
- console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)
251
- } else {
252
- console.log('error: '+ response.statusCode)
253
- console.log(body)
254
- }
255
- }
256
- )
257
- ```
258
- Cookies are enabled by default (so they can be used in subsequent requests). To disable cookies set jar to false (either in defaults or in the options sent).
259
-
260
- ```javascript
261
- var request = request.defaults({jar: false})
262
- request('http://www.google.com', function () {
263
- request('http://images.google.com')
264
- })
265
- ```
266
-
267
- If you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:
268
-
269
- ```javascript
270
- var j = request.jar()
271
- var request = request.defaults({jar:j})
272
- request('http://www.google.com', function () {
273
- request('http://images.google.com')
274
- })
275
- ```
276
- OR
277
-
278
- ```javascript
279
- var j = request.jar()
280
- var cookie = request.cookie('your_cookie_here')
281
- j.add(cookie)
282
- request({url: 'http://www.google.com', jar: j}, function () {
283
- request('http://images.google.com')
284
- })
285
- ```