fsevents 1.0.8 → 1.0.9
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.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/ansi-styles/index.js +72 -6
- package/node_modules/ansi-styles/package.json +19 -12
- package/node_modules/ansi-styles/readme.md +36 -8
- package/node_modules/are-we-there-yet/CHANGES.md +19 -0
- package/node_modules/are-we-there-yet/README.md +12 -2
- package/node_modules/are-we-there-yet/index.js +4 -132
- package/node_modules/are-we-there-yet/package.json +18 -13
- package/node_modules/are-we-there-yet/test/lib/test-event.js +29 -0
- package/node_modules/are-we-there-yet/test/tracker.js +44 -43
- package/node_modules/are-we-there-yet/test/trackergroup.js +73 -64
- package/node_modules/are-we-there-yet/test/trackerstream.js +26 -40
- package/node_modules/are-we-there-yet/tracker-base.js +11 -0
- package/node_modules/are-we-there-yet/tracker-group.js +107 -0
- package/node_modules/are-we-there-yet/tracker-stream.js +35 -0
- package/node_modules/are-we-there-yet/tracker.js +30 -0
- package/node_modules/asn1/package.json +1 -2
- package/node_modules/assert-plus/package.json +1 -3
- package/node_modules/async/package.json +1 -1
- package/node_modules/aws4/.npmignore +2 -1
- package/node_modules/aws4/README.md +4 -0
- package/node_modules/aws4/aws4.js +8 -3
- package/node_modules/aws4/node_modules/lru-cache/.npmignore +3 -0
- package/node_modules/aws4/node_modules/lru-cache/.travis.yml +3 -4
- package/node_modules/aws4/node_modules/lru-cache/README.md +29 -24
- package/node_modules/aws4/node_modules/lru-cache/benchmarks/insertion-time.js +32 -0
- package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +333 -199
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE +15 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md +60 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js +9 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json +59 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js +113 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js +86 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore +4 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml +7 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md +4 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE +15 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md +204 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json +59 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js +188 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js +360 -0
- package/node_modules/aws4/node_modules/lru-cache/package.json +16 -12
- package/node_modules/aws4/node_modules/lru-cache/test/basic.js +270 -146
- package/node_modules/aws4/node_modules/lru-cache/test/foreach.js +39 -25
- package/node_modules/aws4/node_modules/lru-cache/test/inspect.js +54 -0
- package/node_modules/aws4/node_modules/lru-cache/test/no-symbol.js +3 -0
- package/node_modules/aws4/node_modules/lru-cache/test/serialize.js +115 -104
- package/node_modules/aws4/package.json +17 -14
- package/node_modules/bl/bl.js +9 -3
- package/node_modules/bl/package.json +12 -12
- package/node_modules/bl/test/test.js +14 -0
- package/node_modules/color-convert/README.md +62 -0
- package/node_modules/color-convert/conversions.js +594 -0
- package/node_modules/color-convert/css-keywords.js +151 -0
- package/node_modules/color-convert/index.js +75 -0
- package/node_modules/color-convert/package.json +92 -0
- package/node_modules/color-convert/route.js +98 -0
- package/node_modules/dashdash/lib/dashdash.js +1 -1
- package/node_modules/dashdash/node_modules/assert-plus/AUTHORS +6 -0
- package/node_modules/dashdash/node_modules/assert-plus/CHANGES.md +14 -0
- package/node_modules/dashdash/node_modules/assert-plus/README.md +162 -0
- package/node_modules/dashdash/node_modules/assert-plus/assert.js +211 -0
- package/node_modules/dashdash/node_modules/assert-plus/package.json +89 -0
- package/node_modules/dashdash/package.json +19 -12
- package/node_modules/ecc-jsbn/package.json +1 -2
- package/node_modules/escape-string-regexp/package.json +15 -11
- package/node_modules/extsprintf/package.json +2 -3
- package/node_modules/form-data/.dockerignore +7 -0
- package/node_modules/form-data/.editorconfig +10 -0
- package/node_modules/form-data/.eslintignore +1 -0
- package/node_modules/form-data/.eslintrc +64 -0
- package/node_modules/form-data/{Readme.md → README.md} +9 -1
- package/node_modules/form-data/lib/browser.js +2 -1
- package/node_modules/form-data/lib/form_data.js +172 -135
- package/node_modules/form-data/lib/populate.js +9 -0
- package/node_modules/form-data/package.json +35 -16
- package/node_modules/form-data/wercker.yml +36 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +14 -10
- package/node_modules/gauge/README.md +1 -1
- package/node_modules/gauge/package.json +18 -14
- package/node_modules/gauge/progress-bar.js +2 -2
- package/node_modules/http-signature/package.json +1 -2
- package/node_modules/is-my-json-valid/README.md +2 -2
- package/node_modules/is-my-json-valid/index.js +15 -6
- package/node_modules/is-my-json-valid/package.json +11 -7
- package/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json +36 -0
- package/node_modules/is-my-json-valid/test/misc.js +18 -0
- package/node_modules/is-typedarray/package.json +1 -2
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +6 -0
- package/node_modules/isarray/index.js +3 -1
- package/node_modules/isarray/package.json +28 -10
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jodid25519/package.json +1 -2
- package/node_modules/jsbn/package.json +1 -2
- package/node_modules/json-schema/package.json +1 -1
- package/node_modules/jsprim/package.json +1 -2
- package/node_modules/lodash.pad/LICENSE +17 -16
- package/node_modules/lodash.pad/README.md +2 -2
- package/node_modules/lodash.pad/index.js +3 -94
- package/node_modules/lodash.pad/package.json +12 -12
- package/node_modules/lodash.padend/LICENSE +23 -0
- package/node_modules/lodash.padend/README.md +18 -0
- package/node_modules/lodash.padend/index.js +285 -0
- package/node_modules/lodash.padend/package.json +91 -0
- package/node_modules/lodash.padstart/LICENSE +23 -0
- package/node_modules/lodash.padstart/README.md +18 -0
- package/node_modules/lodash.padstart/index.js +285 -0
- package/node_modules/lodash.padstart/package.json +91 -0
- package/node_modules/lodash.repeat/LICENSE +17 -16
- package/node_modules/lodash.repeat/README.md +2 -2
- package/node_modules/lodash.repeat/index.js +3 -94
- package/node_modules/lodash.repeat/package.json +14 -13
- package/node_modules/lodash.tostring/LICENSE +23 -0
- package/node_modules/lodash.tostring/README.md +18 -0
- package/node_modules/lodash.tostring/index.js +164 -0
- package/node_modules/lodash.tostring/package.json +91 -0
- package/node_modules/mime-db/HISTORY.md +14 -0
- package/node_modules/mime-db/db.json +26 -3
- package/node_modules/mime-db/package.json +23 -18
- package/node_modules/mime-types/HISTORY.md +8 -0
- package/node_modules/mime-types/README.md +1 -1
- package/node_modules/mime-types/package.json +21 -16
- package/node_modules/node-pre-gyp/CHANGELOG.md +11 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +44 -4
- package/node_modules/node-pre-gyp/package.json +16 -16
- package/node_modules/npmlog/.nyc_output/64996.json +1 -0
- package/node_modules/npmlog/.nyc_output/64998.json +1 -0
- package/node_modules/npmlog/.nyc_output/65000.json +1 -0
- package/node_modules/npmlog/log.js +3 -2
- package/node_modules/npmlog/package.json +15 -11
- package/node_modules/npmlog/test/progress.js +25 -8
- package/node_modules/once/package.json +1 -1
- package/node_modules/qs/package.json +1 -2
- package/node_modules/readable-stream/.travis.yml +18 -16
- package/node_modules/readable-stream/README.md +1 -1
- package/node_modules/readable-stream/doc/stream.markdown +435 -405
- package/node_modules/readable-stream/lib/_stream_duplex.js +13 -20
- package/node_modules/readable-stream/lib/_stream_passthrough.js +3 -4
- package/node_modules/readable-stream/lib/_stream_readable.js +110 -205
- package/node_modules/readable-stream/lib/_stream_transform.js +21 -38
- package/node_modules/readable-stream/lib/_stream_writable.js +108 -121
- package/node_modules/readable-stream/package.json +19 -15
- package/node_modules/request/package.json +1 -2
- package/node_modules/rimraf/node_modules/glob/README.md +6 -0
- package/node_modules/rimraf/node_modules/glob/common.js +12 -3
- package/node_modules/rimraf/node_modules/glob/glob.js +20 -3
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +14 -10
- package/node_modules/rimraf/node_modules/glob/package.json +15 -11
- package/node_modules/rimraf/node_modules/glob/sync.js +8 -1
- package/node_modules/rimraf/package.json +14 -10
- package/node_modules/semver/package.json +1 -2
- package/node_modules/sshpk/lib/formats/rfc4253.js +2 -1
- package/node_modules/sshpk/package.json +13 -10
- package/node_modules/strip-ansi/package.json +21 -16
- package/node_modules/strip-ansi/readme.md +5 -5
- package/node_modules/tough-cookie/lib/cookie.js +2 -2
- package/node_modules/tough-cookie/package.json +13 -9
- package/node_modules/tweetnacl/CHANGELOG.md +53 -0
- package/node_modules/tweetnacl/COPYING.txt +9 -0
- package/node_modules/tweetnacl/README.md +14 -40
- package/node_modules/tweetnacl/nacl-fast.js +21 -51
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -2
- package/node_modules/tweetnacl/nacl.js +21 -51
- package/node_modules/tweetnacl/nacl.min.js +1 -1
- package/node_modules/tweetnacl/package.json +28 -38
- package/node_modules/verror/package.json +2 -3
- package/package.json +2 -2
- package/node_modules/aws4/example.js +0 -372
- package/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +0 -51
- package/node_modules/isarray/build/build.js +0 -209
- package/node_modules/lodash._basetostring/LICENSE +0 -22
- package/node_modules/lodash._basetostring/README.md +0 -20
- package/node_modules/lodash._basetostring/index.js +0 -22
- package/node_modules/lodash._basetostring/package.json +0 -99
- package/node_modules/lodash._createpadding/LICENSE +0 -22
- package/node_modules/lodash._createpadding/README.md +0 -20
- package/node_modules/lodash._createpadding/index.js +0 -37
- package/node_modules/lodash._createpadding/package.json +0 -101
- package/node_modules/lodash._root/LICENSE +0 -22
- package/node_modules/lodash._root/README.md +0 -18
- package/node_modules/lodash._root/index.js +0 -53
- package/node_modules/lodash._root/package.json +0 -77
- package/node_modules/lodash.padleft/LICENSE.txt +0 -22
- package/node_modules/lodash.padleft/README.md +0 -20
- package/node_modules/lodash.padleft/index.js +0 -50
- package/node_modules/lodash.padleft/package.json +0 -107
- package/node_modules/lodash.padright/LICENSE.txt +0 -22
- package/node_modules/lodash.padright/README.md +0 -20
- package/node_modules/lodash.padright/index.js +0 -50
- package/node_modules/lodash.padright/package.json +0 -107
@@ -3,14 +3,15 @@ var LRU = require('../')
|
|
3
3
|
|
4
4
|
test('forEach', function (t) {
|
5
5
|
var l = new LRU(5)
|
6
|
-
|
7
|
-
|
6
|
+
var i
|
7
|
+
for (i = 0; i < 10; i++) {
|
8
|
+
l.set(i, i.toString(2))
|
8
9
|
}
|
9
10
|
|
10
|
-
|
11
|
+
i = 9
|
11
12
|
l.forEach(function (val, key, cache) {
|
12
13
|
t.equal(cache, l)
|
13
|
-
t.equal(key, i
|
14
|
+
t.equal(key, i)
|
14
15
|
t.equal(val, i.toString(2))
|
15
16
|
i -= 1
|
16
17
|
})
|
@@ -20,45 +21,57 @@ test('forEach', function (t) {
|
|
20
21
|
l.get(8)
|
21
22
|
|
22
23
|
var order = [ 8, 6, 9, 7, 5 ]
|
23
|
-
|
24
|
+
i = 0
|
24
25
|
|
25
26
|
l.forEach(function (val, key, cache) {
|
26
|
-
var j = order[i
|
27
|
+
var j = order[i++]
|
27
28
|
t.equal(cache, l)
|
28
|
-
t.equal(key, j
|
29
|
+
t.equal(key, j)
|
29
30
|
t.equal(val, j.toString(2))
|
30
31
|
})
|
31
|
-
t.equal(i, order.length)
|
32
|
+
t.equal(i, order.length)
|
33
|
+
|
34
|
+
i = 0
|
35
|
+
order.reverse()
|
36
|
+
l.rforEach(function (val, key, cache) {
|
37
|
+
var j = order[i++]
|
38
|
+
t.equal(cache, l)
|
39
|
+
t.equal(key, j)
|
40
|
+
t.equal(val, j.toString(2))
|
41
|
+
})
|
42
|
+
t.equal(i, order.length)
|
32
43
|
|
33
44
|
t.end()
|
34
45
|
})
|
35
46
|
|
36
47
|
test('keys() and values()', function (t) {
|
37
48
|
var l = new LRU(5)
|
38
|
-
|
39
|
-
|
49
|
+
var i
|
50
|
+
for (i = 0; i < 10; i++) {
|
51
|
+
l.set(i, i.toString(2))
|
40
52
|
}
|
41
53
|
|
42
|
-
t.similar(l.keys(), [
|
54
|
+
t.similar(l.keys(), [9, 8, 7, 6, 5])
|
43
55
|
t.similar(l.values(), ['1001', '1000', '111', '110', '101'])
|
44
56
|
|
45
57
|
// get in order of most recently used
|
46
58
|
l.get(6)
|
47
59
|
l.get(8)
|
48
60
|
|
49
|
-
t.similar(l.keys(), [
|
61
|
+
t.similar(l.keys(), [8, 6, 9, 7, 5])
|
50
62
|
t.similar(l.values(), ['1000', '110', '1001', '111', '101'])
|
51
63
|
|
52
64
|
t.end()
|
53
65
|
})
|
54
66
|
|
55
|
-
test('all entries are iterated over', function(t) {
|
67
|
+
test('all entries are iterated over', function (t) {
|
56
68
|
var l = new LRU(5)
|
57
|
-
|
69
|
+
var i
|
70
|
+
for (i = 0; i < 10; i++) {
|
58
71
|
l.set(i.toString(), i.toString(2))
|
59
72
|
}
|
60
73
|
|
61
|
-
|
74
|
+
i = 0
|
62
75
|
l.forEach(function (val, key, cache) {
|
63
76
|
if (i > 0) {
|
64
77
|
cache.del(key)
|
@@ -72,13 +85,14 @@ test('all entries are iterated over', function(t) {
|
|
72
85
|
t.end()
|
73
86
|
})
|
74
87
|
|
75
|
-
test('all stale entries are removed', function(t) {
|
88
|
+
test('all stale entries are removed', function (t) {
|
76
89
|
var l = new LRU({ max: 5, maxAge: -5, stale: true })
|
77
|
-
|
90
|
+
var i
|
91
|
+
for (i = 0; i < 10; i++) {
|
78
92
|
l.set(i.toString(), i.toString(2))
|
79
93
|
}
|
80
94
|
|
81
|
-
|
95
|
+
i = 0
|
82
96
|
l.forEach(function () {
|
83
97
|
i += 1
|
84
98
|
})
|
@@ -94,11 +108,12 @@ test('expires', function (t) {
|
|
94
108
|
max: 10,
|
95
109
|
maxAge: 50
|
96
110
|
})
|
97
|
-
|
111
|
+
var i
|
112
|
+
for (i = 0; i < 10; i++) {
|
98
113
|
l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined))
|
99
114
|
}
|
100
115
|
|
101
|
-
|
116
|
+
i = 0
|
102
117
|
var order = [ 8, 6, 4, 2, 0 ]
|
103
118
|
setTimeout(function () {
|
104
119
|
l.forEach(function (val, key, cache) {
|
@@ -107,14 +122,13 @@ test('expires', function (t) {
|
|
107
122
|
t.equal(key, j.toString())
|
108
123
|
t.equal(val, j.toString(2))
|
109
124
|
})
|
110
|
-
t.equal(i, order.length)
|
125
|
+
t.equal(i, order.length)
|
111
126
|
|
112
127
|
setTimeout(function () {
|
113
|
-
var count = 0
|
114
|
-
l.forEach(function (val, key, cache) { count
|
115
|
-
t.equal(0, count)
|
128
|
+
var count = 0
|
129
|
+
l.forEach(function (val, key, cache) { count++ })
|
130
|
+
t.equal(0, count)
|
116
131
|
t.end()
|
117
132
|
}, 25)
|
118
|
-
|
119
133
|
}, 26)
|
120
134
|
})
|
@@ -0,0 +1,54 @@
|
|
1
|
+
// vim: set nowrap:
|
2
|
+
var util = require('util')
|
3
|
+
var t = require('tap')
|
4
|
+
var LRU = require('../')
|
5
|
+
|
6
|
+
var l = LRU()
|
7
|
+
|
8
|
+
function inspect (str) {
|
9
|
+
t.equal(util.inspect(l), str)
|
10
|
+
t.equal(l.inspect(), str)
|
11
|
+
}
|
12
|
+
|
13
|
+
inspect('LRUCache {}')
|
14
|
+
|
15
|
+
l.max = 10
|
16
|
+
inspect('LRUCache {\n max: 10\n}')
|
17
|
+
|
18
|
+
l.maxAge = 50
|
19
|
+
inspect('LRUCache {\n max: 10,\n maxAge: 50\n}')
|
20
|
+
|
21
|
+
l.set({ foo: 'bar' }, 'baz')
|
22
|
+
inspect("LRUCache {\n max: 10,\n maxAge: 50,\n\n { foo: 'bar' } => { value: 'baz' }\n}")
|
23
|
+
|
24
|
+
l.maxAge = 0
|
25
|
+
l.set(1, {a: {b: {c: {d: {e: {f: {}}}}}}})
|
26
|
+
inspect("LRUCache {\n max: 10,\n\n 1 => { value: { a: { b: [Object] } } },\n { foo: 'bar' } => { value: 'baz', maxAge: 50 }\n}")
|
27
|
+
|
28
|
+
l.allowStale = true
|
29
|
+
inspect("LRUCache {\n allowStale: true,\n max: 10,\n\n 1 => { value: { a: { b: [Object] } } },\n { foo: 'bar' } => { value: 'baz', maxAge: 50 }\n}")
|
30
|
+
|
31
|
+
setTimeout(function () {
|
32
|
+
inspect("LRUCache {\n allowStale: true,\n max: 10,\n\n 1 => { value: { a: { b: [Object] } } },\n { foo: 'bar' } => { value: 'baz', maxAge: 50, stale: true }\n}")
|
33
|
+
|
34
|
+
// prune stale items
|
35
|
+
l.forEach(function () {})
|
36
|
+
inspect('LRUCache {\n allowStale: true,\n max: 10,\n\n 1 => { value: { a: { b: [Object] } } }\n}')
|
37
|
+
|
38
|
+
l.lengthCalculator = function () { return 5 }
|
39
|
+
inspect('LRUCache {\n allowStale: true,\n max: 10,\n length: 5,\n\n 1 => { value: { a: { b: [Object] } }, length: 5 }\n}')
|
40
|
+
|
41
|
+
l.max = 0
|
42
|
+
inspect('LRUCache {\n allowStale: true,\n length: 5,\n\n 1 => { value: { a: { b: [Object] } }, length: 5 }\n}')
|
43
|
+
|
44
|
+
l.maxAge = 100
|
45
|
+
inspect('LRUCache {\n allowStale: true,\n maxAge: 100,\n length: 5,\n\n 1 => { value: { a: { b: [Object] } }, maxAge: 0, length: 5 }\n}')
|
46
|
+
l.allowStale = false
|
47
|
+
inspect('LRUCache {\n maxAge: 100,\n length: 5,\n\n 1 => { value: { a: { b: [Object] } }, maxAge: 0, length: 5 }\n}')
|
48
|
+
|
49
|
+
l.maxAge = 0
|
50
|
+
inspect('LRUCache {\n length: 5,\n\n 1 => { value: { a: { b: [Object] } }, length: 5 }\n}')
|
51
|
+
|
52
|
+
l.lengthCalculator = null
|
53
|
+
inspect('LRUCache {\n 1 => { value: { a: { b: [Object] } } }\n}')
|
54
|
+
}, 100)
|
@@ -1,78 +1,87 @@
|
|
1
1
|
var test = require('tap').test
|
2
2
|
var LRU = require('../')
|
3
|
+
var Yallist = require('yallist')
|
3
4
|
|
4
5
|
test('dump', function (t) {
|
5
6
|
var cache = new LRU()
|
6
7
|
|
7
|
-
t.equal(cache.dump().length, 0,
|
8
|
+
t.equal(cache.dump().length, 0, 'nothing in dump for empty cache')
|
8
9
|
|
9
|
-
cache.set(
|
10
|
-
cache.set(
|
10
|
+
cache.set('a', 'A')
|
11
|
+
cache.set('b', 'B')
|
11
12
|
t.deepEqual(cache.dump(), [
|
12
|
-
{ k:
|
13
|
-
{ k:
|
13
|
+
{ k: 'b', v: 'B', e: 0 },
|
14
|
+
{ k: 'a', v: 'A', e: 0 }
|
14
15
|
])
|
15
16
|
|
16
|
-
cache.set(
|
17
|
+
cache.set(123, 456)
|
17
18
|
t.deepEqual(cache.dump(), [
|
18
|
-
{ k:
|
19
|
-
{ k:
|
19
|
+
{ k: 123, v: 456, e: 0 },
|
20
|
+
{ k: 'b', v: 'B', e: 0 },
|
21
|
+
{ k: 'a', v: 'A', e: 0 }
|
20
22
|
])
|
23
|
+
cache.del(123)
|
21
24
|
|
22
|
-
cache.
|
25
|
+
cache.set('a', 'A')
|
23
26
|
t.deepEqual(cache.dump(), [
|
24
|
-
{ k:
|
25
|
-
{ k:
|
27
|
+
{ k: 'a', v: 'A', e: 0 },
|
28
|
+
{ k: 'b', v: 'B', e: 0 }
|
26
29
|
])
|
27
30
|
|
28
|
-
cache.
|
31
|
+
cache.get('b')
|
29
32
|
t.deepEqual(cache.dump(), [
|
30
|
-
{ k:
|
33
|
+
{ k: 'b', v: 'B', e: 0 },
|
34
|
+
{ k: 'a', v: 'A', e: 0 }
|
35
|
+
])
|
36
|
+
|
37
|
+
cache.del('a')
|
38
|
+
t.deepEqual(cache.dump(), [
|
39
|
+
{ k: 'b', v: 'B', e: 0 }
|
31
40
|
])
|
32
41
|
|
33
42
|
t.end()
|
34
43
|
})
|
35
44
|
|
36
|
-
test(
|
45
|
+
test('do not dump stale items', function (t) {
|
37
46
|
var cache = new LRU({
|
38
47
|
max: 5,
|
39
48
|
maxAge: 50
|
40
49
|
})
|
41
50
|
|
42
|
-
//expires at 50
|
43
|
-
cache.set(
|
51
|
+
// expires at 50
|
52
|
+
cache.set('a', 'A')
|
44
53
|
|
45
54
|
setTimeout(function () {
|
46
|
-
//expires at 75
|
47
|
-
cache.set(
|
55
|
+
// expires at 75
|
56
|
+
cache.set('b', 'B')
|
48
57
|
var s = cache.dump()
|
49
58
|
t.equal(s.length, 2)
|
50
|
-
t.equal(s[0].k,
|
51
|
-
t.equal(s[1].k,
|
59
|
+
t.equal(s[0].k, 'b')
|
60
|
+
t.equal(s[1].k, 'a')
|
52
61
|
}, 25)
|
53
62
|
|
54
63
|
setTimeout(function () {
|
55
|
-
//expires at 110
|
56
|
-
cache.set(
|
64
|
+
// expires at 110
|
65
|
+
cache.set('c', 'C')
|
57
66
|
var s = cache.dump()
|
58
67
|
t.equal(s.length, 2)
|
59
|
-
t.equal(s[0].k,
|
60
|
-
t.equal(s[1].k,
|
68
|
+
t.equal(s[0].k, 'c')
|
69
|
+
t.equal(s[1].k, 'b')
|
61
70
|
}, 60)
|
62
71
|
|
63
72
|
setTimeout(function () {
|
64
|
-
//expires at 130
|
65
|
-
cache.set(
|
73
|
+
// expires at 130
|
74
|
+
cache.set('d', 'D', 40)
|
66
75
|
var s = cache.dump()
|
67
76
|
t.equal(s.length, 2)
|
68
|
-
t.equal(s[0].k,
|
69
|
-
t.equal(s[1].k,
|
77
|
+
t.equal(s[0].k, 'd')
|
78
|
+
t.equal(s[1].k, 'c')
|
70
79
|
}, 90)
|
71
80
|
|
72
81
|
setTimeout(function () {
|
73
82
|
var s = cache.dump()
|
74
83
|
t.equal(s.length, 1)
|
75
|
-
t.equal(s[0].k,
|
84
|
+
t.equal(s[0].k, 'd')
|
76
85
|
}, 120)
|
77
86
|
|
78
87
|
setTimeout(function () {
|
@@ -82,12 +91,13 @@ test("do not dump stale items", function(t) {
|
|
82
91
|
}, 155)
|
83
92
|
})
|
84
93
|
|
85
|
-
test(
|
86
|
-
var cache = new LRU()
|
87
|
-
|
94
|
+
test('load basic cache', function (t) {
|
95
|
+
var cache = new LRU()
|
96
|
+
var copy = new LRU()
|
88
97
|
|
89
|
-
cache.set(
|
90
|
-
cache.set(
|
98
|
+
cache.set('a', 'A')
|
99
|
+
cache.set('b', 'B')
|
100
|
+
cache.set(123, 456)
|
91
101
|
|
92
102
|
copy.load(cache.dump())
|
93
103
|
t.deepEquals(cache.dump(), copy.dump())
|
@@ -95,122 +105,123 @@ test("load basic cache", function(t) {
|
|
95
105
|
t.end()
|
96
106
|
})
|
97
107
|
|
108
|
+
test('load staled cache', function (t) {
|
109
|
+
var cache = new LRU({maxAge: 50})
|
110
|
+
var copy = new LRU({maxAge: 50})
|
111
|
+
var arr
|
98
112
|
|
99
|
-
|
100
|
-
|
101
|
-
copy = new LRU({maxAge: 50}),
|
102
|
-
arr
|
103
|
-
|
104
|
-
//expires at 50
|
105
|
-
cache.set("a", "A")
|
113
|
+
// expires at 50
|
114
|
+
cache.set('a', 'A')
|
106
115
|
setTimeout(function () {
|
107
|
-
//expires at 80
|
108
|
-
cache.set(
|
116
|
+
// expires at 80
|
117
|
+
cache.set('b', 'B')
|
109
118
|
arr = cache.dump()
|
110
119
|
t.equal(arr.length, 2)
|
111
120
|
}, 30)
|
112
121
|
|
113
122
|
setTimeout(function () {
|
114
123
|
copy.load(arr)
|
115
|
-
t.equal(copy.get(
|
116
|
-
t.equal(copy.get(
|
124
|
+
t.equal(copy.get('a'), undefined)
|
125
|
+
t.equal(copy.get('b'), 'B')
|
117
126
|
}, 60)
|
118
127
|
|
119
128
|
setTimeout(function () {
|
120
|
-
t.equal(copy.get(
|
129
|
+
t.equal(copy.get('b'), undefined)
|
121
130
|
t.end()
|
122
131
|
}, 90)
|
123
132
|
})
|
124
133
|
|
125
|
-
test(
|
126
|
-
var cache = new LRU({max: 2})
|
127
|
-
|
134
|
+
test('load to other size cache', function (t) {
|
135
|
+
var cache = new LRU({max: 2})
|
136
|
+
var copy = new LRU({max: 1})
|
128
137
|
|
129
|
-
cache.set(
|
130
|
-
cache.set(
|
138
|
+
cache.set('a', 'A')
|
139
|
+
cache.set('b', 'B')
|
131
140
|
|
132
141
|
copy.load(cache.dump())
|
133
|
-
t.equal(copy.get(
|
134
|
-
t.equal(copy.get(
|
142
|
+
t.equal(copy.get('a'), undefined)
|
143
|
+
t.equal(copy.get('b'), 'B')
|
135
144
|
|
136
|
-
//update the last read from original cache
|
137
|
-
cache.get(
|
145
|
+
// update the last read from original cache
|
146
|
+
cache.get('a')
|
138
147
|
copy.load(cache.dump())
|
139
|
-
t.equal(copy.get(
|
140
|
-
t.equal(copy.get(
|
148
|
+
t.equal(copy.get('a'), 'A')
|
149
|
+
t.equal(copy.get('b'), undefined)
|
141
150
|
|
142
151
|
t.end()
|
143
152
|
})
|
144
153
|
|
154
|
+
test('load to other age cache', function (t) {
|
155
|
+
var cache = new LRU({maxAge: 250})
|
156
|
+
var aged = new LRU({maxAge: 500})
|
157
|
+
var simple = new LRU()
|
158
|
+
var arr
|
145
159
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
simple = new LRU(),
|
150
|
-
arr,
|
151
|
-
expired
|
152
|
-
|
153
|
-
//created at 0
|
154
|
-
//a would be valid till 0 + 50
|
155
|
-
cache.set("a", "A")
|
160
|
+
// created at 0
|
161
|
+
// a would be valid till 0 + 250
|
162
|
+
cache.set('a', 'A')
|
156
163
|
setTimeout(function () {
|
157
|
-
//created at 20
|
158
|
-
//b would be valid till
|
159
|
-
cache.set(
|
160
|
-
//b would be valid till
|
161
|
-
cache.set(
|
164
|
+
// created at 20
|
165
|
+
// b would be valid till 100 + 250
|
166
|
+
cache.set('b', 'B')
|
167
|
+
// b would be valid till 100 + 350
|
168
|
+
cache.set('c', 'C', 350)
|
162
169
|
arr = cache.dump()
|
163
170
|
t.equal(arr.length, 3)
|
164
|
-
},
|
171
|
+
}, 100)
|
165
172
|
|
166
173
|
setTimeout(function () {
|
167
|
-
t.equal(cache.get(
|
168
|
-
t.equal(cache.get(
|
169
|
-
t.equal(cache.get(
|
174
|
+
t.equal(cache.get('a'), undefined)
|
175
|
+
t.equal(cache.get('b'), 'B')
|
176
|
+
t.equal(cache.get('c'), 'C')
|
170
177
|
|
171
178
|
aged.load(arr)
|
172
|
-
t.equal(aged.get(
|
173
|
-
t.equal(aged.get(
|
174
|
-
t.equal(aged.get(
|
179
|
+
t.equal(aged.get('a'), undefined)
|
180
|
+
t.equal(aged.get('b'), 'B')
|
181
|
+
t.equal(aged.get('c'), 'C')
|
175
182
|
|
176
183
|
simple.load(arr)
|
177
|
-
t.equal(simple.get(
|
178
|
-
t.equal(simple.get(
|
179
|
-
t.equal(simple.get(
|
180
|
-
},
|
184
|
+
t.equal(simple.get('a'), undefined)
|
185
|
+
t.equal(simple.get('b'), 'B')
|
186
|
+
t.equal(simple.get('c'), 'C')
|
187
|
+
}, 300)
|
181
188
|
|
182
189
|
setTimeout(function () {
|
183
|
-
t.equal(cache.get(
|
184
|
-
t.equal(cache.get(
|
185
|
-
t.equal(cache.get(
|
190
|
+
t.equal(cache.get('a'), undefined)
|
191
|
+
t.equal(cache.get('b'), undefined)
|
192
|
+
t.equal(cache.get('c'), 'C')
|
186
193
|
|
187
194
|
aged.load(arr)
|
188
|
-
t.equal(aged.get(
|
189
|
-
t.equal(aged.get(
|
190
|
-
t.equal(aged.get(
|
195
|
+
t.equal(aged.get('a'), undefined)
|
196
|
+
t.equal(aged.get('b'), undefined)
|
197
|
+
t.equal(aged.get('c'), 'C')
|
191
198
|
|
192
199
|
simple.load(arr)
|
193
|
-
t.equal(simple.get(
|
194
|
-
t.equal(simple.get(
|
195
|
-
t.equal(simple.get(
|
196
|
-
},
|
200
|
+
t.equal(simple.get('a'), undefined)
|
201
|
+
t.equal(simple.get('b'), undefined)
|
202
|
+
t.equal(simple.get('c'), 'C')
|
203
|
+
}, 400)
|
197
204
|
|
198
205
|
setTimeout(function () {
|
199
|
-
t.equal(cache.get(
|
200
|
-
t.equal(cache.get(
|
201
|
-
t.equal(cache.get(
|
206
|
+
t.equal(cache.get('a'), undefined)
|
207
|
+
t.equal(cache.get('b'), undefined)
|
208
|
+
t.equal(cache.get('c'), undefined)
|
202
209
|
|
203
210
|
aged.load(arr)
|
204
|
-
t.equal(aged.get(
|
205
|
-
t.equal(aged.get(
|
206
|
-
t.equal(aged.get(
|
211
|
+
t.equal(aged.get('a'), undefined)
|
212
|
+
t.equal(aged.get('b'), undefined)
|
213
|
+
t.equal(aged.get('c'), undefined)
|
207
214
|
|
208
215
|
simple.load(arr)
|
209
|
-
t.equal(simple.get(
|
210
|
-
t.equal(simple.get(
|
211
|
-
t.equal(simple.get(
|
216
|
+
t.equal(simple.get('a'), undefined)
|
217
|
+
t.equal(simple.get('b'), undefined)
|
218
|
+
t.equal(simple.get('c'), undefined)
|
212
219
|
t.end()
|
213
|
-
},
|
214
|
-
|
220
|
+
}, 500)
|
215
221
|
})
|
216
222
|
|
223
|
+
test('dumpLru', function (t) {
|
224
|
+
var l = LRU()
|
225
|
+
t.isa(l.dumpLru(), Yallist)
|
226
|
+
t.end()
|
227
|
+
})
|
@@ -1,19 +1,23 @@
|
|
1
1
|
{
|
2
2
|
"_from": "aws4@^1.2.1",
|
3
|
-
"_id": "aws4@1.2
|
3
|
+
"_id": "aws4@1.3.2",
|
4
4
|
"_location": "/aws4",
|
5
|
-
"_nodeVersion": "4.
|
5
|
+
"_nodeVersion": "4.3.1",
|
6
|
+
"_npmOperationalInternal": {
|
7
|
+
"host": "packages-12-west.internal.npmjs.com",
|
8
|
+
"tmp": "tmp/aws4-1.3.2.tgz_1456871543899_0.13955276948399842"
|
9
|
+
},
|
6
10
|
"_npmUser": {
|
7
11
|
"email": "michael.hart.au@gmail.com",
|
8
12
|
"name": "hichaelmart"
|
9
13
|
},
|
10
|
-
"_npmVersion": "2.14.
|
14
|
+
"_npmVersion": "2.14.21",
|
11
15
|
"_phantomChildren": {},
|
12
16
|
"_requiredBy": [
|
13
17
|
"/request"
|
14
18
|
],
|
15
|
-
"_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.
|
16
|
-
"_shasum": "
|
19
|
+
"_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz",
|
20
|
+
"_shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1",
|
17
21
|
"_shrinkwrap": null,
|
18
22
|
"author": {
|
19
23
|
"email": "michael.hart.au@gmail.com",
|
@@ -24,19 +28,19 @@
|
|
24
28
|
"url": "https://github.com/mhart/aws4/issues"
|
25
29
|
},
|
26
30
|
"dependencies": {
|
27
|
-
"lru-cache": "^
|
31
|
+
"lru-cache": "^4.0.0"
|
28
32
|
},
|
29
33
|
"description": "Signs and prepares requests using AWS Signature Version 4",
|
30
34
|
"devDependencies": {
|
31
|
-
"mocha": "^2.
|
32
|
-
"should": "^
|
35
|
+
"mocha": "^2.4.5",
|
36
|
+
"should": "^8.2.2"
|
33
37
|
},
|
34
38
|
"directories": {},
|
35
39
|
"dist": {
|
36
|
-
"shasum": "
|
37
|
-
"tarball": "http://registry.npmjs.org/aws4/-/aws4-1.2.
|
40
|
+
"shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1",
|
41
|
+
"tarball": "http://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz"
|
38
42
|
},
|
39
|
-
"gitHead": "
|
43
|
+
"gitHead": "e899db3aacbf2a034398f7dd483345dc793e8d72",
|
40
44
|
"homepage": "https://github.com/mhart/aws4#readme",
|
41
45
|
"keywords": [
|
42
46
|
"amazon",
|
@@ -100,8 +104,7 @@
|
|
100
104
|
],
|
101
105
|
"name": "aws4",
|
102
106
|
"optionalDependencies": {},
|
103
|
-
"readme": "aws4\n----\n\n[](http://travis-ci.org/mhart/aws4)\n\nA small utility to sign vanilla node.js http(s) request options using Amazon's\n[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).\n\nThis signature is supported by nearly all Amazon services, including\n[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),\n[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),\n[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html),\n[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/),\n[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html),\n[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/),\n[SNS](http://docs.aws.amazon.com/sns/latest/api/),\n[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/),\n[STS](http://docs.aws.amazon.com/STS/latest/APIReference/),\n[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/),\n[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/),\n[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/),\n[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/),\n[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/),\n[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/),\n[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/),\n[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/),\n[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html),\n[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html),\n[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/),\n[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html),\n[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/),\n[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/),\n[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html),\n[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/),\n[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/),\n[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/),\n[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/),\n[SES](http://docs.aws.amazon.com/ses/latest/APIReference/),\n[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/),\n[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/),\n[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html),\n[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/),\n[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/),\n[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/),\n[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html),\n[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/),\n[Config](http://docs.aws.amazon.com/config/latest/APIReference/),\n[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html),\n[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and\n[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html).\n\nIndeed, the only AWS services that *don't* support v4 as of 2014-12-30 are\n[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and\n[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html)\n(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)).\n\nIt also provides defaults for a number of core AWS headers and\nrequest parameters, making it very easy to query AWS services, or\nbuild out a fully-featured AWS library.\n\nExample\n-------\n\n```javascript\nvar http = require('http'),\n https = require('https'),\n aws4 = require('aws4')\n\n// given an options object you could pass to http.request\nvar opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}\n\n// alternatively (as aws4 can infer the host):\nopts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}\n\n// alternatively (as us-east-1 is default):\nopts = {service: 'sqs', path: '/?Action=ListQueues'}\n\naws4.sign(opts) // assumes AWS credentials are available in process.env\n\nconsole.log(opts)\n/*\n{\n host: 'sqs.us-east-1.amazonaws.com',\n path: '/?Action=ListQueues',\n headers: {\n Host: 'sqs.us-east-1.amazonaws.com',\n 'X-Amz-Date': '20121226T061030Z',\n Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'\n }\n}\n*/\n\n// we can now use this to query AWS using the standard node.js http API\nhttp.request(opts, function(res) { res.pipe(process.stdout) }).end()\n/*\n<?xml version=\"1.0\"?>\n<ListQueuesResponse xmlns=\"http://queue.amazonaws.com/doc/2012-11-05/\">\n...\n*/\n```\n\nMore options\n------------\n\n```javascript\n// you can also pass AWS credentials in explicitly (otherwise taken from process.env)\naws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})\n\n// can also add the signature to query strings\naws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})\n\n// create a utility function to pipe to stdout (with https this time)\nfunction request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }\n\n// aws4 can infer the HTTP method if a body is passed in\n// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'\nrequest(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))\n/*\n<ListGroupsResponse xmlns=\"https://iam.amazonaws.com/doc/2010-05-08/\">\n...\n*/\n\n// can specify any custom option or header as per usual\nrequest(aws4.sign({\n service: 'dynamodb',\n region: 'ap-southeast-2',\n method: 'POST',\n path: '/',\n headers: {\n 'Content-Type': 'application/x-amz-json-1.0',\n 'X-Amz-Target': 'DynamoDB_20120810.ListTables'\n },\n body: '{}'\n}))\n/*\n{\"TableNames\":[]}\n...\n*/\n\n// works with all other services that support Signature Version 4\n\nrequest(aws4.sign({service: 's3', path: '/', signQuery: true}))\n/*\n<ListAllMyBucketsResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))\n/*\n<DescribeRegionsResponse xmlns=\"http://ec2.amazonaws.com/doc/2014-06-15/\">\n...\n*/\n\nrequest(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))\n/*\n<ListTopicsResponse xmlns=\"http://sns.amazonaws.com/doc/2010-03-31/\">\n...\n*/\n\nrequest(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))\n/*\n<GetSessionTokenResponse xmlns=\"https://sts.amazonaws.com/doc/2011-06-15/\">\n...\n*/\n\nrequest(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))\n/*\n<ListDomainNamesResponse xmlns=\"http://cloudsearch.amazonaws.com/doc/2013-01-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))\n/*\n<ListIdentitiesResponse xmlns=\"http://ses.amazonaws.com/doc/2010-12-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))\n/*\n<DescribeAutoScalingInstancesResponse xmlns=\"http://autoscaling.amazonaws.com/doc/2011-01-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))\n/*\n<DescribeLoadBalancersResponse xmlns=\"http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))\n/*\n<ListStacksResponse xmlns=\"http://cloudformation.amazonaws.com/doc/2010-05-15/\">\n...\n*/\n\nrequest(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))\n/*\n<ListAvailableSolutionStacksResponse xmlns=\"http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))\n/*\n<DescribeDBInstancesResponse xmlns=\"http://rds.amazonaws.com/doc/2012-09-17/\">\n...\n*/\n\nrequest(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))\n/*\n<ListMetricsResponse xmlns=\"http://monitoring.amazonaws.com/doc/2010-08-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))\n/*\n<DescribeClustersResponse xmlns=\"http://redshift.amazonaws.com/doc/2012-12-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))\n/*\n<DistributionList xmlns=\"http://cloudfront.amazonaws.com/doc/2014-05-31/\">\n...\n*/\n\nrequest(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))\n/*\n<DescribeCacheClustersResponse xmlns=\"http://elasticache.amazonaws.com/doc/2014-07-15/\">\n...\n*/\n\nrequest(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))\n/*\n<DescribeJobFlowsResponse xmlns=\"http://elasticmapreduce.amazonaws.com/doc/2009-03-31\">\n...\n*/\n\nrequest(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))\n/*\n<ListHostedZonesResponse xmlns=\"https://route53.amazonaws.com/doc/2013-04-01/\">\n...\n*/\n\nrequest(aws4.sign({service: 'appstream', path: '/applications'}))\n/*\n{\"_links\":{\"curie\":[{\"href\":\"http://docs.aws.amazon.com/appstream/latest/...\n...\n*/\n\nrequest(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))\n/*\n{\"Count\":0,\"IdentityPoolUsages\":[],\"MaxResults\":16,\"NextToken\":null}\n...\n*/\n\nrequest(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))\n/*\n{\"NextPageToken\":null,\"Pipelines\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))\n/*\n{\"Functions\":[],\"NextMarker\":null}\n...\n*/\n\nrequest(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))\n/*\n<ListClustersResponse xmlns=\"http://ecs.amazonaws.com/doc/2014-11-13/\">\n...\n*/\n\nrequest(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))\n/*\n{\"Marker\":null,\"VaultList\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'storagegateway', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'StorageGateway_20120630.ListGateways'\n}}))\n/*\n{\"Gateways\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'datapipeline', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'DataPipeline.ListPipelines'\n}}))\n/*\n{\"hasMoreResults\":false,\"pipelineIdList\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'opsworks', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'\n}}))\n/*\n{\"Stacks\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'route53domains', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'\n}}))\n/*\n{\"Domains\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'kinesis', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'Kinesis_20131202.ListStreams'\n}}))\n/*\n{\"HasMoreStreams\":false,\"StreamNames\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'cloudtrail', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'\n}}))\n/*\n{\"trailList\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'logs', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'\n}}))\n/*\n{\"logGroups\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'codedeploy', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'\n}}))\n/*\n{\"applications\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'directconnect', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'OvertureService.DescribeConnections'\n}}))\n/*\n{\"connections\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'kms', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'TrentService.ListKeys'\n}}))\n/*\n{\"Keys\":[],\"Truncated\":false}\n...\n*/\n\nrequest(aws4.sign({service: 'config', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'\n}}))\n/*\n{\"DeliveryChannels\":[]}\n...\n*/\n\nrequest(aws4.sign({service: 'cloudhsm', body: '{}', headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'\n}}))\n/*\n{\"AZList\":[\"us-east-1a\",\"us-east-1b\",\"us-east-1c\"]}\n...\n*/\n\nrequest(aws4.sign({\n service: 'swf',\n body: '{\"registrationStatus\":\"REGISTERED\"}',\n headers: {\n 'Content-Type': 'application/x-amz-json-1.0',\n 'X-Amz-Target': 'SimpleWorkflowService.ListDomains'\n }\n}))\n/*\n{\"domainInfos\":[]}\n...\n*/\n\nrequest(aws4.sign({\n service: 'cognito-identity',\n body: '{\"MaxResults\": 1}',\n headers: {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'\n }\n}))\n/*\n{\"IdentityPools\":[]}\n...\n*/\n\nrequest(aws4.sign({\n service: 'mobileanalytics',\n path: '/2014-06-05/events',\n body: JSON.stringify({events:[{\n eventType: 'a',\n timestamp: new Date().toISOString(),\n session: {},\n }]}),\n headers: {\n 'Content-Type': 'application/json',\n 'X-Amz-Client-Context': JSON.stringify({\n client: {client_id: 'a', app_title: 'a'},\n custom: {},\n env: {platform: 'a'},\n services: {},\n }),\n }\n}))\n/*\n(HTTP 202, empty response)\n*/\n```\n\nAPI\n---\n\n### aws4.sign(requestOptions, [credentials])\n\nThis calculates and populates the `Authorization` header of\n`requestOptions`, and any other necessary AWS headers and/or request\noptions. Returns `requestOptions` as a convenience for chaining.\n\n`requestOptions` is an object holding the same options that the node.js\n[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback)\nfunction takes.\n\nThe following properties of `requestOptions` are used in the signing or\npopulated if they don't already exist:\n\n- `hostname` or `host` (will be determined from `service` and `region` if not given)\n- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`)\n- `path` (will use `'/'` if not given)\n- `body` (will use `''` if not given)\n- `service` (will be calculated from `hostname` or `host` if not given)\n- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given)\n- `headers['Host']` (will use `hostname` or `host` or be calculated if not given)\n- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'`\n if not given and there is a `body`)\n- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used)\n\nYour AWS credentials (which can be found in your\n[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials))\ncan be specified in one of two ways:\n\n- As the second argument, like this:\n\n```javascript\naws4.sign(requestOptions, {\n secretAccessKey: \"<your-secret-access-key>\",\n accessKeyId: \"<your-access-key-id>\",\n sessionToken: \"<your-session-token>\"\n})\n```\n\n- From `process.env`, such as this:\n\n```\nexport AWS_SECRET_ACCESS_KEY=\"<your-secret-access-key>\"\nexport AWS_ACCESS_KEY_ID=\"<your-access-key-id>\"\nexport AWS_SESSION_TOKEN=\"<your-session-token>\"\n```\n\n(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available)\n\nThe `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing\nwith [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html).\n\nInstallation\n------------\n\nWith [npm](http://npmjs.org/) do:\n\n```\nnpm install aws4\n```\n\nThanks\n------\n\nThanks to [@jed](https://github.com/jed) for his\n[dynamo-client](https://github.com/jed/dynamo-client) lib where I first\ncommitted and subsequently extracted this code.\n\nAlso thanks to the\n[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving\nme a start on implementing the v4 signature.\n\n",
|
104
|
-
"readmeFilename": "README.md",
|
107
|
+
"readme": "ERROR: No README data found!",
|
105
108
|
"repository": {
|
106
109
|
"type": "git",
|
107
110
|
"url": "git+https://github.com/mhart/aws4.git"
|
@@ -109,5 +112,5 @@
|
|
109
112
|
"scripts": {
|
110
113
|
"test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list"
|
111
114
|
},
|
112
|
-
"version": "1.2
|
115
|
+
"version": "1.3.2"
|
113
116
|
}
|