{"id":16625776,"url":"https://github.com/aleclarson/fsx","last_synced_at":"2025-12-25T01:32:52.241Z","repository":{"id":66177707,"uuid":"68479019","full_name":"aleclarson/fsx","owner":"aleclarson","description":"User-friendly file operations for NodeJS","archived":false,"fork":false,"pushed_at":"2018-12-15T07:45:43.000Z","size":29,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T02:44:03.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleclarson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-17T21:24:42.000Z","updated_at":"2020-09-19T04:20:17.000Z","dependencies_parsed_at":"2023-02-20T17:15:46.719Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/fsx","commit_stats":{"total_commits":45,"total_committers":1,"mean_commits":45.0,"dds":0.0,"last_synced_commit":"1035d83ed902bf8d6e05aaf558444c8d87eb5e13"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/fsx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243039630,"owners_count":20226131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T04:07:09.473Z","updated_at":"2025-12-25T01:32:52.224Z","avatar_url":"https://github.com/aleclarson.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# fsx v1.9.0 ![stable](https://img.shields.io/badge/stability-stable-4EBA0F.svg?style=flat)\n\nBare essentials `fs` wrapper. Zero dependencies.\n\n```coffee\nfs = require \"fsx\"\n\n# Returns true if the given path is a file, directory, or link.\nfs.exists filePath\n\n# Returns true if the given path is the expected type.\nfs.isDir filePath\nfs.isFile filePath\nfs.isLink filePath\n\n# Returns an array of filenames that exist as children of the given path.\nfs.readDir dirPath\n\n# Reads the contents at the given path.\nfs.readFile filePath\n\n# Returns the path pointed to by the given link path.\nfs.readLink linkPath\n\n# Returns the first non-link path pointed to by the given link path.\nfs.readLinks linkPath\n\n# Create a directory at the given path.\nfs.writeDir dirPath\n\n# Write the contents at the given path.\nfs.writeFile filePath, contents\n\n# Link the first path to the second path.\nfs.writeLink linkPath, targetPath\n\n# Delete the given directory path, and all its children.\nfs.removeDir filePath\n\n# Delete the given file path.\nfs.removeFile filePath\n\n# Rename the first path to the second path.\nfs.rename oldPath, newPath\n\n# Copy the first path to the second path.\nfs.copy srcPath, destPath\n```\n\n#### Tips\n\n- When one or more directories in a path don't exist, `fs.writeDir` will create them for you.\n\n- You can pass the desired encoding to `fs.readFile` (\"utf8\" by default). For example, pass `null` to return a `Buffer`.\n\n- You can pass either a string or buffer to `fs.writeFile`.\n\n- Passing a link path to `fs.removeFile` is allowed.\n\n- Passing a directory path to `fs.readFile`, `fs.writeFile`, or `fs.removeFile` will throw an error.\n\n- Using `fs.rename` can overwrite an existing file or link, but trying to overwrite a directory will throw an error.\n\n- You can copy a file or link into a directory by calling `fs.copy(file, dir)`.\n\n- You can merge a directory into another by calling `fs.copy(dirA, dirB)`.\n\n- When merging directories with `fs.copy`, be careful not to accidentally overwrite directories with a file or link.\n\n- When merging directories with `fs.copy`, any sub-directories will merge into pre-existing directories with the same name.\n\n- Using `fs.readFile` on a link path will resolve the link before reading.\n\n- Using `fs.writeFile` on a link path will resolve the link before writing.\n\n- Using `fs.removeFile` on a link path **won't** resolve the link before removing.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Ffsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Ffsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Ffsx/lists"}