JSPM

tmpz

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q28465F
  • License MIT

Copy a file or directory to OS temporary directory with a random name. Also you can remove it later.

Package Exports

  • tmpz

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tmpz) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

Copy a file or directory to OS temporary directory with a random name. Also you can remove it later.

Prerequisites

NodeJS v4.0 or greater.

Install

npm install tmpz --save-dev

Usage

const tmpz = require('tmpz')

try {
  const dest = tmpz.copy('./my_directory')
  console.log(dest)
  // > /tmp/393a6d0851bb6c10214f92bbaa9c833d

  // Removing the temp dir in 7 seconds
  setTimeout(() => tmpz.remove(dest), 7000)
} catch (err) {
  console.error(err)
}

License

MIT license

© 2017 José Luis Quintana