mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -05:00
ce7dc2be92
Adds support for running npm package lifecycle scripts, opted into via a new `--allow-scripts` flag. With this PR, when running `deno cache` (or `DENO_FUTURE=1 deno install`) you can specify the `--allow-scripts=pkg1,pkg2` flag to run lifecycle scripts attached to the given packages. Note at the moment this only works when `nodeModulesDir` is true (using the local resolver). When a package with un-run lifecycle scripts is encountered, we emit a warning suggesting things may not work and to try running lifecycle scripts. Additionally, if a package script implicitly requires `node-gyp` and it's not found on the system, we emit a warning. Extra things in this PR: - Extracted out bits of `task.rs` into a separate module for reuse - Added a couple fields to `process.config` in order to support `node-gyp` (it relies on a few variables being there) - Drive by fix to downloading new npm packages to test registry --- TODO: - [x] validation for allow-scripts args (make sure it looks like an npm package) - [x] make allow-scripts matching smarter - [ ] figure out what issues this closes --- Review notes: - This adds a bunch of deps to our test registry due to using `node-gyp`, so it's pretty noisy
1 line
No EOL
16 KiB
JSON
1 line
No EOL
16 KiB
JSON
{"_id":"unique-filename","_rev":"41-80f3532691252e2c38a66f855f492e95","name":"unique-filename","description":"Generate a unique filename for use in temporary directories or caches.","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"unique-filename","version":"1.0.0","keywords":[],"author":{"url":"http://re-becca.org/","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"unique-filename@1.0.0","maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"homepage":"https://github.com/iarna/unique-filename","bugs":{"url":"https://github.com/iarna/unique-filename/issues"},"dist":{"shasum":"0bee4219e192e86da3c4ffc0cc6e054d8634eab9","tarball":"http://localhost:4260/unique-filename/unique-filename-1.0.0.tgz","integrity":"sha512-RiXW2h/OJBa+f+6Awztxk0C8OCcFguELlIJnIwANS2mhCQdhUBhZk0pMX2Jqi66bdR7PHItFKt6Xq3Hm+7XL8Q==","signatures":[{"sig":"MEYCIQDGG/duekiRmMX2RV91Td+FGpg1uUGeE3TMJTO6YRN5SAIhAIbXXpNN35FSaNtco7zAJKoKf/RIjWoDLEyvo59Gj6+Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"0bee4219e192e86da3c4ffc0cc6e054d8634eab9","gitHead":"935739361f6ecc7b613c5daf66a57b67938796d4","scripts":{"test":"standard && tap test"},"_npmUser":{"name":"iarna","email":"me@re-becca.org"},"repository":{"url":"https://github.com/iarna/unique-filename.git","type":"git"},"_npmVersion":"2.7.6","description":"Generate a unique filename for use in temporary directories or caches.","directories":{},"_nodeVersion":"1.6.2","dependencies":{"unique-slug":"^1.0.0"},"devDependencies":{"tap":"^1.0.0","standard":"^3.7.3"}},"1.1.0":{"name":"unique-filename","version":"1.1.0","keywords":[],"author":{"url":"http://re-becca.org/","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"unique-filename@1.1.0","maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"homepage":"https://github.com/iarna/unique-filename","bugs":{"url":"https://github.com/iarna/unique-filename/issues"},"dist":{"shasum":"d05f2fe4032560871f30e93cbe735eea201514f3","tarball":"http://localhost:4260/unique-filename/unique-filename-1.1.0.tgz","integrity":"sha512-sVaLSV84DdBfiH2Mk655QxYvv0kKQs+fwo3obj/qS888/yTznhQqw1TCLdPs9HLtqq15VW5zD3vbpFW28FUZ0w==","signatures":[{"sig":"MEUCIQDUL8wllt5rf4i/mLFVsN2aik0sffDx70dFUKlDnDP40gIgS3sZqYBGZqoK+29NTY45jlg/reLXUKpxje+lJ78rMnI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"d05f2fe4032560871f30e93cbe735eea201514f3","gitHead":"cb31644c71f842258a8019e0e6ef8f2b8533a5c0","scripts":{"test":"standard && tap test"},"_npmUser":{"name":"iarna","email":"me@re-becca.org"},"repository":{"url":"git+https://github.com/iarna/unique-filename.git","type":"git"},"_npmVersion":"2.14.13","description":"Generate a unique filename for use in temporary directories or caches.","directories":{},"_nodeVersion":"4.2.2","dependencies":{"unique-slug":"^2.0.0"},"devDependencies":{"tap":"^2.3.1","standard":"^5.4.1"}},"1.1.1":{"name":"unique-filename","version":"1.1.1","keywords":[],"author":{"url":"http://re-becca.org/","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"unique-filename@1.1.1","maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"homepage":"https://github.com/iarna/unique-filename","bugs":{"url":"https://github.com/iarna/unique-filename/issues"},"dist":{"shasum":"1d69769369ada0583103a1e6ae87681b56573230","tarball":"http://localhost:4260/unique-filename/unique-filename-1.1.1.tgz","fileCount":15,"integrity":"sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==","signatures":[{"sig":"MEUCIQCAt9qYIh2b1UyztSllF6Ri970nomXwmulVHEqbwWUCrgIgeDuBF4IzuLkGwKf6rbuKct8i+ZfKd5boNYqUZ30cg/k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo83nCRA9TVsSAnZWagAAGUIP/RHKLBFB/61Nc2H7LVQj\n6aGrKRjQ+ZkQCGQODloPtfU8nQ94IJ7ZaD1ArcdDWu6oP2k5xJFsDKd/zxyQ\nPMPuAwkNDVZ4ndmRbKJ2Fzxq8B4eN20Q7t9PyvHWS2x8WOE1zzeLwDeBZI1f\nK8EUaTcaAj5du6TKUbnqVzqi5K2deWovlvDBPbFMqm84nO07Zbu50t0wHqDi\nIja76zlA8o2UiY2X4I044h8dV3n7wLF/yJoj7DPgcr+jrHY2R4BP/zMyjkZh\nRHiB+50TCHXUuvfnxmeoVNhAqnrUGVw4FE1NBRgVqgl1SX5KKhZO0XRRVMAN\nCN1dxQOoXFnLT4TZp8jgCQdtRkrTH/Um4Alz0gOPf39KTU96DFm+XmoTJGKK\nI2p7GsnC8zroAktlpXSuEJZp8sG9+35k9kdda/pQO8GjVPPUsA2E4US4iIpU\nAQUptUfNLIYHzYADJqEriiWjw4/ZH2spyvq4e4jPReQWq/P3flhqv+CPYrX2\n/hGTtopd5TfEwYAUxtMUZKXBh3RNnFr6Q2NPnUD+gddSyEdee+6nheaB9B7e\nYJaPyQ8/noK8NaWNUTnLV3/pkjT9BpDHduEvL0uGvc5jkH/DSPYGqSE0D6+s\n5xNHocG6mKADtl2qTXVEwoqZldEPc7x5trUxukSSJGGREImNwGgN1/faKeEj\nUHiH\r\n=/EXC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"3653bb94c8ae4497636f0767e0a35eb442b27d9f","scripts":{"test":"standard && tap test"},"_npmUser":{"name":"iarna","email":"me@re-becca.org"},"repository":{"url":"git+https://github.com/iarna/unique-filename.git","type":"git"},"_npmVersion":"6.4.1","description":"Generate a unique filename for use in temporary directories or caches.","directories":{},"_nodeVersion":"10.10.0","dependencies":{"unique-slug":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^2.3.1","standard":"^5.4.1"},"_npmOperationalInternal":{"tmp":"tmp/unique-filename_1.1.1_1537461734124_0.8229183281578927","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"unique-filename","version":"2.0.0","keywords":[],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"unique-filename@2.0.0","maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"homepage":"https://github.com/iarna/unique-filename","bugs":{"url":"https://github.com/iarna/unique-filename/issues"},"dist":{"shasum":"c844c84c3b22e92038b0c53950f9dc34d2b55490","tarball":"http://localhost:4260/unique-filename/unique-filename-2.0.0.tgz","fileCount":4,"integrity":"sha512-tpzoz2RpZ//6Zt4GPpOFTyrnfZuSvjIfe8lvx6Thp4yTQwJtAFwPlssEBE62VhGA2We5/COyNpcIu+OABu3/Yg==","signatures":[{"sig":"MEUCIQDfh8vBUTvBUQErLNl5auRT1HzI/yIyfe7c8LodBGwaLgIgGeVgLy95cGqR4UjBfgar6FL113SC0DNMhlPtG9pGgBk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjA/f9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOPBAAmJvxf2bVkBRqtZ7YM/I4W2Sd/enhWkvs5qwwvtRm3oKeSvYm\r\njVCkVTY0Bm94D8IwGBu5ld0ifU6djTBpHY7WzFpxK5rf+l3ieityfRHHrz12\r\ncwCPYViBISVq3e5EKi1TMHcnbzIlMdY5v6//ELGEVc/wlEVWEQzB+kSTj59i\r\n6/kV5GQD0h+HFXtcq80q21th+Ztg+WuyD2SmyGOprg5gFZ32CAZSDLSDLGfU\r\nJzzpzVrD9SksfyPR9Rfnli1LSAl9UW6PfCsUDWF2nRRptvV6mD8I2yF3VQgz\r\nk6ypbZemqzbnPFRW6jHJWD386bSpnwbIzZa90bfXBbs/FGUdG5iE2cLIMBVz\r\n4uXAgKpeVSPjXF/S8tk0qpAmnRtLbkQwGegNfHB7/BL0fzXtEkIBtFZnKha4\r\nwhCzKt+jj9R5Xnx5kEMhayhs2qDrV07Z0mvpWlRGQP5MRdTMXQSk+hq32nwc\r\nfddd8l0W9rNbM6TyTLIrlgQbu7///Byl5hw4ULObd2hQ2eSRvseyVWRiAdVV\r\n0tYBZ+gwQj//DgGZCqJr4RUjUSy6+nOcAuHqzF70vvyxpINPtMEoo85EbML4\r\nzVwH9E9lwozlma3/X00747hddY2DKRBmUXHzajA4HITrSovXSjC44/laN/b4\r\n+uJWzM21ZeNPjt31ARIDy9tBB+YBlKW9AY8=\r\n=NtPp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","engines":{"node":"^12.13.0 || ^14.15.0 || >=16.0.0"},"gitHead":"06656860015f1b22b7dbeeda57d1a9068e3c81e9","scripts":{"lint":"eslint \"**/*.js\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"lukekarrys","email":"luke@lukekarrys.com"},"repository":{"url":"git+https://github.com/npm/unique-filename.git","type":"git"},"_npmVersion":"8.18.0","description":"Generate a unique filename for use in temporary directories or caches.","directories":{},"templateOSS":{"version":"3.5.0","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"18.7.0","dependencies":{"unique-slug":"^2.0.2"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.0","@npmcli/template-oss":"3.5.0","@npmcli/eslint-config":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/unique-filename_2.0.0_1661204477651_0.8236295353510708","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"unique-filename","version":"2.0.1","keywords":[],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"unique-filename@2.0.1","maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"homepage":"https://github.com/iarna/unique-filename","bugs":{"url":"https://github.com/iarna/unique-filename/issues"},"dist":{"shasum":"e785f8675a9a7589e0ac77e0b5c34d2eaeac6da2","tarball":"http://localhost:4260/unique-filename/unique-filename-2.0.1.tgz","fileCount":4,"integrity":"sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==","signatures":[{"sig":"MEQCIEB43r0/4Sf3gesSTDQYy6is4TdVhf7HIrozTcQ6BZWrAiAVqQStaAPRAE35swdWsJYpairld5pbPHtp+wakK0yg0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB+JvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLdg/+JFpDq/+mDWuuU7Dha63a8OQPomUwE30ncAgfoNbB1hh2sa9P\r\nnznKHRMi38Qlh4sH+C0dYQEFR+YO9QRxMeJ9P7U9gZxISc7c5zh96Nj1tMCT\r\nV2xY+REgo3VDEgAV429j8iiwYA5ftQMhpfqDY5nbtEYgC9dU21xWh4FanC+K\r\nbIXh17VZTkBLATDNmyeoorXht2FRzDz+brnIFqlapBJs0u0KYWtBz3zggNnD\r\nlfj4tQFBjGT12uik1uG518jzowqvpMxTQcgYBmCq+2yyCzTa5ejQEjFsxteR\r\nJQfCc5PTG/Lqg8zH0TWhmlwI1f8I1T0WpAKypqv65r8C7QDowxDt8Gb0Dmcn\r\nyMlIUD1Zu88lAZUCWwmK05HFcuXYZ7eJ6o6wyKwsaIwjiX+ZZyr05ZBkFn/H\r\npcRe0n3Mg+J76blW1Ack1gBrP4ukYCNkUSdPuQoex8y+pl0yoDeLTx21w2vf\r\n+n/Gxi3bUG5Rc3DNACPO7J/ly8aOTO6SVjxEh5lvQXSn+rte5OeJk0Fp/Hkk\r\nwg050pjlhbVXRkkSMDroLHaFfgrgHJPrYEp3bnBHFr7SIiumgg0i510sy5km\r\nHjnLkI0mnOQgtlVgkRsjHTreHJcKcT2xvWBKwxF9rwdOoGG3bnnrhQAzpG4Q\r\n8FxZCWpEMD0hizbGCOmGckNzFL+suqA7EKY=\r\n=YdSB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","engines":{"node":"^12.13.0 || ^14.15.0 || >=16.0.0"},"gitHead":"a4a30d0febf64707bcfd3b8a03b1a0a2adf31fc7","scripts":{"lint":"eslint \"**/*.js\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"lukekarrys","email":"luke@lukekarrys.com"},"repository":{"url":"git+https://github.com/npm/unique-filename.git","type":"git"},"_npmVersion":"8.18.0","description":"Generate a unique filename for use in temporary directories or caches.","directories":{},"templateOSS":{"version":"3.5.0","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"18.7.0","dependencies":{"unique-slug":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.0","@npmcli/template-oss":"3.5.0","@npmcli/eslint-config":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/unique-filename_2.0.1_1661461102804_0.45215455602527466","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"unique-filename","version":"3.0.0","keywords":[],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"unique-filename@3.0.0","maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"homepage":"https://github.com/iarna/unique-filename","bugs":{"url":"https://github.com/iarna/unique-filename/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"48ba7a5a16849f5080d26c760c86cf5cf05770ea","tarball":"http://localhost:4260/unique-filename/unique-filename-3.0.0.tgz","fileCount":4,"integrity":"sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==","signatures":[{"sig":"MEUCIQC7AsCFOeTGcFtlnipoV/Cz7Ipqw6YjUhL11AQ19OQAogIgJpCmdRGqvybP0RZ3EOsOKNoT1qXW1Pc44wYejZL/KUM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSaHcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq99BAAkitPZqFX+xTRAdYaiPc6gxswhetNXAA2qAEjkTlHWvlO4c+o\r\nzFi9EUNF/hH8ecrxT+Fo2vu7hyojkMAaHdhrAK43YuEcUzaTcJUyQJsv/psk\r\nb4lNsyt7oO11JPxJ4eUJ53iM2dbZDOD5GlBaI4v0mdN+IFDldAwqNK6+XaE2\r\n3B0Q+fFJ7oEH608To1WxOKzm/6/pvt5YyClM+6ZQnd60Mj6CEy72yrPhpfCZ\r\nnx3UJkS8RzF/QLcJMIrk5dc+xSu6B7m4XHSLGNuobs1u4viEYw8Cf7Svg99t\r\nsWoHbuPJBniC/jRwyj4c1S+SgyUo0Ov00Lwt7qh7wJQHgptKgE9MidrOAX0o\r\nIFZiR2v6VBIrXb4M7qJwwgbo2bw6pQcDtsNzJ2A1STNIwH71/4h4cH3OPLKg\r\n8QgzzTh+4y2Ll9Ys4WokrrgBb1h8Sm4yAu7Me1LWVCrAn2PgpzUFtGLHbDmj\r\nKAgbg26lGi6QTR6J7BD0f2LgzMLQ/BeDRZV69TyCofTjKSyll+/e7aUux8bs\r\nmRCjGR77+az/6fH85NdYUBv3VTGTPpBijFWrbJ7IZG3KlBQlRZgCR7n507iG\r\njDh15JJkcf29g/syvLxACIYXg5ynmR5jXv0opTHe/HWLkfKDUUBzJJTX6slx\r\ngxe9TBAJ707IvbqGHmjZXshHiBAXwslhXhc=\r\n=KEBJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","engines":{"node":"^14.17.0 || ^16.13.0 || >=18.0.0"},"gitHead":"49d999ed740c2455755fd19f774571e81454a75e","scripts":{"lint":"eslint \"**/*.js\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"lukekarrys","email":"luke@lukekarrys.com"},"repository":{"url":"git+https://github.com/npm/unique-filename.git","type":"git"},"_npmVersion":"8.19.2","description":"Generate a unique filename for use in temporary directories or caches.","directories":{},"templateOSS":{"version":"4.5.1","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"18.10.0","dependencies":{"unique-slug":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.0","@npmcli/template-oss":"4.5.1","@npmcli/eslint-config":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/unique-filename_3.0.0_1665769948758_0.4243542363597814","host":"s3://npm-registry-packages"}}},"time":{"created":"2015-05-07T23:12:09.667Z","modified":"2024-05-30T15:09:48.178Z","1.0.0":"2015-05-07T23:12:09.667Z","1.1.0":"2015-12-03T23:00:37.437Z","1.1.1":"2018-09-20T16:42:14.396Z","2.0.0":"2022-08-22T21:41:17.826Z","2.0.1":"2022-08-25T20:58:22.978Z","3.0.0":"2022-10-14T17:52:28.921Z"},"maintainers":[{"email":"reggi@github.com","name":"reggi"},{"email":"npm-cli+bot@github.com","name":"npm-cli-ops"},{"email":"saquibkhan@github.com","name":"saquibkhan"},{"email":"fritzy@github.com","name":"fritzy"},{"email":"gar+npm@danger.computer","name":"gar"}],"author":{"name":"GitHub Inc."},"repository":{"url":"git+https://github.com/npm/unique-filename.git","type":"git"},"keywords":[],"license":"ISC","homepage":"https://github.com/iarna/unique-filename","bugs":{"url":"https://github.com/iarna/unique-filename/issues"},"readme":"unique-filename\n===============\n\nGenerate a unique filename for use in temporary directories or caches.\n\n```js\nconst uniqueFilename = require('unique-filename')\n\n// returns something like: '/tmp/c5b28f47'\nconst randomTmpfile = uniqueFilename(os.tmpdir())\n\n// returns something like: '/tmp/my-test-51a7b48d'\nconst randomPrefixedTmpfile = uniqueFilename(os.tmpdir(), 'my-test')\n\n// returns something like: '/my-tmp-dir/testing-7ddd44c0'\nconst uniqueTmpfile = uniqueFilename('/my-tmp-dir', 'testing', '/my/thing/to/uniq/on')\n```\n\n### uniqueFilename(*dir*, *fileprefix*, *uniqstr*) → String\n\nReturns the full path of a unique filename that looks like:\n`dir/prefix-7ddd44c0`\nor `dir/7ddd44c0`\n\n*dir* – The path you want the filename in. `os.tmpdir()` is a good choice for this.\n\n*fileprefix* – A string to append prior to the unique part of the filename.\nThe parameter is required if *uniqstr* is also passed in but is otherwise\noptional and can be `undefined`/`null`/`''`. If present and not empty\nthen this string plus a hyphen are prepended to the unique part.\n\n*uniqstr* – Optional, if not passed the unique part of the resulting\nfilename will be random. If passed in it will be generated from this string\nin a reproducible way.\n","readmeFilename":"README.md","users":{"iarna":true,"shiva127":true,"flumpus-dev":true,"mattmcfarland":true}} |