{"name":"random-path","version":"0.1.0","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":"085a04f741be9ae76a1a3a433eed5c76426d2c7f","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.0","_shasum":"df2639d3467facf767f6d849cc4933a10417c946","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"dist":{"shasum":"df2639d3467facf767f6d849cc4933a10417c946","tarball":"http://registry-npm.ywwl.com/random-path/download/random-path-0.1.0.tgz","integrity":"sha512-CJR/Q/uz97NUa9idc2kfTx5nyXBE4XHZy41wVL4In2lzfyUBdbQ67+qq04OU+uY95p1NqgSPIin2QgTYNFjqfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkQr7vHtT7zdw8Dw2ODAMqVdsRmKIz/MIvt99PEPkFJQIgHKrYoGo+SB4AbldQhJQGr523xZ1H+elbDW8kmeEdbEM="}],"size":1737,"noattachment":false,"key":"/random-path/-/random-path-0.1.0.tgz"},"maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/random-path-0.1.0.tgz_1471818867076_0.6363853418733925"},"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":1471818868511,"_cnpm_publish_time":1471818868511,"dist-tags":{"latest":"1.0.0"}}