Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tmp-promise

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmp-promise - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

.circleci/config.yml

14

index.js

@@ -6,6 +6,5 @@ const {promisify} = require("util");

module.exports.fileSync = tmp.fileSync;
const fileWithOptions = promisify(
(options, cb) => tmp.file(
options,
(err, path, fd, cleanup) => cb(err, {path, fd, cleanup: promisify(cleanup)})
const fileWithOptions = promisify((options, cb) =>
tmp.file(options, (err, path, fd, cleanup) =>
err ? cb(err) : cb(undefined, { path, fd, cleanup: promisify(cleanup) })
)

@@ -27,6 +26,5 @@ );

module.exports.dirSync = tmp.dirSync;
const dirWithOptions = promisify(
(options, cb) => tmp.dir(
options,
(err, path, cleanup) => cb(err, {path, cleanup: promisify(cleanup)})
const dirWithOptions = promisify((options, cb) =>
tmp.dir(options, (err, path, cleanup) =>
err ? cb(err) : cb(undefined, { path, cleanup: promisify(cleanup) })
)

@@ -33,0 +31,0 @@ );

{
"name": "tmp-promise",
"version": "2.0.1",
"version": "2.0.2",
"description": "The tmp package with promises support and disposers.",

@@ -5,0 +5,0 @@ "main": "index.js",

# tmp-promise
[![CircleCI](https://circleci.com/gh/benjamingr/tmp-promise.svg?style=svg)](https://circleci.com/gh/benjamingr/tmp-promise)
[![npm version](https://badge.fury.io/js/tmp-promise.svg)](https://badge.fury.io/js/tmp-promise)
A simple utility for creating temporary files or directories.

@@ -4,0 +7,0 @@

@@ -51,2 +51,11 @@ const fs = require('fs')

})
it('propagates errors', async function() {
try {
await tmp.file({ dir: 'nonexistent-path' });
throw Error('Expected to throw');
} catch (e) {
assert.ok(e.message.startsWith('ENOENT: no such file or directory'));
}
});
})

@@ -88,2 +97,11 @@

})
it('propagates errors', async function() {
try {
await tmp.dir({ dir: 'nonexistent-path' });
throw Error('Expected to throw');
} catch (e) {
assert.ok(e.message.startsWith('ENOENT: no such file or directory'));
}
});
})

@@ -90,0 +108,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc