with-open-file
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -5,2 +5,3 @@ 'use strict' | ||
const pify = require('pify') | ||
const pTry = require('p-try') | ||
const pFinally = require('p-finally') | ||
@@ -14,3 +15,3 @@ | ||
.open(...args) | ||
.then(fd => pFinally(callback(fd), _ => fsP.close(fd))) | ||
.then(fd => pFinally(pTry(callback, fd), _ => fsP.close(fd))) | ||
} | ||
@@ -17,0 +18,0 @@ |
{ | ||
"name": "with-open-file", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Do stuff with an open file, knowing it will finally be closed", | ||
@@ -25,6 +25,7 @@ "repository": "raphinesse/with-open-file", | ||
"scripts": { | ||
"test": "ava" | ||
"test": "xo && nyc ava" | ||
}, | ||
"dependencies": { | ||
"p-finally": "^1.0.0", | ||
"p-try": "^2.0.0", | ||
"pify": "^3.0.0" | ||
@@ -34,5 +35,7 @@ }, | ||
"ava": "^0.25.0", | ||
"delay": "^3.1.0", | ||
"nyc": "^12.0.2", | ||
"rewire": "^4.0.1", | ||
"sinon": "^6.1.5", | ||
"xo": "^0.22.0" | ||
"xo": "^0.21.0" | ||
}, | ||
@@ -39,0 +42,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3543
21
3
6
+ Addedp-try@^2.0.0
+ Addedp-try@2.2.0(transitive)