writeTmpFile

Type:Function
Status:stable
Since:1.0.0
Platform:node
@blackbyte.sugar.node.fs

Create a temporary file on the disk with the passed content and returns the path to it.

Params

  1. data*-Any

    The data to write in the file

  2. settings{}TWriteTmpFileSettings

    Some settings to customize your temp file creation

Return

  1. -Promise<string>

    A promise that will be resolved when the writeTmpFile is completed with the path to it

Example

import { writeTmpFile } from '@blackbyte/sugar/fs';
writeTmpFile('Hello World').then((path) => {
   // do something on complete...
});

Settings

  1. path-String

    A path relative to the temp folder to store your file

Todo

  • testsnormal