necessary 11.5.0 → 11.6.0

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 CHANGED
@@ -323,6 +323,7 @@ function contentFromResponse(response, callback) {
323
323
  - `createFile()`
324
324
  - `appendToFile()`
325
325
  - `createDirectory()`
326
+ - `renameDirectory()`
326
327
  - `renameFile()`
327
328
  - `removeEntry()`
328
329
  - `getStats()`
@@ -381,6 +382,12 @@ appendToFile("root/etc/init.conf", ""); // appends '' to the 'root/etc/init.conf
381
382
  createDirectory("root/etc/init"); // Creates the 'root/etc/init' directory
382
383
  ```
383
384
 
385
+ * The `renameDirectory()` function renames a directory:
386
+
387
+ ```
388
+ renameDirectory("/root/usr", "/root/lib"); // Renames the '/root/usr' directory to '/root/lib'
389
+ ```
390
+
384
391
  * The `renameFile()` function renames a file:
385
392
 
386
393
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "necessary",
3
3
  "author": "James Smith",
4
- "version": "11.5.0",
4
+ "version": "11.6.0",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/necessary",
7
7
  "description": "A collection of utility functions.",
@@ -106,6 +106,10 @@ export function createDirectory(directoryPath) {
106
106
  fs.mkdirSync(directoryPath, options);
107
107
  }
108
108
 
109
+ export function renameDirectory(oldDirectoryPath, newDirectoryPath) {
110
+ fs.renameSync(oldDirectoryPath, newDirectoryPath);
111
+ }
112
+
109
113
  export function renameFile(oldFilePath, newFilePath) {
110
114
  fs.renameSync(oldFilePath, newFilePath);
111
115
  }
@@ -138,6 +142,7 @@ export default {
138
142
  createFile,
139
143
  appendToFile,
140
144
  createDirectory,
145
+ reanmeDirectory,
141
146
  renameFile,
142
147
  removeEntry,
143
148
  getStats