{"_id":"@automaton.systems/snippets","_rev":"1-3628c027fc909db20947b2993a8946b0","name":"@automaton.systems/snippets","dist-tags":{"latest":"0.2.3"},"versions":{"0.2.2":{"name":"@automaton.systems/snippets","version":"0.2.2","author":"","license":"ISC","_id":"@automaton.systems/snippets@0.2.2","maintainers":[{"name":"automaton-systems","email":"mail@automaton.systems"}],"dist":{"shasum":"2d23d36d21ac61687166403f42e8023772977deb","tarball":"https://registry.npmjs.org/@automaton.systems/snippets/-/snippets-0.2.2.tgz","fileCount":20,"integrity":"sha512-gPEmhdiJcPQgZC5QwXSaMx6d8DIXeDNUR5gb/l2bAFUMwJPzNBti2IYzF0AfP3cZVQc3ZrcvDsqyETG/Y/BeCg==","signatures":[{"sig":"MEUCIQDFAbvmzldtWZKBtIVFBEJqCjl2fNbiVmJ6JKZb1v1fFAIgBw5xPhCThMm3fBEn0MAAAkFMs8dtdOEEo9Fg2TIYrd8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52392},"main":"index.ts","type":"module","gitHead":"a1ea9d97ca7af54ca3f633d4077807e61f1993c0","scripts":{"demo":"tsx --expose-gc demo","fork":"tsx fork","test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"automaton-systems","email":"mail@automaton.systems"},"_npmVersion":"10.9.2","description":"A set of unrelated frequently useful typescript esm code snippets","directories":{},"_nodeVersion":"22.13.1","dependencies":{"uuid":"^11.0.3","p-queue":"^8.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","@types/node":"^22.10.1"},"_npmOperationalInternal":{"tmp":"tmp/snippets_0.2.2_1738674464751_0.9614342550961146","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@automaton.systems/snippets","version":"0.2.3","description":"A set of unrelated frequently useful typescript esm code snippets","main":"index.ts","type":"module","scripts":{"demo":"tsx --expose-gc demo","fork":"tsx fork","test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","devDependencies":{"@types/node":"^22.13.1","tsx":"^4.19.2"},"dependencies":{"p-queue":"^8.0.1","uuid":"^11.0.3"},"_id":"@automaton.systems/snippets@0.2.3","gitHead":"6fdb1901e785c3f6bd1674c88ebae8643875b661","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-FmyKRGT4+U5I5Jm0n7vdhf5evKjVavHG7a7PPQzrx3r/qu27XIlNkJFHnXChVFLQjb6tlEny+mdW14OPGr7LWg==","shasum":"f4667dc651ad825be58f34d14712ffbbadece03a","tarball":"https://registry.npmjs.org/@automaton.systems/snippets/-/snippets-0.2.3.tgz","fileCount":21,"unpackedSize":54126,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD9rpDHqPgKnGcdzlUt8Oqi6+Q64efO34VLSR/1Me2z7gIhAN0g0i8Yo0J8E6wg8q9n1EYbgIQMHFzlr2ep4SABAIKT"}]},"_npmUser":{"name":"automaton-systems","email":"mail@automaton.systems"},"directories":{},"maintainers":[{"name":"automaton-systems","email":"mail@automaton.systems"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/snippets_0.2.3_1739568403292_0.917012956511071"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-04T13:07:44.638Z","modified":"2025-02-14T21:26:43.664Z","0.2.2":"2025-02-04T13:07:44.965Z","0.2.3":"2025-02-14T21:26:43.453Z"},"license":"ISC","description":"A set of unrelated frequently useful typescript esm code snippets","maintainers":[{"name":"automaton-systems","email":"mail@automaton.systems"}],"readme":"# @automaton.systems/snippets\n\n[![https://nodei.co/npm/@automaton.systems/snippets.png?compact=true](https://nodei.co/npm/@automaton.systems/snippets.png?compact=true)](https://www.npmjs.com/package/@automaton.systems/snippets)\n\nA set of snippets that aren't big enough to be worth setting up their own library, but aren't something that should constantly be copy/pasted.\n\n## Snippets\n\n### ThreadedQueue\n\nRuns the provided code in multiple threads.\nTODO document/fix numerous cases where this WONT work\n\n```typescript\nlet loadData = async ()=>{\n\tconsole.log(\"LOADED DATA\");\n\tlet array = new Array(10_000);\n\tfor(let i = 0; i < array.length; i++)\n\t\tarray[i] = i;\n\treturn array;\n}\n\nlet func = async (i: number)=>{\n\tawait sleep(Math.random() * 2000 + 500);\n}\n\nawait ThreadedQueue(loadData, func);\n```","readmeFilename":"README.md"}