🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@compilets/using-temp-dir

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compilets/using-temp-dir

Create a temporary directory and remove it on disposition

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
0
Created
Source

using-temp-dir

Create a temporary directory, and remove it on disposition, with the using declaration of TypeScript.

Import

import {tempDir, tempDirSync} from '@compilets/using-temp-dir';

API

interface AsyncTempDir extends AsyncDisposable {
    path: string;
}
export declare function tempDir(prefix?: string): Promise<AsyncTempDir>;

interface SyncTempDir extends Disposable {
    path: string;
}
export declare function tempDirSync(prefix?: string): SyncTempDir;

Example

import {tempDir, tempDirSync} from '@compilets/using-temp-dir';

{
  await using dir = await tempDir();
  console.log(dir.path);
}

{
  using dir = tempDirSync();
  console.log(dir.path);
}

FAQs

Package last updated on 28 Jul 2024

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