{"_id":"tmp-file","_rev":"4202541","name":"tmp-file","description":"Create actual and temporary file on /tmp folder","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"},{"name":"vanchoy","email":"super.ludiq@gmail.com"}],"time":{"modified":"2026-03-02T03:11:04.000Z","created":"2015-05-23T12:54:56.510Z","2.0.1":"2017-01-03T02:20:27.742Z","2.0.0":"2017-01-03T02:18:02.253Z","1.0.0":"2015-05-23T17:52:58.885Z","0.0.0":"2015-05-23T12:54:56.510Z"},"users":{},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://i.am.charlike.online"},"repository":{"type":"git","url":"git+https://github.com/tunnckocore/tmp-file.git"},"versions":{"2.0.1":{"name":"tmp-file","version":"2.0.1","description":"Create actual and temporary file on /tmp folder","repository":{"type":"git","url":"git+https://github.com/tunnckocore/tmp-file.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://i.am.charlike.online"},"precommit.silent":true,"main":"index.js","license":"MIT","scripts":{"lint":"standard --verbose","pretest":"npm run lint","test":"npm run coverage","posttest":"npm run lint:coverage","coverage":"nyc node test.js","lint:coverage":"nyc check-coverage --lines 100 --branches 100 --statements 100 --functions 100","report-coverage":"nyc report --reporter=text-lcov | coveralls","prerelease":"npm test","release":"standard-version --sign --no-verify","precommit":"git add --all","commit":"git-cz"},"dependencies":{"tmp-filepath":"^2.0.0"},"devDependencies":{"commitizen":"^2.9.2","coveralls":"^2.11.15","cz-conventional-changelog":"^1.2.0","mukla":"^0.4.8","nyc":"^10.0.0","pre-commit":"^1.2.2","rimraf":"^2.5.4","standard":"^8.6.0","standard-version":"^4.0.0"},"files":["index.js"],"keywords":["create","createfile","cuid","disk","fast","file","generate","id","scalable","temp","temporary","tmp","uid","uuid","write","writefile"],"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=4","npm":">=2"},"verb":{"run":true,"toc":{"render":true,"method":"preWrite","maxdepth":3,"footer":""},"layout":"empty","tasks":["readme"],"related":{"list":["always-done","minibase","try-catch-core","tmp-filepath","rolldown","rollup"],"highlight":"always-done"},"reflinks":["always-done","async-done","base","charlike","commitizen","dezalgo","once","standard-version","verb","verb-generate-readme","cuid","rollup","tmp-filepath"],"lint":{"reflinks":true}},"gitHead":"0d7eba81a363a0b00566d205af7bdc624fe10223","bugs":{"url":"https://github.com/tunnckocore/tmp-file/issues"},"homepage":"https://github.com/tunnckocore/tmp-file#readme","_id":"tmp-file@2.0.1","_shasum":"b503bbb67ebd989e2a67d903fad906b3ca71f96e","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.3.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"b503bbb67ebd989e2a67d903fad906b3ca71f96e","size":5612,"noattachment":false,"key":"/tmp-file/-/tmp-file-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/tmp-file/download/tmp-file-2.0.1.tgz"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"},{"name":"vanchoy","email":"super.ludiq@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tmp-file-2.0.1.tgz_1483410027079_0.037610518746078014"},"directories":{},"_cnpmcore_publish_time":"2021-12-23T04:18:10.766Z","publish_time":1483410027742,"_cnpm_publish_time":1483410027742},"2.0.0":{"name":"tmp-file","version":"2.0.0","description":"Create actual and temporary file on /tmp folder","repository":{"type":"git","url":"git+https://github.com/tunnckocore/tmp-file.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://i.am.charlike.online"},"precommit.silent":true,"main":"index.js","license":"MIT","scripts":{"lint":"standard --verbose","pretest":"npm run lint","test":"npm run coverage","posttest":"npm run lint:coverage","coverage":"nyc node test.js","lint:coverage":"nyc check-coverage --lines 100 --branches 100 --statements 100 --functions 100","report-coverage":"nyc report --reporter=text-lcov | coveralls","prerelease":"npm test","release":"standard-version --sign --no-verify","precommit":"git add --all","commit":"git-cz"},"dependencies":{"tmp-filepath":"^2.0.0"},"devDependencies":{"commitizen":"^2.9.2","coveralls":"^2.11.15","cz-conventional-changelog":"^1.2.0","mukla":"^0.4.8","nyc":"^10.0.0","pre-commit":"^1.2.2","rimraf":"^2.5.4","standard":"^8.6.0","standard-version":"^4.0.0"},"files":["index.js"],"keywords":["create","createfile","cuid","disk","fast","file","generate","id","scalable","temp","temporary","tmp","uid","uuid","write","writefile"],"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=4","npm":">=2"},"verb":{"run":true,"toc":{"render":true,"method":"preWrite","maxdepth":3,"footer":""},"layout":"empty","tasks":["readme"],"related":{"list":["always-done","minibase","try-catch-core","tmp-filepath","rolldown","rollup"],"highlight":"always-done"},"reflinks":["always-done","async-done","base","charlike","commitizen","dezalgo","once","standard-version","verb","verb-generate-readme","cuid","rollup","tmp-filepath"],"lint":{"reflinks":true}},"gitHead":"e2e6bc267cadde8e1706b6de7074e5371006a1a3","bugs":{"url":"https://github.com/tunnckocore/tmp-file/issues"},"homepage":"https://github.com/tunnckocore/tmp-file#readme","_id":"tmp-file@2.0.0","_shasum":"7a60ce02488b4689e443a8a5c41b23237e82c06f","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.3.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"dist":{"shasum":"7a60ce02488b4689e443a8a5c41b23237e82c06f","size":5433,"noattachment":false,"key":"/tmp-file/-/tmp-file-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tmp-file/download/tmp-file-2.0.0.tgz"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"},{"name":"vanchoy","email":"super.ludiq@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/tmp-file-2.0.0.tgz_1483409880077_0.31605643266811967"},"directories":{},"_cnpmcore_publish_time":"2021-12-23T04:18:09.835Z","publish_time":1483409882253,"_cnpm_publish_time":1483409882253},"1.0.0":{"name":"tmp-file","version":"1.0.0","description":"Create actual and temporary file on disk - support stream, sync, gulp, vinyl and async. Returns partially Record/Vinyl File Object","repository":{"type":"git","url":"git+https://github.com/tunnckocore/tmp-file.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"main":"index.js","license":"MIT","scripts":{"test":"standard && node test.js"},"dependencies":{"graceful-fs":"~3.0.7","hybridify":"~1.0.9","through2":"~0.6.5","tmp-filepath":"~1.0.0","vinyl":"~0.4.6","vinyl-file":"~1.1.1"},"devDependencies":{"assertit":"^0.1.0","is-promise":"^2.0.0","is-stream":"^1.0.1","os-tmpdir":"^1.0.1"},"keywords":["async","create","disk","file","hybrid","hybridify","promise","record","spec","stream","sync","temp","temp-file","tempfile","tmp","tmpfile","vinyl"],"gitHead":"e6779e46b7f801f75619712f63ecf6a9d3fcd5d6","bugs":{"url":"https://github.com/tunnckocore/tmp-file/issues"},"homepage":"https://github.com/tunnckocore/tmp-file#readme","_id":"tmp-file@1.0.0","_shasum":"cd21f1cdffe811627196c08e0aefdb871151c8f2","_from":".","_npmVersion":"2.10.0","_nodeVersion":"2.0.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"},{"name":"vanchoy","email":"super.ludiq@gmail.com"}],"dist":{"shasum":"cd21f1cdffe811627196c08e0aefdb871151c8f2","size":6134,"noattachment":false,"key":"/tmp-file/-/tmp-file-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tmp-file/download/tmp-file-1.0.0.tgz"},"directories":{},"_cnpmcore_publish_time":"2021-12-23T04:18:08.905Z","publish_time":1432403578885,"_cnpm_publish_time":1432403578885},"0.0.0":{"name":"tmp-file","version":"0.0.0","description":"Create actual and temporary file on disk - support stream, sync, gulp, vinyl and async. Returns partially Record/Vinyl File Object","repository":{"type":"git","url":"git+https://github.com/tunnckocore/tmp-file.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"main":"index.js","license":"MIT","scripts":{"test":"standard && node test.js"},"dependencies":{"graceful-fs":"^3.0.7","hybridify":"^1.0.9","through2":"^0.6.5","tmp-filepath":"^1.0.0","vinyl":"^0.4.6"},"devDependencies":{"assertit":"^0.1.0","is-promise":"^2.0.0","is-stream":"^1.0.1","os-tmpdir":"^1.0.1"},"keywords":[],"gitHead":"67070d487080919b649890d7fd718da0d2b8e48f","bugs":{"url":"https://github.com/tunnckocore/tmp-file/issues"},"homepage":"https://github.com/tunnckocore/tmp-file#readme","_id":"tmp-file@0.0.0","_shasum":"75ec368213afeb098c75602e6b55353311b019a8","_from":".","_npmVersion":"2.10.0","_nodeVersion":"2.0.0","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"},{"name":"vanchoy","email":"super.ludiq@gmail.com"}],"dist":{"shasum":"75ec368213afeb098c75602e6b55353311b019a8","size":4692,"noattachment":false,"key":"/tmp-file/-/tmp-file-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tmp-file/download/tmp-file-0.0.0.tgz"},"directories":{},"_cnpmcore_publish_time":"2021-12-23T04:18:07.999Z","publish_time":1432385696510,"_cnpm_publish_time":1432385696510}},"readme":"# tmp-file [![NPM version](https://img.shields.io/npm/v/tmp-file.svg?style=flat)](https://www.npmjs.com/package/tmp-file) [![NPM monthly downloads](https://img.shields.io/npm/dm/tmp-file.svg?style=flat)](https://npmjs.org/package/tmp-file) [![npm total downloads][downloads-img]][downloads-url]\n\n> Create actual and temporary file on /tmp folder\n\n[![code climate][codeclimate-img]][codeclimate-url] \n[![standard code style][standard-img]][standard-url] \n[![linux build status][travis-img]][travis-url] \n[![windows build status][appveyor-img]][appveyor-url] \n[![coverage status][coveralls-img]][coveralls-url] \n[![dependency status][david-img]][david-url]\n\nYou might also be interested in [always-done](https://github.com/hybridables/always-done#readme).\n\n## Table of Contents\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n  * [.generateFile](#generatefile)\n  * [.writeFile](#writefile)\n- [Related](#related)\n- [Contributing](#contributing)\n- [Building docs](#building-docs)\n- [Running tests](#running-tests)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Install\nInstall with [npm](https://www.npmjs.com/)\n\n```\n$ npm install tmp-file --save\n```\n\nor install using [yarn](https://yarnpkg.com)\n\n```\n$ yarn add tmp-file\n```\n\n## Usage\n> For more use-cases see the [tests](test.js)\n\n```js\nconst tmpFile = require('tmp-file')\n```\n\n## API\n\n### [.generateFile](index.js#L38)\n> Generates a \"file\" object with `path` and `contents` properties without writing to disk. Where `file.path` will be random string to OS tmp folder, using [tmp-filepath][]. And `file.contents` will be the passed `contents` or empty string.\n\n**Params**\n\n* `[contents]` **{String|Buffer}**: completely optional, string or buffer passed to `fs.writeFile`    \n* `returns` **{Object}**: plain file object  \n\n**Example**\n\n```js\nconst tmp = require('tmp-file')\n\nconst file = tmp.generateFile('foo bar contents')\n\nconsole.log(file.path) // => '/tmp/cia0ervrm0000vppvw0t61v9m'\nconsole.log(file.contents) // => 'foo bar contents'\n```\n\n### [.writeFile](index.js#L81)\n> Write a temporary file to disk on OS tmp folder. It generates a file object using `.generateFile` method which in turn uses [tmp-filepath][] to generate random filepath to tmp folder.\n\n**Note:** This function is exported as `module.exports`,\n`exports.default` and `exports.writeFile`. If you don't\nunderstand what we are talking about, just see the example below.\n\n**Params**\n\n* `[contents]` **{String|Buffer}**: completely optional, string or buffer, passed to `fs.writeFile`    \n* `returns` **{Promise}**: resolved promise with file object  \n\n**Example**\n\n```js\nconst tmpFile = require('tmp-file')\n// or\n// const tmpFile = require('tmp-file').default\n// or\n// const tmpFile = require('tmp-file').writeFile\n\ntmpFile('quxie pixie').then((file) => {\n  console.log(file.path) // => '/tmp/da4sd0e534d0vppvw0t61v9m'\n  console.log(file.contents) // => 'quxie pixie'\n})\n```\n\n## Related\n- [always-done](https://www.npmjs.com/package/always-done): Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement… [more](https://github.com/hybridables/always-done#readme) | [homepage](https://github.com/hybridables/always-done#readme \"Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement for [async-done][] - pass 100% of its tests plus more\")\n- [minibase](https://www.npmjs.com/package/minibase): Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing… [more](https://github.com/node-minibase/minibase#readme) | [homepage](https://github.com/node-minibase/minibase#readme \"Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing [base][] plugins.\")\n- [rolldown](https://www.npmjs.com/package/rolldown): Modern bundler built on [rollup][] with support for presets and better configuration experience | [homepage](https://github.com/rolldown/rolldown#readme \"Modern bundler built on [rollup][] with support for presets and better configuration experience\")\n- [rollup](https://www.npmjs.com/package/rollup): Next-generation ES6 module bundler | [homepage](https://github.com/rollup/rollup \"Next-generation ES6 module bundler\")\n- [tmp-filepath](https://www.npmjs.com/package/tmp-filepath): Generate temporary filepath string (without writing to disk). Using scaleable, secure and fast cross-platform [cuid][] package | [homepage](https://github.com/tunnckocore/tmp-filepath#readme \"Generate temporary filepath string (without writing to disk). Using scaleable, secure and fast cross-platform [cuid][] package\")\n- [try-catch-core](https://www.npmjs.com/package/try-catch-core): Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and… [more](https://github.com/hybridables/try-catch-core#readme) | [homepage](https://github.com/hybridables/try-catch-core#readme \"Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and used in higher-level libs such as [always-done][] to handle completion of anything.\")\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/tmp-file/issues/new).  \nPlease read the [contributing guidelines](CONTRIBUTING.md) for advice on opening issues, pull requests, and coding standards.  \nIf you need some help and can spent some cash, feel free to [contact me at CodeMentor.io](https://www.codementor.io/tunnckocore?utm_source=github&utm_medium=button&utm_term=tunnckocore&utm_campaign=github) too.\n\n**In short:** If you want to contribute to that project, please follow these things\n\n1. Please DO NOT edit [README.md](README.md), [CHANGELOG.md](CHANGELOG.md) and [.verb.md](.verb.md) files. See [\"Building docs\"](#building-docs) section.\n2. Ensure anything is okey by installing the dependencies and run the tests. See [\"Running tests\"](#running-tests) section.\n3. Always use `npm run commit` to commit changes instead of `git commit`, because it is interactive and user-friendly. It uses [commitizen][] behind the scenes, which follows Conventional Changelog idealogy.\n4. Do NOT bump the version in package.json. For that we use `npm run release`, which is [standard-version][] and follows Conventional Changelog idealogy.\n\nThanks a lot! :)\n\n## Building docs\nDocumentation and that readme is generated using [verb-generate-readme][], which is a [verb][] generator, so you need to install both of them and then run `verb` command like that\n\n```\n$ npm install verbose/verb#dev verb-generate-readme --global && verb\n```\n\n_Please don't edit the README directly. Any changes to the readme must be made in [.verb.md](.verb.md)._\n\n## Running tests\nClone repository and run the following in that cloned directory\n\n```\n$ npm install && npm test\n```\n\n## Author\n**Charlike Mike Reagent**\n\n+ [github/tunnckoCore](https://github.com/tunnckoCore)\n+ [twitter/tunnckoCore](http://twitter.com/tunnckoCore)\n+ [codementor/tunnckoCore](https://codementor.io/tunnckoCore)\n\n## License\nCopyright © 2016-2017, [Charlike Mike Reagent](http://i.am.charlike.online). Released under the [MIT license](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.3, on January 03, 2017._  \n_Project scaffolded using [charlike][] cli._\n\n[always-done]: https://github.com/hybridables/always-done\n[async-done]: https://github.com/gulpjs/async-done\n[base]: https://github.com/node-base/base\n[charlike]: https://github.com/tunnckocore/charlike\n[commitizen]: https://github.com/commitizen/cz-cli\n[cuid]: https://github.com/ericelliott/cuid\n[dezalgo]: https://github.com/npm/dezalgo\n[once]: https://github.com/isaacs/once\n[rollup]: https://github.com/rollup/rollup\n[standard-version]: https://github.com/conventional-changelog/standard-version\n[tmp-filepath]: https://github.com/tunnckocore/tmp-filepath\n[verb-generate-readme]: https://github.com/verbose/verb-generate-readme\n[verb]: https://github.com/verbose/verb\n\n[downloads-url]: https://www.npmjs.com/package/tmp-file\n[downloads-img]: https://img.shields.io/npm/dt/tmp-file.svg\n\n[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/tmp-file\n[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/tmp-file.svg\n\n[travis-url]: https://travis-ci.org/tunnckoCore/tmp-file\n[travis-img]: https://img.shields.io/travis/tunnckoCore/tmp-file/master.svg?label=linux\n\n[appveyor-url]: https://ci.appveyor.com/project/tunnckoCore/tmp-file\n[appveyor-img]: https://img.shields.io/appveyor/ci/tunnckoCore/tmp-file/master.svg?label=windows\n\n[coveralls-url]: https://coveralls.io/r/tunnckoCore/tmp-file\n[coveralls-img]: https://img.shields.io/coveralls/tunnckoCore/tmp-file.svg\n\n[david-url]: https://david-dm.org/tunnckoCore/tmp-file\n[david-img]: https://img.shields.io/david/tunnckoCore/tmp-file.svg\n\n[standard-url]: https://github.com/feross/standard\n[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n\n","_attachments":{},"homepage":"https://github.com/tunnckocore/tmp-file#readme","bugs":{"url":"https://github.com/tunnckocore/tmp-file/issues"},"license":"MIT"}