Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
/ tmpz Public archive

Copy a file or directory to OS temporary dir with a random name. With option to remove it.

License

Notifications You must be signed in to change notification settings

joseluisq/tmpz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tmpz Build Status Coverage Status Standard - JavaScript Style Guide Greenkeeper badge

Copy a file or directory to OS temporary dir with a random name. With option to remove it.

Prerequisites

NodeJS v4.0 or greater.

Install

Yarn

yarn add tmpz --dev

NPM

npm install tmpz --save-dev

Usage

const tmpz = require('tmpz')

try {
  const dest = tmpz.copy('./my_directory')

  console.log(dest)
  // > /tmp/393a6d0851bb6c10214f92bbaa9c833d

  // Removing our temp dir in 7 seconds...
  setTimeout(() => tmpz.remove(dest), 7000)

} catch (err) {
  console.error(err)
}

License

MIT license

© 2017 José Luis Quintana

About

Copy a file or directory to OS temporary dir with a random name. With option to remove it.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published