Skip to content

Commit

Permalink
Merge pull request #1 from thefourtheye/patch-1
Browse files Browse the repository at this point in the history
Thanks!
  • Loading branch information
benjamingr committed Feb 23, 2016
2 parents 4f36e32 + ce499c9 commit ea9a2df
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ This documentation is mostly copied from that package's - but with promise usage

## About

This adds promises support to a [widely used library][2]. This package is used to create temporary files and directories in a [node.js][1] environment.
This adds promises support to a [widely used library][2]. This package is used to create temporary files and directories in a [Node.js][1] environment.

Tmp-promise offers both an asynchronous and a synchronous API. For all API calls, all
tmp-promise offers both an asynchronous and a synchronous API. For all API calls, all
the parameters are optional.

Internally, tmp uses crypto for determining random file names, or, when using templates, a six letter random identifier. And just in case that you do not have that much entropy left on your system, Tmp will fall back to pseudo random numbers.
Internally, tmp uses crypto for determining random file names, or, when using templates, a six letter random identifier. And just in case that you do not have that much entropy left on your system, tmp will fall back to pseudo random numbers.

You can set whether you want to remove the temporary file on process exit or not, and the destination directory can also be set.

Tmp-promise also uses promise disposers to provide a nice way to perform cleanup when you're done working with the files.
tmp-promise also uses promise disposers to provide a nice way to perform cleanup when you're done working with the files.

## Usage (API Reference)

Expand Down Expand Up @@ -48,7 +48,7 @@ tmp.withFile(o => {
// the file remains opens until the below promise resolves
return somePromiseReturningFn();
}).then(v => {
// file is closed here automatically, v is the value of somePromiseReturningFn
// file is closed here automatically, v is the value of somePromiseReturningFn
});
```

Expand Down Expand Up @@ -105,7 +105,7 @@ tmp.withDir(o => {
// automatic cleanup when the below promise resolves
return somePromiseReturningFn();
}).then(v => {
// the directory has been cleaned here
// the directory has been cleaned here
});
```

Expand Down Expand Up @@ -134,7 +134,7 @@ directory.
```javascript
var tmp = require('tmp-promise');

tmp.tmpName().then(path =>
tmp.tmpName().then(path => {
console.log("Created temporary filename: ", path);
});
```
Expand Down

0 comments on commit ea9a2df

Please sign in to comment.