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

with-tmp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

with-tmp

### Easily create a temporary directory without having to worry about cleanup.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

with-tmp Build Status

Easily create a temporary directory without having to worry about cleanup.

import withTmpdir from "with-tmp";

await withTmpdir("my-tmp-dir", dir => {
  const path = path.join(dir, "my-file");
  fs.writeFileSync(path, "content");
}); // tmpdir is cleaned up

Do tasks from within the temporary directory without having to worry about restoring your environment.

import { withinTmpdir } from "with-tmp";

process.cwd(); // => /home/me/workspace
await withinTmpdir("my-other-tmp-dir", dir => {
  process.cwd(); // => /private/var/folders/83/5913m0b1080000gn/T/my-other-tmp-dir2Ivp7V
});

Keywords

files

FAQs

Package last updated on 27 May 2019

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