{"_id":"with-open-file","_rev":"35552","name":"with-open-file","description":"Do stuff with an open file, knowing it will finally be closed","dist-tags":{"latest":"0.1.7"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"time":{"modified":"2021-06-03T10:07:41.000Z","created":"2018-08-22T14:07:51.931Z","0.1.7":"2019-11-07T09:30:37.700Z","0.1.6":"2019-03-28T18:37:20.637Z","0.1.5":"2019-01-22T21:27:56.255Z","0.1.4":"2018-09-12T07:49:29.933Z","0.1.3":"2018-08-22T19:40:37.186Z","0.1.2":"2018-08-22T19:39:02.994Z","0.1.1":"2018-08-22T19:10:54.477Z","0.1.0":"2018-08-22T14:07:51.931Z"},"users":{},"author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"versions":{"0.1.7":{"name":"with-open-file","version":"0.1.7","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"xo && nyc ava"},"dependencies":{"p-finally":"^1.0.0","p-try":"^2.1.0","pify":"^4.0.1"},"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","nyc":"^14.1.1","rewire":"^4.0.1","sinon":"^7.3.1","xo":"^0.24.0"},"engines":{"node":">=6"},"keywords":["node","node.js","close","fd","file","finally","fs","open","with"],"gitHead":"08a75ce2b6ae7f522a9da6dab6ecb95daf1a34aa","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.7","_nodeVersion":"10.15.3","_npmVersion":"6.12.1","dist":{"shasum":"e2de8d974e8a8ae6e58886be4fe8e7465b58a729","size":1857,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.7.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.7_1573119037564_0.09772643440435425"},"_hasShrinkwrap":false,"publish_time":1573119037700,"_cnpm_publish_time":1573119037700},"0.1.6":{"name":"with-open-file","version":"0.1.6","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"xo && nyc ava"},"dependencies":{"p-finally":"^1.0.0","p-try":"^2.1.0","pify":"^4.0.1"},"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","nyc":"^13.3.0","rewire":"^4.0.1","sinon":"^7.3.1","xo":"^0.24.0"},"engines":{"node":">=6"},"keywords":["node","node.js","close","fd","file","finally","fs","open","with"],"gitHead":"2e081d6eed0464cfb56ff9592896574fca97b514","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.6","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"shasum":"0bc178ecab75f6baac8ae11c85e07445d690ea50","size":1861,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.6.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.6_1553798240425_0.8029748711809106"},"_hasShrinkwrap":false,"publish_time":1553798240637,"_cnpm_publish_time":1553798240637},"0.1.5":{"name":"with-open-file","version":"0.1.5","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"xo && nyc ava"},"dependencies":{"p-finally":"^1.0.0","p-try":"^2.0.0","pify":"^3.0.0"},"devDependencies":{"ava":"^0.25.0","delay":"^3.1.0","nyc":"^12.0.2","rewire":"^4.0.1","sinon":"^6.1.5","xo":"^0.21.0"},"engines":{"node":">=6"},"keywords":["node","node.js","close","fd","file","finally","fs","open","with"],"gitHead":"d0781529b1623e512b02b4d0fd4d781cf3fd4ed6","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.5","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"dist":{"shasum":"877239a04e56ec92ebb1f698809d03b93e07aabc","size":1859,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.5.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.5_1548192476147_0.45372012705538434"},"_hasShrinkwrap":false,"publish_time":1548192476255,"_cnpm_publish_time":1548192476255},"0.1.4":{"name":"with-open-file","version":"0.1.4","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"xo && nyc ava"},"dependencies":{"p-finally":"^1.0.0","p-try":"^2.0.0","pify":"^3.0.0"},"devDependencies":{"ava":"^0.25.0","delay":"^3.1.0","nyc":"^12.0.2","rewire":"^4.0.1","sinon":"^6.1.5","xo":"^0.21.0"},"engines":{"node":">=6"},"keywords":["node","node.js","close","fd","file","finally","fs","open","with"],"gitHead":"0b4cf1c39bff75329bc6122b28e54ed1cb315611","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.4","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"dist":{"shasum":"797e32055cbe55c58727ad026482fb0776474b2c","size":1862,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.4.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.4_1536738569737_0.2621441397956823"},"_hasShrinkwrap":false,"publish_time":1536738569933,"_cnpm_publish_time":1536738569933},"0.1.3":{"name":"with-open-file","version":"0.1.3","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"files":["index.js"],"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"xo && nyc ava"},"dependencies":{"p-finally":"^1.0.0","p-try":"^2.0.0","pify":"^3.0.0"},"devDependencies":{"ava":"^0.25.0","delay":"^3.1.0","nyc":"^12.0.2","rewire":"^4.0.1","sinon":"^6.1.5","xo":"^0.21.0"},"engines":{"node":">=6"},"keywords":["close","fd","file","finally","fs","open","with"],"gitHead":"eebf6e27c4f75b84bb5a3f9b385008d4169c297f","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.3","_npmVersion":"6.3.0","_nodeVersion":"10.8.0","_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"dist":{"shasum":"9d8ed7a993cd15c55b3f7b815930a94c430885a1","size":1854,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.3.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.3_1534966837070_0.17322100433608534"},"_hasShrinkwrap":false,"publish_time":1534966837186,"_cnpm_publish_time":1534966837186},"0.1.2":{"name":"with-open-file","version":"0.1.2","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"files":["index.js"],"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"xo && nyc ava"},"dependencies":{"p-finally":"^1.0.0","p-try":"^2.0.0","pify":"^3.0.0"},"devDependencies":{"ava":"^0.25.0","delay":"^3.1.0","nyc":"^12.0.2","rewire":"^4.0.1","sinon":"^6.1.5","xo":"^0.21.0"},"engines":{"node":">=6"},"keywords":["close","fd","file","finally","fs","open","with"],"gitHead":"c8b481494d4b638b8b8fc55657e4b23b36e7a668","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.2","_npmVersion":"6.3.0","_nodeVersion":"10.8.0","_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"dist":{"shasum":"7f7bdc92be81e6d45dbdbeed050416f4774731aa","size":1781,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.2.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.2_1534966742877_0.7398624076423161"},"_hasShrinkwrap":false,"publish_time":1534966742994,"_cnpm_publish_time":1534966742994},"0.1.1":{"name":"with-open-file","version":"0.1.1","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"files":["index.js"],"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"xo && nyc ava"},"dependencies":{"p-finally":"^1.0.0","p-try":"^2.0.0","pify":"^3.0.0"},"devDependencies":{"ava":"^0.25.0","delay":"^3.1.0","nyc":"^12.0.2","rewire":"^4.0.1","sinon":"^6.1.5","xo":"^0.21.0"},"engines":{"node":">=6"},"keywords":["close","fd","file","finally","fs","open","with"],"gitHead":"6ca92ad3badf3966ab2487bc4e34fa884a1a5c7e","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.1","_npmVersion":"6.3.0","_nodeVersion":"10.8.0","_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"dist":{"shasum":"15df01ce24eb357c8eba3eb15453f64db4162a3f","size":1813,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.1.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.1_1534965054348_0.17207124348421687"},"_hasShrinkwrap":false,"publish_time":1534965054477,"_cnpm_publish_time":1534965054477},"0.1.0":{"name":"with-open-file","version":"0.1.0","description":"Do stuff with an open file, knowing it will finally be closed","repository":{"type":"git","url":"git+https://github.com/raphinesse/with-open-file.git"},"license":"MIT","author":{"name":"Raphael von der Grün","email":"raphinesse@gmail.com"},"files":["index.js"],"xo":{"space":2,"prettier":true},"prettier":{"bracketSpacing":true,"semi":false,"singleQuote":true,"trailingComma":"es5"},"scripts":{"test":"ava"},"dependencies":{"p-finally":"^1.0.0","pify":"^3.0.0"},"devDependencies":{"ava":"^0.25.0","rewire":"^4.0.1","sinon":"^6.1.5","xo":"^0.22.0"},"engines":{"node":">=6"},"keywords":["close","fd","file","finally","fs","open","with"],"gitHead":"2eca2b0847482a29fd4a3507ccd9e134ad50bdc3","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"homepage":"https://github.com/raphinesse/with-open-file#readme","_id":"with-open-file@0.1.0","_npmVersion":"6.3.0","_nodeVersion":"10.8.0","_npmUser":{"name":"raphinesse","email":"raphinesse@gmail.com"},"dist":{"shasum":"bf3fe6b9b1b16a34ae67c6d85a03e76f6ee3ecdb","size":1775,"noattachment":false,"key":"/with-open-file/-/with-open-file-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/with-open-file/download/with-open-file-0.1.0.tgz"},"maintainers":[{"name":"raphinesse","email":"raphinesse@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-open-file_0.1.0_1534946871787_0.8539458288705901"},"_hasShrinkwrap":false,"publish_time":1534946871931,"_cnpm_publish_time":1534946871931}},"readme":"# with-open-file [![Build Status](https://travis-ci.org/raphinesse/with-open-file.svg?branch=master)](https://travis-ci.org/raphinesse/with-open-file)\n\n> Do stuff with an open file, knowing it will finally be closed\n\nBecause the built-in way requires way too much boilerplate.\n\n\n## Install\n\n```\n$ npm install with-open-file\n```\n\n\n## Usage\n\n```js\nconst withOpenFile = require('with-open-file')\n\nwithOpenFile('foo.txt', 'r', fd => {\n  // Process file using fd\n})\n\nwithOpenFile.sync('foo.txt', 'r', fd => {\n  // Process file synchronously using fd\n})\n```\n\n\n## API\n\n### withOpenFile(...openArgs, callback)\n\nReturns a `Promise` wrapping the result of calling `callback` with the requested file descriptor.\n\n### withOpenFile.sync(...openArgs, callback)\n\nReturns the result of calling `callback` with the requested file descriptor.\n\n#### ...openArgs\n\nArguments as supported by [`fs.openSync`](https://nodejs.org/api/fs.html#fs_fs_opensync_path_flags_mode)\n\n#### callback\n\nType: `function`\n\n\n## License\n\nMIT © Raphael von der Grün\n","_attachments":{},"homepage":"https://github.com/raphinesse/with-open-file#readme","bugs":{"url":"https://github.com/raphinesse/with-open-file/issues"},"license":"MIT"}