Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/honzahommer/node-fs-mktemp
`mktemp` command for Node.js
https://github.com/honzahommer/node-fs-mktemp
Last synced: 2 days ago
JSON representation
`mktemp` command for Node.js
- Host: GitHub
- URL: https://github.com/honzahommer/node-fs-mktemp
- Owner: honzahommer
- License: mit
- Created: 2019-03-22T02:19:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:20:29.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T18:02:47.714Z (3 months ago)
- Language: JavaScript
- Size: 1.48 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# fs-mktemp
[![npm Package](https://img.shields.io/npm/v/fs-mktemp.svg)](https://www.npmjs.org/package/fs-mktemp)
[![License](https://img.shields.io/npm/l/express.svg)](https://github.com/honzahommer/node-fs-mktemp/blob/master/LICENSE)
[![build status](https://img.shields.io/travis/honzahommer/node-fs-mktemp/master.svg)](http://travis-ci.org/honzahommer/node-fs-mktemp)
[![downloads per month](http://img.shields.io/npm/dm/fs-mktemp.svg)](https://www.npmjs.org/package/fs-mktemp) [![Greenkeeper badge](https://badges.greenkeeper.io/honzahommer/node-fs-mktemp.svg)](https://greenkeeper.io/)> `mktemp` command for Node.js
## Installation
> npm install fs-mktemp## Usage
### mktempDir([prefix='tmp'], [callback]);
- `prefix` ``
- `callback` ``#### Example
```js
const { mktempDir } = require('fs-mktemp');mktempDir((err, dir) => {
if (err) {
return console.error(err);
}console.log(dir);
});mktempDir()
.then(dir => {
console.log(dir);
})
.catch(err => {
console.error(err);
});
```### mktempDirSync([prefix='tmp'])
- `prefix` ``
#### Example
```js
const { mktempDirSync } = require('fs-mktemp');console.log(mktempDirSync());
```### mktempFile([options={content:'',prefix:'tmp'}|prefix='tmp'], [callback])
- `options` ``
- `options.content` ``
- `options.prefix` ``
- `callback` ``*- or -*
- `prefix` ``
- `callback` ``#### Example
```js
const { mktempFile } = require('fs-mktemp');mktempFile((err, file) => {
if (err) {
return console.error(err);
}console.log(file);
});mktempFile()
.then(file => {
console.log(file);
})
.catch(err => {
console.error(err);
});
```### mktempFileSync([options={content:'',prefix:'tmp'}|prefix='tmp'])
- `options` ``
- `options.content` ``
- `options.prefix` ``*- or -*
- `prefix` ``
#### Example
```js
const { mktempFileSync } = require('fs-mktemp');console.log(mktempFileSync());
```