Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

print-project

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

print-project - npm Package Compare versions

Comparing version 1.0.28 to 1.0.29

27

dist/index.js

@@ -87,7 +87,9 @@ #!/usr/bin/env node

if (entry.isDirectory()) {
if (shouldProcess(relativePath)) {
// Don't use shouldProcess() for directories when includes are specified.
// Only skip directories if they match an ignore pattern.
if (!matchesAnyPattern(relativePath, ignorePatterns)) {
const subTree = {};
treeStructure[relativePath] = subTree;
readDirectory(fullPath, subTree);
// Remove empty directories
// Remove empty directories if no included files end up inside
if (Object.keys(subTree).length === 0) {

@@ -98,13 +100,16 @@ delete treeStructure[relativePath];

}
else if (entry.isFile() && shouldProcess(relativePath)) {
try {
const content = fs.readFileSync(fullPath, "utf8");
if (content.length > 0) {
treeStructure[relativePath] = {};
projectPrint += `${relativePath}:\n${content}\n\n`;
else if (entry.isFile()) {
// For files, apply the include and ignore logic
if (shouldProcess(relativePath)) {
try {
const content = fs.readFileSync(fullPath, "utf8");
if (content.length > 0) {
treeStructure[relativePath] = {};
projectPrint += `${relativePath}:\n${content}\n\n`;
}
}
catch (error) {
console.error(`Error reading file ${relativePath}:`, error.message);
}
}
catch (error) {
console.error(`Error reading file ${relativePath}:`, error.message);
}
}

@@ -111,0 +116,0 @@ }

{
"name": "print-project",
"version": "1.0.28",
"version": "1.0.29",
"description": "A simple CLI tool to print the project tree structure and file contents",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -182,3 +182,3 @@ File structure:

"name": "print-project",
"version": "1.0.27",
"version": "1.0.28",
"description": "A simple CLI tool to print the project tree structure and file contents",

@@ -188,3 +188,4 @@ "main": "dist/index.js",

"print-project": "./dist/index.js",
"pprint": "./dist/index.js"
"pprint": "./dist/index.js",
"pp": "./dist/index.js"
},

@@ -191,0 +192,0 @@ "types": "dist/index.d.ts",

@@ -77,3 +77,5 @@ #!/usr/bin/env node

if (entry.isDirectory()) {
if (shouldProcess(relativePath)) {
// Don't use shouldProcess() for directories when includes are specified.
// Only skip directories if they match an ignore pattern.
if (!matchesAnyPattern(relativePath, ignorePatterns)) {
const subTree = {};

@@ -83,3 +85,3 @@ treeStructure[relativePath] = subTree;

// Remove empty directories
// Remove empty directories if no included files end up inside
if (Object.keys(subTree).length === 0) {

@@ -89,11 +91,14 @@ delete treeStructure[relativePath];

}
} else if (entry.isFile() && shouldProcess(relativePath)) {
try {
const content = fs.readFileSync(fullPath, "utf8");
if (content.length > 0) {
treeStructure[relativePath] = {};
projectPrint += `${relativePath}:\n${content}\n\n`;
} else if (entry.isFile()) {
// For files, apply the include and ignore logic
if (shouldProcess(relativePath)) {
try {
const content = fs.readFileSync(fullPath, "utf8");
if (content.length > 0) {
treeStructure[relativePath] = {};
projectPrint += `${relativePath}:\n${content}\n\n`;
}
} catch (error: any) {
console.error(`Error reading file ${relativePath}:`, error.message);
}
} catch (error: any) {
console.error(`Error reading file ${relativePath}:`, error.message);
}

@@ -100,0 +105,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc