{"name":"random-path","version":"0.1.1","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","murmur-32":"^0.1.0"},"devDependencies":{"standard":"^8.0.0-beta.5"},"gitHead":"f546d2482bf9256ab939587890414d5b16ed7ab4","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.1","_shasum":"f8f4d36f75a134ca15fd39c7d7505fbf163b634c","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"dist":{"shasum":"f8f4d36f75a134ca15fd39c7d7505fbf163b634c","tarball":"http://registry-npm.ywwl.com/random-path/download/random-path-0.1.1.tgz","integrity":"sha512-nJlfe0JavSCD2se00usaNHIn9aFJvV1E250lI1CHz81eUKO0+2DGsn7KHVi2/WlSPaPWOZNujuFUN+HwfS3L7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDODgSQ0q0XD1DBy4sC4J+0fRx2BPXz7WmxjnBKMf6WegIhALd+DlEpNP1UjLkqIa3CRl4OM91uTsy6W93rvzw71jZy"}],"size":1742,"noattachment":false,"key":"/random-path/-/random-path-0.1.1.tgz"},"maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/random-path-0.1.1.tgz_1478610097164_0.19807775504887104"},"directories":{},"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":1478610099195,"_cnpm_publish_time":1478610099195,"dist-tags":{"latest":"1.0.0"}}