{"_id":"random-path","_rev":"391380","name":"random-path","description":"Generate a random path name.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"linusu","email":""}],"time":{"modified":"2021-08-04T03:54:11.000Z","created":"2016-08-21T22:34:28.511Z","1.0.0":"2021-07-24T12:40:58.909Z","0.1.2":"2020-05-18T19:01:48.606Z","0.1.1":"2016-11-08T13:01:39.195Z","0.1.0":"2016-08-21T22:34:28.511Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/LinusU/node-random-path.git"},"versions":{"1.0.0":{"name":"random-path","version":"1.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/LinusU/node-random-path.git"},"type":"module","exports":"./index.js","scripts":{"test":"standard && node test && ts-readme-generator --check"},"dependencies":{"base32-encode":"^2.0.0","murmur-32":"^1.0.0"},"devDependencies":{"standard":"^16.0.3","ts-readme-generator":"^0.5.1"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"gitHead":"9c8f58ef03a17545f1937444017031232b325887","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@1.0.0","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"shasum":"4e544014b2d434bee73d0266782711258a196726","size":2065,"noattachment":false,"key":"/random-path/-/random-path-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/random-path/download/random-path-1.0.0.tgz"},"_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"directories":{},"maintainers":[{"name":"linusu","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-path_1.0.0_1627130458760_0.5701327413374477"},"_hasShrinkwrap":false,"publish_time":1627130458909,"_cnpm_publish_time":1627130458909},"0.1.2":{"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":{"shasum":"78b7f1570e2a09f66a4e2e0113a98ed588e85da9","size":1679,"noattachment":false,"key":"/random-path/-/random-path-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/random-path/download/random-path-0.1.2.tgz"},"maintainers":[{"name":"linusu","email":""}],"_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,"publish_time":1589828508606,"_cnpm_publish_time":1589828508606},"0.1.1":{"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","size":1742,"noattachment":false,"key":"/random-path/-/random-path-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/random-path/download/random-path-0.1.1.tgz"},"maintainers":[{"name":"linusu","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/random-path-0.1.1.tgz_1478610097164_0.19807775504887104"},"directories":{},"publish_time":1478610099195,"_cnpm_publish_time":1478610099195,"_hasShrinkwrap":false},"0.1.0":{"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","size":1737,"noattachment":false,"key":"/random-path/-/random-path-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/random-path/download/random-path-0.1.0.tgz"},"maintainers":[{"name":"linusu","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/random-path-0.1.0.tgz_1471818867076_0.6363853418733925"},"directories":{},"publish_time":1471818868511,"_cnpm_publish_time":1471818868511,"_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","_attachments":{},"homepage":"https://github.com/LinusU/node-random-path#readme","bugs":{"url":"https://github.com/LinusU/node-random-path/issues"},"license":"MIT"}