ensure-dir-tiny 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/index.d.ts +3 -3
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ensure-dir
|
|
2
2
|
|
|
3
|
-
<p align="center"><a href="https://nodei.co/npm/ensure-dir/"><img src="https://nodei.co/npm/ensure-dir.png"></a></a></p>
|
|
3
|
+
<p align="center"><a href="https://nodei.co/npm/ensure-dir-tiny/"><img src="https://nodei.co/npm/ensure-dir-tiny.png"></a></a></p>
|
|
4
4
|
<p align="center">
|
|
5
5
|
<img src="https://img.shields.io/badge/License-MIT-yellow.svg">
|
|
6
6
|
</p>
|
|
@@ -22,7 +22,7 @@ $ npm i ensure-dir
|
|
|
22
22
|
```javascript
|
|
23
23
|
const path = require('path');
|
|
24
24
|
const fs = require('fs');
|
|
25
|
-
const ensureDir = require('ensure-dir');
|
|
25
|
+
const ensureDir = require('ensure-dir-tiny');
|
|
26
26
|
|
|
27
27
|
const testDir = path.join(__dirname, 'demo/a/b/c');
|
|
28
28
|
|
|
@@ -45,7 +45,7 @@ console.log('✅ Called twice without crashing');
|
|
|
45
45
|
```javascript
|
|
46
46
|
import path from 'path';
|
|
47
47
|
import fs from 'fs';
|
|
48
|
-
import ensureDir from 'ensure-dir';
|
|
48
|
+
import ensureDir from 'ensure-dir-tiny';
|
|
49
49
|
import { fileURLToPath } from 'url';
|
|
50
50
|
|
|
51
51
|
// __dirname replacement in ESM
|
|
@@ -72,7 +72,7 @@ console.log('✅ Called twice without crashing');
|
|
|
72
72
|
```javascript
|
|
73
73
|
import path from 'path';
|
|
74
74
|
import fs from 'fs';
|
|
75
|
-
import ensureDir from 'ensure-dir';
|
|
75
|
+
import ensureDir from 'ensure-dir-tiny';
|
|
76
76
|
|
|
77
77
|
const testDir: string = path.join(__dirname, 'demo/a/b/c');
|
|
78
78
|
console.log('Creating directory:', testDir);
|
package/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @returns {void}
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
*
|
|
9
|
+
* ensureDir("./data/logs");
|
|
10
10
|
*/
|
|
11
|
-
declare function
|
|
11
|
+
declare function ensureDir(path: string): void;
|
|
12
12
|
|
|
13
|
-
export =
|
|
13
|
+
export = ensureDir;
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ensure-dir-tiny - 📁 Ensures that the directory at the given path exists. Creates it recursively if it doesn't. Prevents "File Not Found" errors when saving files.
|
|
3
|
-
* @version: v1.0.
|
|
3
|
+
* @version: v1.0.1
|
|
4
4
|
* @link: https://github.com/tutyamxx/ensure-dir-tiny
|
|
5
5
|
* @license: MIT
|
|
6
6
|
**/
|
package/package.json
CHANGED