Debian Codegraph @

workspaces/arborist/test/fixtures/registry-mocks/content/thunky.json

raw
1 {
2 "_id": "thunky",
3 "_rev": "12-b2bc51f5548cc548109f42a0fd2f059d",
4 "name": "thunky",
5 "description": "delay the evaluation of a paramless async function and cache the result",
6 "dist-tags": {
7 "latest": "1.1.0"
8 },
9 "versions": {
10 "0.1.0": {
11 "name": "thunky",
12 "version": "0.1.0",
13 "repository": {
14 "type": "git",
15 "url": "git://github.com/mafintosh/thunky"
16 },
17 "description": "delay the evaluation of a paramless async function and cache the result",
18 "keywords": [
19 "memo",
20 "thunk",
21 "async",
22 "lazy",
23 "control",
24 "flow",
25 "cache"
26 ],
27 "author": {
28 "name": "Mathias Buus Madsen",
29 "email": "[email protected]"
30 },
31 "_id": "[email protected]",
32 "dist": {
33 "shasum": "bf30146824e2b6e67b0f2d7a4ac8beb26908684e",
34 "tarball": "https://registry.npmjs.org/thunky/-/thunky-0.1.0.tgz"
35 },
36 "_from": ".",
37 "_npmVersion": "1.2.11",
38 "_npmUser": {
39 "name": "mafintosh",
40 "email": "[email protected]"
41 },
42 "maintainers": [
43 {
44 "name": "mafintosh",
45 "email": "[email protected]"
46 }
47 ],
48 "directories": {}
49 },
50 "1.0.0": {
51 "name": "thunky",
52 "version": "1.0.0",
53 "description": "delay the evaluation of a paramless async function and cache the result",
54 "main": "index.js",
55 "devDependencies": {
56 "standard": "^7.1.2",
57 "tape": "^4.6.0"
58 },
59 "repository": {
60 "type": "git",
61 "url": "git://github.com/mafintosh/thunky.git"
62 },
63 "scripts": {
64 "test": "standard && tape test.js"
65 },
66 "keywords": [
67 "memo",
68 "thunk",
69 "async",
70 "lazy",
71 "control",
72 "flow",
73 "cache"
74 ],
75 "author": {
76 "name": "Mathias Buus Madsen",
77 "email": "[email protected]"
78 },
79 "bugs": {
80 "url": "https://github.com/mafintosh/thunky/issues"
81 },
82 "homepage": "https://github.com/mafintosh/thunky#readme",
83 "license": "MIT",
84 "gitHead": "40d0e72ccfea1b2fb11a4706d16d7dc52cdfc9bf",
85 "_id": "[email protected]",
86 "_shasum": "48c898447cdbf9686d65f3473bc1489e7cc97184",
87 "_from": ".",
88 "_npmVersion": "2.15.9",
89 "_nodeVersion": "4.4.3",
90 "_npmUser": {
91 "name": "mafintosh",
92 "email": "[email protected]"
93 },
94 "dist": {
95 "shasum": "48c898447cdbf9686d65f3473bc1489e7cc97184",
96 "tarball": "https://registry.npmjs.org/thunky/-/thunky-1.0.0.tgz"
97 },
98 "maintainers": [
99 {
100 "name": "feross",
101 "email": "[email protected]"
102 },
103 {
104 "name": "mafintosh",
105 "email": "[email protected]"
106 }
107 ],
108 "_npmOperationalInternal": {
109 "host": "packages-12-west.internal.npmjs.com",
110 "tmp": "tmp/thunky-1.0.0.tgz_1468578380300_0.8760475649032742"
111 },
112 "directories": {}
113 },
114 "1.0.1": {
115 "name": "thunky",
116 "version": "1.0.1",
117 "description": "delay the evaluation of a paramless async function and cache the result",
118 "main": "index.js",
119 "devDependencies": {
120 "standard": "^7.1.2",
121 "tape": "^4.6.0"
122 },
123 "repository": {
124 "type": "git",
125 "url": "git://github.com/mafintosh/thunky.git"
126 },
127 "scripts": {
128 "test": "standard && tape test.js"
129 },
130 "keywords": [
131 "memo",
132 "thunk",
133 "async",
134 "lazy",
135 "control",
136 "flow",
137 "cache"
138 ],
139 "author": {
140 "name": "Mathias Buus Madsen",
141 "email": "[email protected]"
142 },
143 "bugs": {
144 "url": "https://github.com/mafintosh/thunky/issues"
145 },
146 "homepage": "https://github.com/mafintosh/thunky#readme",
147 "license": "MIT",
148 "gitHead": "02328e063e740e1b2c6edf8d540bd82577ae87fc",
149 "_id": "[email protected]",
150 "_shasum": "3db1525aac0367b67bd2e532d2773e7c40be2e68",
151 "_from": ".",
152 "_npmVersion": "2.15.9",
153 "_nodeVersion": "4.4.3",
154 "_npmUser": {
155 "name": "mafintosh",
156 "email": "[email protected]"
157 },
158 "dist": {
159 "shasum": "3db1525aac0367b67bd2e532d2773e7c40be2e68",
160 "tarball": "https://registry.npmjs.org/thunky/-/thunky-1.0.1.tgz"
161 },
162 "maintainers": [
163 {
164 "name": "feross",
165 "email": "[email protected]"
166 },
167 {
168 "name": "mafintosh",
169 "email": "[email protected]"
170 }
171 ],
172 "_npmOperationalInternal": {
173 "host": "packages-12-west.internal.npmjs.com",
174 "tmp": "tmp/thunky-1.0.1.tgz_1468578438552_0.737917662365362"
175 },
176 "directories": {}
177 },
178 "1.0.2": {
179 "name": "thunky",
180 "version": "1.0.2",
181 "description": "delay the evaluation of a paramless async function and cache the result",
182 "main": "index.js",
183 "devDependencies": {
184 "standard": "^7.1.2",
185 "tape": "^4.6.0"
186 },
187 "repository": {
188 "type": "git",
189 "url": "git://github.com/mafintosh/thunky.git"
190 },
191 "scripts": {
192 "test": "standard && tape test.js"
193 },
194 "keywords": [
195 "memo",
196 "thunk",
197 "async",
198 "lazy",
199 "control",
200 "flow",
201 "cache"
202 ],
203 "author": {
204 "name": "Mathias Buus Madsen",
205 "email": "[email protected]"
206 },
207 "bugs": {
208 "url": "https://github.com/mafintosh/thunky/issues"
209 },
210 "homepage": "https://github.com/mafintosh/thunky#readme",
211 "license": "MIT",
212 "gitHead": "7ad8bbfdfbd62b51ea0e34c5235ba0de0db12223",
213 "_id": "[email protected]",
214 "_shasum": "a862e018e3fb1ea2ec3fce5d55605cf57f247371",
215 "_from": ".",
216 "_npmVersion": "3.10.10",
217 "_nodeVersion": "6.9.5",
218 "_npmUser": {
219 "name": "mafintosh",
220 "email": "[email protected]"
221 },
222 "dist": {
223 "shasum": "a862e018e3fb1ea2ec3fce5d55605cf57f247371",
224 "tarball": "https://registry.npmjs.org/thunky/-/thunky-1.0.2.tgz"
225 },
226 "maintainers": [
227 {
228 "name": "feross",
229 "email": "[email protected]"
230 },
231 {
232 "name": "mafintosh",
233 "email": "[email protected]"
234 }
235 ],
236 "_npmOperationalInternal": {
237 "host": "packages-18-east.internal.npmjs.com",
238 "tmp": "tmp/thunky-1.0.2.tgz_1486860508065_0.44560420024208724"
239 },
240 "directories": {}
241 },
242 "1.0.3": {
243 "name": "thunky",
244 "version": "1.0.3",
245 "description": "delay the evaluation of a paramless async function and cache the result",
246 "main": "index.js",
247 "devDependencies": {
248 "standard": "^12.0.1",
249 "tape": "^4.9.1"
250 },
251 "repository": {
252 "type": "git",
253 "url": "git://github.com/mafintosh/thunky.git"
254 },
255 "scripts": {
256 "test": "standard && tape test.js"
257 },
258 "keywords": [
259 "memo",
260 "thunk",
261 "async",
262 "lazy",
263 "control",
264 "flow",
265 "cache"
266 ],
267 "author": {
268 "name": "Mathias Buus Madsen",
269 "email": "[email protected]"
270 },
271 "bugs": {
272 "url": "https://github.com/mafintosh/thunky/issues"
273 },
274 "homepage": "https://github.com/mafintosh/thunky#readme",
275 "license": "MIT",
276 "gitHead": "ce46d4fb455af79369cf14b7bf3eb0911bc01500",
277 "_id": "[email protected]",
278 "_npmVersion": "6.4.1",
279 "_nodeVersion": "10.11.0",
280 "_npmUser": {
281 "name": "mafintosh",
282 "email": "[email protected]"
283 },
284 "dist": {
285 "integrity": "sha512-YwT8pjmNcAXBZqrubu22P4FYsh2D4dxRmnWBOL8Jk8bUcRUtc5326kx32tuTmFDAZtLOGEVNl8POAR8j896Iow==",
286 "shasum": "f5df732453407b09191dae73e2a8cc73f381a826",
287 "tarball": "https://registry.npmjs.org/thunky/-/thunky-1.0.3.tgz",
288 "fileCount": 6,
289 "unpackedSize": 7165,
290 "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxiS9CRA9TVsSAnZWagAA8DsQAKIU9+suySLueSdVZcn1\n/OMQQPWU6PyfDjI6vZq2ECE7PYB9kaOTj45bsVoUZOts9cI0YAqzYFEJK2Qn\n0ZTT+X1bOsmNaNsg3Llv2VWqwBl0uLQcWordK+HsgdUW/Pj7to2D2gfOeIDK\n6CdhGYxD7WLBcS6eJ/KqBGZvMgfToX/w+9GfTjPzU0IxU+1XNCugs8QSrS+z\nYObEgpn1DYjlIarubypRSPd5la+hx/yGQlfpq9barM1Y4V9p87Yt8UL5qw7p\n7ZZIMiR/B78G7s8lrrmzgYSXTui740yjmC5SAXRzHuuGN3WjnFLQSv2G1uKY\n8ZPsUuqo2a7Fj6LFjZjlEcoPS0Lwft0HYRrJ3r1hCpEgDuLoOxjm9z6adstu\nqlvw5LDTWyanE4jM8bndZvf+ay08+kbFUdRmXbeIriHpZD8YdeL+IQ3pl5t/\n4mfA+tDVSGf/FF5tLY5JBSPAelRlJhUUqWGKQ/G/qNhIN+JdioqBTzy3XtZo\nFx3k/VlXmIYlaYvYdvNeAJIGEkyk+g8TXaupbzwLMuh5P7X+jCTsaa3yb4FJ\nmRFrwXfATuQeHMDKrtUHMjlecxF9M91bCRxCJ2AdP9Msq08zF8qHhOiz8bH0\n9f+o0W8zXuLNuWD4Zb8HjbnnOptZzh8m6s3nhCu5xbHT259LZ8gV9ogbpwp5\nG2s6\r\n=VdWZ\r\n-----END PGP SIGNATURE-----\r\n"
291 },
292 "maintainers": [
293 {
294 "name": "feross",
295 "email": "[email protected]"
296 },
297 {
298 "name": "mafintosh",
299 "email": "[email protected]"
300 }
301 ],
302 "directories": {},
303 "_npmOperationalInternal": {
304 "host": "s3://npm-registry-packages",
305 "tmp": "tmp/thunky_1.0.3_1539712188066_0.0018386345014538286"
306 },
307 "_hasShrinkwrap": false
308 },
309 "1.1.0": {
310 "name": "thunky",
311 "version": "1.1.0",
312 "description": "delay the evaluation of a paramless async function and cache the result",
313 "main": "index.js",
314 "devDependencies": {
315 "standard": "^12.0.1",
316 "tape": "^4.9.1"
317 },
318 "repository": {
319 "type": "git",
320 "url": "git://github.com/mafintosh/thunky.git"
321 },
322 "scripts": {
323 "test": "standard && tape test.js"
324 },
325 "keywords": [
326 "memo",
327 "thunk",
328 "async",
329 "lazy",
330 "control",
331 "flow",
332 "cache"
333 ],
334 "author": {
335 "name": "Mathias Buus Madsen",
336 "email": "[email protected]"
337 },
338 "bugs": {
339 "url": "https://github.com/mafintosh/thunky/issues"
340 },
341 "homepage": "https://github.com/mafintosh/thunky#readme",
342 "license": "MIT",
343 "gitHead": "4f24392fd09949e3785598d99b087e8256599989",
344 "_id": "[email protected]",
345 "_nodeVersion": "10.16.3",
346 "_npmVersion": "6.9.0",
347 "dist": {
348 "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
349 "shasum": "5abaf714a9405db0504732bbccd2cedd9ef9537d",
350 "tarball": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz",
351 "fileCount": 7,
352 "unpackedSize": 7758,
353 "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpDfGCRA9TVsSAnZWagAA9Q4P/i1u8AdasQuoaM+NXEOs\nLGhjqM30PR/nuzdLDJhNsYNl/sLOwFZmAnwzVuxG+4t2OeES+a70gGXL2FLV\ndpQJHL+KDnVq2ANoQcJtYRRMDCOM3P5zvTS2DaXtdbBOAX/WPdgvR7FcCXeD\nPOBVpKFmo2A7+0eUpmxSMgVXVmHjkQkx7zmvGjsx+zm+a9a/3jKdI1eywWkG\nLmnW1y+BqxieMestDhrmSPisKBCYiAf3lyu1lrx+I2yMCA+KWUMau8Nq+Qft\nqritsC7qT00T61rRycR6vjLiFOXSd6n22SM32z1yAbeZOK80wYUNrE2nA4Yo\n7RL0c15PFoCDHiUwPAzIjTjCqM+mkGO1PRvtNtn3OyihhBAB7QMEUBOWeRXZ\nuJE3GOhySWGMGwP4K2YhwtOK+q8AK4RVLX4/QW4hc4+BlP0qySVixbK8+KJm\nIflU2vlzopa+m6cmfuWB54rDN0xi+OXotuTnJy8Vhy6uRDhUWX9wGuXK3+Av\nNTlM9wGXbTe88LFzHpZeSqxrmFtLFOEi5G0BSbZdn+qJ8HTatEATml33I2lP\nGU+Rp56Wp1CTgfVw5/Ug0jZiHJtX4uC6vTyDXn9T9OcL2tFkcJeI6foFB/uF\ngRzm4ypBy1Sq/PoGqrdEiLB2/fZb+geRuH3KknnkfOM5ckbO9O24RHD2bRbd\n2ila\r\n=4xXc\r\n-----END PGP SIGNATURE-----\r\n"
354 },
355 "maintainers": [
356 {
357 "name": "feross",
358 "email": "[email protected]"
359 },
360 {
361 "name": "mafintosh",
362 "email": "[email protected]"
363 }
364 ],
365 "_npmUser": {
366 "name": "mafintosh",
367 "email": "[email protected]"
368 },
369 "directories": {},
370 "_npmOperationalInternal": {
371 "host": "s3://npm-registry-packages",
372 "tmp": "tmp/thunky_1.1.0_1571043270184_0.776382449698759"
373 },
374 "_hasShrinkwrap": false
375 }
376 },
377 "readme": "# thunky\n\nDelay the evaluation of a paramless async function and cache the result (see [thunk](http://en.wikipedia.org/wiki/Thunk_%28functional_programming%29)).\n\n```\nnpm install thunky\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/thunky.svg?style=flat)](http://travis-ci.org/mafintosh/thunky)\n\n## Example\n\nLet's make a simple function that returns a random number 1 second after it is called for the first time\n\n``` js\nvar thunky = require('thunky')\n\nvar test = thunky(function (callback) { // the inner function should only accept a callback\n console.log('waiting 1s and returning random number')\n setTimeout(function () {\n callback(Math.random())\n }, 1000)\n})\n\ntest(function (num) { // inner function is called the first time we call test\n console.log(num) // prints random number\n})\n\ntest(function (num) { // subsequent calls waits for the first call to finish and return the same value\n console.log(num) // prints the same random number as above\n})\n```\n\n## Lazy evaluation\n\nThunky makes it easy to implement a lazy evaluation pattern.\n\n``` js\nvar getDb = thunky(function (callback) {\n db.open(myConnectionString, callback)\n})\n\nvar queryDb = function (query, callback) {\n getDb(function (err, db) {\n if (err) return callback(err)\n db.query(query, callback)\n })\n}\n\nqueryDb('some query', function (err, result) { ... } )\n\nqueryDb('some other query', function (err, result) { ... } )\n```\n\nThe first time `getDb` is called it will try do open a connection to the database.\nAny subsequent calls will just wait for the first call to complete and then call your callback.\n\nA nice property of this pattern is that it *easily* allows us to pass any error caused by `getDb` to the `queryDb` callback.\n\n## Error → No caching\n\nIf the thunk callback is called with an `Error` object as the first argument it will not cache the result\n\n``` js\nvar fails = thunky(function (callback) {\n console.log('returning an error')\n callback(new Error('bad stuff'))\n})\n\nfails(function (err) { // inner function is called\n console.log(err)\n});\n\nfails(function (err) { // inner function is called again as it returned an error before\n console.log(err)\n})\n```\n\n## Promise version\n\nA promise version is available as well\n\n``` js\nvar thunkyp = require('thunky/promise')\n\nvar ready = thunkyp(async function () {\n // ... do async stuff\n return 42\n})\n\n// same semantics as the callback version\nawait ready()\n```\n\n## License\n\nMIT\n",
378 "maintainers": [
379 {
380 "name": "feross",
381 "email": "[email protected]"
382 },
383 {
384 "name": "mafintosh",
385 "email": "[email protected]"
386 }
387 ],
388 "time": {
389 "modified": "2019-10-14T08:54:32.960Z",
390 "created": "2013-03-06T18:30:51.672Z",
391 "0.1.0": "2013-03-06T18:30:54.142Z",
392 "1.0.0": "2016-07-15T10:26:22.935Z",
393 "1.0.1": "2016-07-15T10:27:21.115Z",
394 "1.0.2": "2017-02-12T00:48:28.724Z",
395 "1.0.3": "2018-10-16T17:49:48.229Z",
396 "1.1.0": "2019-10-14T08:54:30.361Z"
397 },
398 "author": {
399 "name": "Mathias Buus Madsen",
400 "email": "[email protected]"
401 },
402 "repository": {
403 "type": "git",
404 "url": "git://github.com/mafintosh/thunky.git"
405 },
406 "users": {
407 "bret": true,
408 "ziflex": true,
409 "quocnguyen": true
410 },
411 "keywords": [
412 "memo",
413 "thunk",
414 "async",
415 "lazy",
416 "control",
417 "flow",
418 "cache"
419 ],
420 "readmeFilename": "README.md",
421 "homepage": "https://github.com/mafintosh/thunky#readme",
422 "bugs": {
423 "url": "https://github.com/mafintosh/thunky/issues"
424 },
425 "license": "MIT"
426 }