Skip to content
Get the real path of the system temp directory
JavaScript TypeScript
Branch: master
Clone or download
Latest commit f71cb26 Apr 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fixture
.editorconfig Require Node.js 8, add TypeScript definition (#1) Apr 28, 2019
.gitattributes Require Node.js 8, add TypeScript definition (#1) Apr 28, 2019
.gitignore Require Node.js 8, add TypeScript definition (#1) Apr 28, 2019
.npmrc Require Node.js 8, add TypeScript definition (#1) Apr 28, 2019
.travis.yml Require Node.js 8, add TypeScript definition (#1) Apr 28, 2019
fixture-symlink Init Mar 28, 2017
index.d.ts Require Node.js 8, add TypeScript definition (#1) Apr 28, 2019
index.js Require Node.js 8, add TypeScript definition (#1) Apr 28, 2019
index.test-d.ts
license
package.json 2.0.0 Apr 28, 2019
readme.md
test.js

readme.md

temp-dir Build Status

Get the real path of the system temp directory

The os.tmpdir() built-in doesn't return the real path. That can cause problems when the returned path is a symlink, which is the case on macOS. Use this module to get the resolved path.

Install

$ npm install temp-dir

Usage

const tempDirectory = require('temp-dir');

console.log(tempDirectory);
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T'

console.log(require('os').tmpdir());
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T' // <= Symlink

License

MIT © Sindre Sorhus

You can’t perform that action at this time.