cpsf_utilite
v1.7.11
Published
## Description
Downloads
40
Maintainers
Readme
cpsf_utilite
Description
cpsf_utilite
(Create Project Structure File
) is a Node.js utility that allows you to generate a project structure or an archive of the project structure and automatically updates the .gitignore
file. This utility can be useful for quickly analyzing and understanding the structure of existing projects, creating an initial structure for new projects, or archiving the current project structure.
Installation
You can install cpsf_utilite
globally using npm:
npm install -g cpsf_utilite
Usage
After installation, you have two main options to use this utility within your project directory.
Generate Project Structure To generate a project-structure.txt file with the project's structure:
gst structure
Create an Archive of the Project Structure To create an archive of the project's structure:
gst archive
Both options will also update the .gitignore file by adding the generated file (project-structure.txt or the archive file) to avoid tracking it in version control.
If no arguments are provided, the utility will prompt you to choose an operation in interactive mode:
gst
Examples
Here is an example of a project structure that can be generated by the utility:
src/
index.js
// Example code in index.js
console.log("Hello, world!");
components/
App.js
// Example code in App.js
import React from 'react';
const App = () => <div>Hello, App!</div>;
export default App;
utils/
helper.js
// Example code in helper.js
export function add(a, b) {
return a + b;
}
test/
test.spec.js
// Example code in test.spec.js
import { add } from '../utils/helper';
describe('add function', () => {
it('should add two numbers', () => {
expect(add(2, 3)).toBe(5);
});
});
.gitignore
package.json
project_copies/
project-structure_D_YYYY-MM-DD_H_HH-MM-SS.txt
archive_D_YYYY-MM-DD_H_HH-MM-SS.txt
For the archive option, the generated file will be similar but saved under a different filename format indicating it's an archive.
FAQ
Q: Can I use cpsf_utilite
for non-Node.js projects?
A: Yes, the utility is not dependent on the type of project and can be used to generate the structure of any project that has a file system.
Q: Can I exclude certain folders or files from the structure? A: Yes, you can modify the utility's code to add logic for ignoring specific folders or files.
Feedback
If you have any questions or suggestions, please contact me via GitHub Issues.
License
cpsf_utilite
is distributed under the MIT license.