{"id":15023176,"url":"https://github.com/perry-mitchell/any-fs","last_synced_at":"2025-09-09T06:35:05.884Z","repository":{"id":57180874,"uuid":"74202164","full_name":"perry-mitchell/any-fs","owner":"perry-mitchell","description":"Abstract away any filesystem (NodeJS) instance to a smarter interface","archived":false,"fork":false,"pushed_at":"2017-09-12T19:43:11.000Z","size":36,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T20:42:24.151Z","etag":null,"topics":["dropbox","filesystem","fs","nextcloud","owncloud","webdav"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/perry-mitchell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-19T10:34:24.000Z","updated_at":"2022-12-02T05:05:48.000Z","dependencies_parsed_at":"2022-09-14T03:40:57.039Z","dependency_job_id":null,"html_url":"https://github.com/perry-mitchell/any-fs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/perry-mitchell/any-fs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fany-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fany-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fany-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fany-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perry-mitchell","download_url":"https://codeload.github.com/perry-mitchell/any-fs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fany-fs/sbom","scorecard":{"id":728074,"data":{"date":"2025-08-11","repo":{"name":"github.com/perry-mitchell/any-fs","commit":"3528e0cf893ca9a0c14da393ed697aee2f462800"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T13:29:08.818Z","repository_id":57180874,"created_at":"2025-08-22T13:29:08.818Z","updated_at":"2025-08-22T13:29:08.818Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274254958,"owners_count":25250528,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dropbox","filesystem","fs","nextcloud","owncloud","webdav"],"created_at":"2024-09-24T19:58:48.052Z","updated_at":"2025-09-09T06:35:05.860Z","avatar_url":"https://github.com/perry-mitchell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Any-fs\nAbstract away any filesystem (NodeJS) instance to a smarter interface\n\n[![Build Status](https://travis-ci.org/perry-mitchell/any-fs.svg?branch=master)](https://travis-ci.org/perry-mitchell/any-fs) ![node min version](https://img.shields.io/badge/node-%3E%3D%204.7-lightgrey.svg) [![npm version](https://badge.fury.io/js/any-fs.svg)](https://www.npmjs.com/package/any-fs)\n\n## Purpose\nAny-fs was designed to wrap filesystem interfaces like the following:\n\n * Node's [fs](https://nodejs.org/api/fs.html)\n * [WebDAV-fs](https://github.com/perry-mitchell/webdav-fs)\n * [Dropbox-fs](https://github.com/sallar/dropbox-fs) (v0.0.5 and up)\n\nInto a common interface that provides a more intuitive syntax. Any-fs is designed to blindly take any of these systems and return a common API.\n\n## Usage\n\n### Node's fs\nUsage with the built-in `fs` interface is the simplest use-case:\n\n```javascript\nconst fs = require(\"fs\");\nconst anyFs = require(\"any-fs\");\n\nconst afs = anyFs(fs);\n\nafs\n    .readDirectory(\"/\")\n    .then(function(contents) {\n        console.log(contents.pop());\n        // returns something like:\n        // {\n        //    name: \"filename.txt,\n        //    isFile: Function,\n        //    isDirectory: Function,\n        // }\n    });\n```\n\nThis example returns an array if [stat](https://nodejs.org/api/fs.html#fs_class_fs_stats) objects.\n\n### WebDAV-fs\nOnce WebDAV-fs has been setup with a remote location, it too can be wrapped by any-fs:\n\n```javascript\nconst wfs = require(\"webdav-fs\")(\n    \"http://example.com/webdav/\",\n    \"username\",\n    \"password\"\n);\nconst anyFs = require(\"any-fs\");\n\nconst afs = anyFs(fs);\nafs\n    .readFile(\"/movie.mp4\")\n    .then(function(data) {\n        // `data` is a Buffer\n    });\n```\n\n## API\nAny-fs supports a few handy commands.\n\n### readDirectory(directoryPath[, options])\nRead the contents of a directory, returning a Promise with an array of stats (refer to the stat output of the wrapped fs module).\n\n| Parameter       | Type                      | Description                                         |\n|-----------------|---------------------------|-----------------------------------------------------|\n| directoryPath   | `String`                  | The path to scan                                    |\n| options         | `String` or `Object`      | Encoding (string) or config options (object)        |\n\n\u003e `options` may contain properties `mode` and `encoding` (`mode` being either `\"node\"` or `\"stat\"`), but it is essentially passed down into whatever fs interface is being wrapped.\n\n\u003e `options` is not used for `readdir` in Node's 'fs' module.\n\n### readFile(filePath[, options])\nRead the contents of a file, returning a Promise with a Buffer or string.\n\n| Parameter       | Type                      | Description                                         |\n|-----------------|---------------------------|-----------------------------------------------------|\n| filePath        | `String`                  | The file to read                                    |\n| options         | `String` or `Object`      | Encoding (string) or config options (object)        |\n\n\u003e `options.encoding` is set to `null` by default, returning the raw buffer. Use `\"utf8\"` to convert it to a UTF8 string.\n\n### stat(filePath)\nGet statistics on a file or directory - returns a Promise with the stat object.\n\n| Parameter       | Type                      | Description                                         |\n|-----------------|---------------------------|-----------------------------------------------------|\n| filePath        | `String`                  | The file or directory to check                      |\n\n### writeFile(filePath, data[, encoding])\nWrite data to a file - returns a Promise that resolves after writing has completed.\n\n| Parameter       | Type                      | Description                                         |\n|-----------------|---------------------------|-----------------------------------------------------|\n| filePath        | `String`                  | The file to write to                                |\n| data            | `Buffer` or `String`      | The data to write                                   |\n| encoding        | `String` or `undefined`   | The encoding to use for writing. `utf8` writes text.|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fany-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperry-mitchell%2Fany-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fany-fs/lists"}