Tmp file creator


Keywords
the
License
MIT
Install
npm install the-tmp@1.0.11

Documentation

the-tmp

Build Status npm Version JS Standard

Tmp file creator

Installation

$ npm install the-tmp --save

Usage

'use strict'

const theTmp = require('the-tmp')

async function tryExample () {
  // Create tmp file and clean up automatically
  await theTmp.while(async (filename) => {
    console.log('Generated file', filename)
  })

  // Manually cleanup
  {
    const { cleanup, filename } = await theTmp.generate()
    console.log('Generated file', filename)
    cleanup() // Cleanup the file
  }
}

tryExample().catch((err) => console.error(err))

API Guide

License

This software is released under the MIT License.

Links