Socket
Socket
Sign inDemoInstall

temp-dir

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

14

index.d.ts

@@ -6,8 +6,12 @@ /**

```
import * as os from 'os';
import tempDirectory = require('temp-dir');
import temporaryDirectory from 'temp-dir';
console.log(tempDirectory);
console.log(temporaryDirectory);
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T'
```
@example
```
import os from 'node:os';
console.log(os.tmpdir());

@@ -17,4 +21,4 @@ //=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T' // <= Symlink

*/
declare const tempDirectory: string;
declare const temporaryDirectory: string;
export = tempDirectory;
export default temporaryDirectory;

@@ -1,13 +0,6 @@

'use strict';
const fs = require('fs');
const os = require('os');
import {promises as fs} from 'node:fs';
import os from 'node:os';
const tempDirectorySymbol = Symbol.for('__RESOLVED_TEMP_DIRECTORY__');
const temporaryDirectory = await fs.realpath(os.tmpdir());
if (!global[tempDirectorySymbol]) {
Object.defineProperty(global, tempDirectorySymbol, {
value: fs.realpathSync(os.tmpdir())
});
}
module.exports = global[tempDirectorySymbol];
export default temporaryDirectory;
{
"name": "temp-dir",
"version": "2.0.0",
"version": "3.0.0",
"description": "Get the real path of the system temp directory",

@@ -10,6 +10,9 @@ "license": "MIT",

"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"types": "./index.d.ts",
"engines": {
"node": ">=8"
"node": ">=14.16"
},

@@ -37,7 +40,12 @@ "scripts": {

"devDependencies": {
"ava": "^1.4.1",
"proxyquire": "^2.1.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"ava": "^4.3.3",
"quibble": "^0.6.14",
"tsd": "^0.24.1",
"xo": "^0.52.3"
},
"ava": {
"nodeArguments": [
"--loader=quibble"
]
}
}

@@ -1,2 +0,2 @@

# temp-dir [![Build Status](https://travis-ci.org/sindresorhus/temp-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/temp-dir)
# temp-dir

@@ -7,25 +7,22 @@ > Get the real path of the system temp directory

## Install
```sh
npm install temp-dir
```
$ npm install temp-dir
```
## Usage
```js
const tempDirectory = require('temp-dir');
import temporaryDirectory from 'temp-dir';
console.log(tempDirectory);
console.log(temporaryDirectory);
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T'
```
console.log(require('os').tmpdir());
```js
import os from 'node:os';
console.log(os.tmpdir());
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T' // <= Symlink
```
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc