{"_id":"@asaml/fs-helpers","name":"@asaml/fs-helpers","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@asaml/fs-helpers","version":"1.1.0","main":"src/index.js","license":"MIT","description":"FileSystem module helpers package","author":{"name":"Agostinho Sam'l","email":"agostinhosaml832@gmail.com","url":"https://agostinhosam.com"},"private":false,"scripts":{"build":"echo no build yet"},"displayName":"FS Helpers","homepage":"https://github.com/agostinhosamil/fs-helpers#readme","bugs":{"url":"https://github.com/agostinhosamil/fs-helpers/issues","email":"samil.shell.main007@gmail.com"},"links":[{"label":"Website","url":"https://www.agostinhosam.com"},{"label":"Agostinho Sam'l On Facebook","url":"https://www.facebook.com/agostinhosaml"},{"label":"Agostinho Sam'l On X","url":"https://www.x.com/@agostinhosaml"},{"label":"Agostinho Sam'l On Github","url":"https://www.github.com/agostinhosamil"}],"repository":{"type":"git","url":"git+https://github.com/agostinhosamil/fs-helpers.git"},"gitHead":"9ed7522b885d2b21a70fd4cccc8a0d4af4ac9b48","_id":"@asaml/fs-helpers@1.1.0","_nodeVersion":"17.9.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-k0YY4srohuhHfxFvAGXrFVp5Pr8MXxVa06L5OdQuqzQlmF2adzXbZHaPQFLWtacpsSbQ8lV7QAuiffPJhf0pXg==","shasum":"80a0ca14cf22efc18247c88018884a7306de213a","tarball":"https://registry.npmjs.org/@asaml/fs-helpers/-/fs-helpers-1.1.0.tgz","fileCount":21,"unpackedSize":16076,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTQzoBVgtffbPoreM77nY+9NWgTeUemrxHodmvhyzGuwIhAKSvi0gqiqk57IkDqsZ+PyVUrf318tzEPZE0ZuBuyfZo"}]},"_npmUser":{"name":"agostinho_lopes","email":"agostinhosaml832@gmail.com"},"directories":{},"maintainers":[{"name":"agostinho_lopes","email":"agostinhosaml832@gmail.com"},{"name":"ysamark","email":"main.ysamark@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-helpers_1.1.0_1701096228228_0.10956738951723377"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-27T14:43:48.118Z","1.1.0":"2023-11-27T14:43:48.414Z","modified":"2023-11-27T14:43:48.686Z"},"maintainers":[{"name":"agostinho_lopes","email":"agostinhosaml832@gmail.com"},{"name":"ysamark","email":"main.ysamark@gmail.com"}],"description":"FileSystem module helpers package","homepage":"https://github.com/agostinhosamil/fs-helpers#readme","repository":{"type":"git","url":"git+https://github.com/agostinhosamil/fs-helpers.git"},"author":{"name":"Agostinho Sam'l","email":"agostinhosaml832@gmail.com","url":"https://agostinhosam.com"},"bugs":{"url":"https://github.com/agostinhosamil/fs-helpers/issues","email":"samil.shell.main007@gmail.com"},"license":"MIT","readme":"# `@asaml/fs-helpers`\n\nThe `@asaml/fs-helpers` package is a Node.js module that provides utility functions for file system operations. It simplifies common tasks related to directories and files.\n\n## Installation\n\n```bash\nnpm install @asaml/fs-helpers\n```\n\n## Usage\n\n```javascript\nconst fsHelpers = require('@asaml/fs-helpers')\n```\n\n## Available Functions\n\n* isDir(path: string): boolean\nChecks if the specified path refers to a directory.\n\nParameters:\n\npath (string): The directory path to check.\nReturn:\n\nA Promise that resolves to true if it's a directory, or false if it's not.\nisFile(path: string): boolean\nChecks if the specified path refers to a file.\n\nParameters:\n\npath (string): The file path to check.\nReturn:\n\nA Promise that resolves to true if it's a file, or false if it's not.\ncopyDirTo(sourceDir: string, destinationDir: string): void\nCopies the entire contents of one directory to another.\n\nParameters:\n\nsourceDir (string): The source directory.\ndestinationDir (string): The destination directory.\nReturn:\n\nA Promise that resolves after the copy is complete.\ncopyFileTo(sourceFile: string, destinationFile: string): void\nCopies a source file to a specific destination.\n\nParameters:\n\nsourceFile (string): The path of the source file.\ndestinationFile (string): The path of the destination file.\nReturn:\n\nA Promise that resolves after the copy is complete.\ncopyDirectoryTo(sourceDir: string, destinationDir: string): void\nCopies the entire source directory to the destination, maintaining the directory structure.\n\nParameters:\n\nsourceDir (string): The source directory.\ndestinationDir (string): The destination directory.\nReturn:\n\nA Promise that resolves after the copy is complete.\n\ngetDirectoryFilesList(directory: string): string\nGets a list of files in the specified directory.\n\nParameters:\n\ndirectory (string): The directory to get the list of files.\nReturn:\n\nA Promise that resolves to an array of strings, where each string is the path of a file in the directory.\n\n## Usage Examples\n\n```javascript\nconst fsHelpers = require('@asaml/fs-helpers');\n\n// Check if a path is a directory\nconst isDirectory = fsHelpers.isDir('/path/to/directory');\n\n// Check if a path is a file\nconst isFile = fsHelpers.isFile('/path/to/file.txt');\n\n// Copy the contents of a directory to another\nfsHelpers.copyDirTo('/source/directory', '/destination/directory');\n\n// Copy a file from one location to another\nfsHelpers.copyFileTo('/source/file.txt', '/destination/file.txt');\n\n// Copy an entire directory to another while maintaining the structure\nfsHelpers.copyDirectoryTo('/source/directory', '/destination/directory');\n\n// Get the list of files in a directory\nconst filesList = fsHelpers.getDirectoryFilesList('/path/to/directory');\n```\n\n## Contributing\n\nFeel free to contribute! Open issues or send pull requests to improve this package.\n","readmeFilename":"README.md"}