Socket
Socket
Sign inDemoInstall

os-tmpdir

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

os-tmpdir

Node.js os.tmpdir() ponyfill

    2.0.0latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
22,455,891
increased by4.75%

Weekly downloads

Package description

What is os-tmpdir?

The os-tmpdir npm package is a simple utility module that provides a cross-platform way of getting the operating system's default directory for temporary files. As of Node.js v4.0.0, this functionality is built into the core os module, making os-tmpdir mostly obsolete. However, it can still be used for compatibility with older versions of Node.js.

What are os-tmpdir's main functionalities?

Get the OS temporary directory

This feature allows you to retrieve the path to the system's temporary directory, which is useful for creating temporary files or directories during the execution of a program.

const osTmpdir = require('os-tmpdir');
console.log(osTmpdir());

Other packages similar to os-tmpdir

Readme

Source

Deprecated: This is not needed anymore. require('os').tmpdir() in Node.js 4 and up is good.


os-tmpdir Build Status

Node.js os.tmpdir() ponyfill

Use this instead of require('os').tmpdir() to get a consistent behavior on different Node.js versions (even 0.8).

Install

$ npm install --save os-tmpdir

Usage

const osTmpdir = require('os-tmpdir');

osTmpdir();
//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'

API

See the os.tmpdir() docs.

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 08 Nov 2018

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

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