Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "dir2tree", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -39,3 +39,3 @@ # Install | ||
## Methodes | ||
- **`.write(file_name)`** | ||
- **`.write(Target, filename)`** | ||
@@ -42,0 +42,0 @@ # License |
@@ -81,5 +81,5 @@ const fs = require("fs"); | ||
write(filename) { | ||
write(Target, filename) { | ||
const jsonTree = JSON.stringify(this.tree, null, 2); // Pretty-print the JSON | ||
const filePath = path.join(__dirname, filename); // Construct the file path using __dirname | ||
const filePath = path.join(Target, filename); // Construct the file path | ||
fs.writeFileSync(filePath, jsonTree, 'utf8'); | ||
@@ -86,0 +86,0 @@ console.log(`Tree written to ${filePath}`); |
19626