@the-/tmp

15.5.0 • Public • Published

@the-/tmp

npm Version

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

See API Guide for more detail

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i @the-/tmp

Weekly Downloads

30

Version

15.5.0

License

MIT

Unpacked Size

51.3 kB

Total Files

16

Last publish

Collaborators

  • okunishinishi