File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
- # with-tmpdir [ ![ Build Status] ( https://travis-ci.org/charliekenney23/with-tmpdir .svg?branch=master )] ( https://travis-ci.org/charliekenney23/with-tmpdir )
1
+ # with-tmp [ ![ Build Status] ( https://travis-ci.org/charliekenney23/with-tmp .svg?branch=master )] ( https://travis-ci.org/charliekenney23/with-tmp )
2
2
3
3
### Easily create a temporary directory without having to worry about cleanup.
4
4
5
5
``` typescript
6
- import withTmpdir from ' with-tmpdir ' ;
6
+ import withTmpdir from " with-tmp " ;
7
7
8
- await withTmpdir (' my-tmp-dir' , dir => {
9
- const path = path .join (dir , ' my-file' );
10
- fs .writeFileSync (path , ' content' );
8
+ await withTmpdir (" my-tmp-dir" , dir => {
9
+ const path = path .join (dir , " my-file" );
10
+ fs .writeFileSync (path , " content" );
11
11
}); // tmpdir is cleaned up
12
12
```
13
13
14
14
### Do tasks from within the temporary directory without having to worry about restoring your environment.
15
15
16
16
``` typescript
17
- import { withinTmpdir } from ' with-tmpdir ' ;
17
+ import { withinTmpdir } from " with-tmp " ;
18
18
19
19
process .cwd (); // => /home/me/workspace
20
- await withinTmpdir (' my-other-tmp-dir' , dir => {
20
+ await withinTmpdir (" my-other-tmp-dir" , dir => {
21
21
process .cwd (); // => /private/var/folders/83/5913m0b1080000gn/T/my-other-tmp-dir2Ivp7V
22
22
});
23
23
```
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " with-tmpdir " ,
2
+ "name" : " with-tmp " ,
3
3
"author" : " Charles Kenney <me@ch4z.io>" ,
4
4
"version" : " 1.0.0" ,
5
5
"types" : " dist/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments