New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tmpfile

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmpfile

Very lightweight and simply temporary file creator

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
84
-44.74%
Maintainers
1
Weekly downloads
 
Created
Source

TMPFILE

A (very) simple NodeJS module designed to give you valid temporary file paths.

Installation

npm install tmpfile or yarn add tmpfile

Example Usage

const tmpfile = require('tmpfile');
const tmpFileOpts = {
  prefix: 'bill-',
  suffix: '-accounting',
  extension: '.txt'
};

const filePath = tmpfile(tmpFileOpts);

Notes

  • Files are not created by this package! The paths returned are confirmed as available and valid for you to use yourself.
  • Paths will always be in your OS's temp directory, e.g. /tmp for (most?) Linux distributions.
  • Prefixes and suffixes are taken exactly as they are entered - if you want symbols, e.g. hyphens, between them and the file name, be sure to include them yourself!
  • You can enter an extension with or without a dot - one will be added if you miss it out.
  • Entering no extension will result in an extensionless file name, which is just fine.

Keywords

tempfile

FAQs

Package last updated on 20 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts