{"name":"random-path","version":"0.1.2","license":"MIT","repository":{"type":"git","url":"git+https://github.com/LinusU/node-random-path.git"},"scripts":{"test":"standard && node test"},"dependencies":{"base32-encode":"^0.1.0 || ^1.0.0","murmur-32":"^0.1.0 || ^0.2.0"},"devDependencies":{"standard":"^14.3.4"},"gitHead":"de6e1e1e76f4e853e30e620b0d35d0b33f53d15d","description":"Generate a random path name.","bugs":{"url":"https://github.com/LinusU/node-random-path/issues"},"homepage":"https://github.com/LinusU/node-random-path#readme","_id":"random-path@0.1.2","_nodeVersion":"14.0.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4jY0yoEaQ5v9StCl5kZbNIQlg1QheIDBrdkDn53EynpPb9FgO6//p3X/tgMnrC45XN6QZCzU1Xz/+pSSsJBpRw==","shasum":"78b7f1570e2a09f66a4e2e0113a98ed588e85da9","tarball":"http://registry-npm.ywwl.com/random-path/download/random-path-0.1.2.tgz","fileCount":4,"unpackedSize":3899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtucCRA9TVsSAnZWagAA+YMQAJAYoKusCC3Acyt2B78+\nbe46aibEd8ui1XD+t/TXPsYuBmj98HUBANZ1tVyfxQtQ9AEUGwhylO8IOxx6\nvRDHa41mBiNzyKUUcXf+h++LKZ2QZkNif14y8ihW8yRgD/YvkkIdi16uSW1Q\nYloL3whsXFvmT7gta3LXTBnM7zwxGC14Jot02Hjobtu0Mv8PNzd7tim6jAfz\nwUGf++KxHla62BqXiRFcTczoPH9sAlDtJi9iMgJOHBPxeI74SVENf6b18J/G\n1o/IXin7YU1CgX/S4RbZQGjSY78Vv/keclhyhGaR3MoB4GhLAuO7Gfrs122t\nYoLlCvzHaqg3LCGeWbFBU+KVZoWqdXFSU2GU1KJDhrXb0Sx26+Q3tO860Ixl\nd5u05wqjdmXnVqtqpb3xp2NKhj8BIXGG8uzfihC7muyA1szkMw80bCDvriWY\nFJ2nQy8S/fWnDXqQr1d2Ljj6sbN4h3PO6jhqC3Vv/xWpHWo/pnR752zPnGt2\neczgU+vGa5s38EumH1r5Fm0TFrDalEqt6B0ouPhjMYXXnwkeEhOApZcxSR8t\nOAa80BXfr236glYC3X3rnF2FuQF0zmV+YHgH0wq/SR9Gu/j0XgOEwpY6kxjz\niB0qFYrLGDyIuL+aG1SLcm3iHNhVDAPS8phvdyaEacA0Em0Rah8mw63BlRXU\nSpvP\r\n=b/+b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAX7tomOjvVxNw3G4MoCyooiXUUesEz/RhHc9hW+GMhOAiEAqkHrMmYJKRcYngxPGy+YCMhREO+D2aLaCg+U1J1p5rQ="}],"size":1679,"noattachment":false,"key":"/random-path/-/random-path-0.1.2.tgz"},"maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"}],"_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-path_0.1.2_1589828508467_0.44532207779165334"},"_hasShrinkwrap":false,"readme":"# Random Path\n\nGenerate a random path name.\n\n## Installation\n\n```sh\nnpm install --save random-path\n```\n\n## Usage\n\n```js\nimport os from 'node:os'\nimport randomPath from 'random-path'\n\nconst path = randomPath(os.tmpDir(), '%s.txt')\n\nconsole.log(path)\n//=> /tmp/Y374CW8.txt\n```\n\n## API\n\n### `randomPath(directory, template)`\n\n- `directory` (`string`, required)\n- `template` (`string`, required)\n- returns `string` - the generated path\n\nGenerates a random path name with the specified `directory` and `template`.\n\n`template` should be a string where `%s` will be replaced with some random characters (e.g. `'linusu-%s'`). The string should contain `%s` exactly once. If you want to include a literal percent sign, escape it with another one, e.g. `'%%string'` becomes `'%string'`.\n\n**Important:** This module makes no guarantees on wether there exists a file at the returned path or not. Do not simply write data to the returned path. If you want a random file, use the higher level module [fs-temp](https://github.com/LinusU/fs-temp).\n\n### `validateTemplate(template)`\n\n- `template` (`string`, required)\n\nCheck to see if the template is a valid template accepted by `randomPath`. Throws an error if the template is invalid.\n\n## See also\n\n- [fs-temp](https://github.com/LinusU/fs-temp) - A quick and simple way to create temporary files and directories.\n","publish_time":1589828508606,"_cnpm_publish_time":1589828508606,"dist-tags":{"latest":"1.0.0"}}