tmpdir-polyfill

Node.js os.tmpdir polyfill for older versions of node.js.


Keywords
tmp, tmpdir, temp, directory, os, os-tmpdir, polyfill, legacy, nodejs
License
MIT
Install
npm install tmpdir-polyfill@1.0.0

Documentation

tmpdir-polyfill NPM version NPM downloads Build Status

Node.js os.tmpdir polyfill for older versions of node.js.

Install

Install with npm:

$ npm install --save tmpdir-polyfill

Usage

var homedir = require('tmpdir-polyfill');
console.log(tmpdir());
//=> /var/folders/g2/bqbqq47d4pg7v4rqx90612m00000gn/T

Reasoning

This library is a polyfill for the node.js os.tmpdir to work consistently in older nodejs versions.

In versions of node.js newer or equal 4, os.tmpdir is used.

About

Related projects

homedir-polyfill:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue & be kind.

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Martin Heidegger

License

Copyright © 2019, Martin Heidegger. Released under the MIT license.