npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@radicjs/tmp

v1.0.2

Published

Get temporary file path, Create temporary files or directories. Can automatically clean up on process exit.

Readme

tmp

npm version

Create temporary directories and files. Can automatically clean up on process exit.

Installation

To install the package, use npm or yarn:

npm install @radicjs/tmp

or

yarn add @radicjs/tmp

Usage

| Function | Description | |---------------|------------------------------------------------------| | tmpDir | Create a temporary directory asynchronously | | tmpDirSync | Create a temporary directory synchronously | | tmpFile | Create a temporary file asynchronously | | tmpFileSync | Create a temporary file synchronously | | tmpPath | Retrieve the temporary directory path asynchronously | | tmpPathSync | Retrieve the temporary directory path synchronously |

Declarations

const tmpDir = (options?:TmpDirOptions) => Promise<TmpDirHelper>
const tmpDirSync = (options?:TmpDirOptions) => TmpDirSyncHelper
const tmpFile = (options?:TmpFileOptions) => Promise<TmpFileHelper>
const tmpFileSync = (options?:TmpFileOptions) => TmpFileSyncHelper
const tmpPath = () => Promise<string>
const tmpPathSync = () => string

export interface TmpFileOptions {
    /** use a custom diectory for the temporary file */
    path?: string;
    /** use a custom prefix for the temporary file */
    prefix?: string;
    /**
     * The file mode (permission and sticky bits) to be applied.
     * @default 0o666
     */
    mode?: import('fs').Mode;
}
export interface TmpDirOptions {
    /** use a custom diectory for the temporary directory */
    path?: string;
    /** use a custom prefix for the temporary directory */
    prefix?: string;
}
export interface TmpFileHelper {
    /** the path to the temporary file */
    path: string;
    /** clean up the temporary file */
    clean(): Promise<void>;
    /** check if the temporary file has been cleaned */
    cleaned(): boolean;
    /** track the temporary file for automatic cleanup on process exit */
    track(): void;
    /** check if the temporary file is tracked */
    tracked(): boolean;
    /** untrack the temporary file */
    untrack(): void;
}
export interface TmpDirHelper {
    /** the path to the temporary directory */
    root: string;
    /** create a absolute path relative to the temporary directory */
    path(...args: string[]): string;
    /** check if a path exists in the temporary directory */
    clean(): Promise<void>;
    /** check if a path exists in the temporary directory */
    cleaned(): boolean;
    /** track the temporary directory for automatic cleanup on process exit */
    track(): void;
    /** check if the temporary directory is tracked */
    tracked(): boolean;
    /** untrack the temporary directory */
    untrack(): void;
}

Examples

tba

Coverage

St|File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--|------------|---------|----------|---------|---------|------------------------------------------------------------- 🟡|All files | 67.76 | 55.88 | 52.27 | 67.54 |
🔴| cleanup.ts| 48.64 | 62.5 | 25 | 48.64 |16-44,78-85 🟡| dir.ts| 67.27 | 50 | 47.05 | 67.27 |44-48,91,94,102,105-106,112-113,165,168,176,179-180,186-187 🟡| file.ts| 75.51 | 50 | 60 | 75 |81,89,92-93,99-100,151,159,162-163,169-170 🟢| util.ts| 100 | 100 | 100 | 100 |

License

This project is licensed under the MIT License.