{"id":27251487,"url":"https://github.com/scarletsfiction/sffilesystem","last_synced_at":"2026-04-28T08:03:14.677Z","repository":{"id":109493837,"uuid":"162084019","full_name":"ScarletsFiction/SFFileSystem","owner":"ScarletsFiction","description":"Extends functionality of modern browser FileSystem's API (For Chrome \u0026 Cordova)","archived":false,"fork":false,"pushed_at":"2018-12-17T09:00:51.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T01:10:30.233Z","etag":null,"topics":["cordova","file","html5","storage","website"],"latest_commit_sha":null,"homepage":"","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/ScarletsFiction.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}},"created_at":"2018-12-17T06:20:21.000Z","updated_at":"2019-08-03T15:28:52.000Z","dependencies_parsed_at":"2023-07-14T22:31:41.524Z","dependency_job_id":null,"html_url":"https://github.com/ScarletsFiction/SFFileSystem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ScarletsFiction/SFFileSystem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FSFFileSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FSFFileSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FSFFileSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FSFFileSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScarletsFiction","download_url":"https://codeload.github.com/ScarletsFiction/SFFileSystem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FSFFileSystem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32371673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"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":["cordova","file","html5","storage","website"],"created_at":"2025-04-11T01:10:03.859Z","updated_at":"2026-04-28T08:03:14.659Z","avatar_url":"https://github.com/ScarletsFiction.png","language":"JavaScript","funding_links":["https://www.patreon.com/stefansarya"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.patreon.com/stefansarya\"\u003e\u003cimg src=\"http://anisics.stream/assets/img/support-badge.png\" height=\"20\"\u003e\u003c/a\u003e\n\n[![Written by](https://img.shields.io/badge/Written%20by-ScarletsFiction-%231e87ff.svg)](LICENSE)\n[![Software License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE)\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=SFFileSystem%20is%20a%20library%20for%20accessing%20local%20file%20system%20for%20the%20current%20website%20on%20the%20browser.\u0026url=https://github.com/ScarletsFiction/SFFileSystem\u0026via=github\u0026hashtags=SFFileSystem,file,html5,storage,cordova)\n\n# SFFileSystem\nA library for accessing local file system for the current website on the browser\n\n## How to use\n### Initialization\n```js\nvar myFile = new SFFileSystem({ options });\n```\n\n### Options\n| Property  | Details |\n| --- | --- |\n| home | Set the root folder |\n| temporary | Store file to temporary storage that will vanish when the browser was refreshed |\n| callback | Callback if the initialization was success |\n| initError | Callback if the initialization was failed |\n\n### Available Methods\n#### home\nThis is the current root folder\n```js\nif(myFile.home.isDirectory === true)\n    console.log(\"I'm a folder\");\n\n// For other usage please check the 'Directory Entry' and 'Both Entry'\n```\n\n#### path\nGet directory entry from directory path\n```js\nmyFile.path('/myFolder/subFolder', function(dirEntry){\n    dirEntry.isDirectory === true\n}, console.error);\n```\n\n#### exist\nCheck if file/folder was exist and return the type of the target\n```js\nmyFile.exist('/myFolder/subFolder', function(exist){\n    if(exist === 'file' || exist === 'folder')\n        console.log(true);\n    else\n        console.log(false);\n}, console.error);\n```\n\n#### list\nGet contents from a path and return an array of string\n```js\nmyFile.list('/myFolder', function(list){\n    list instanceof Array;\n    // ['myFile.txt', 'myFolder']\n});\n```\n\n#### contents\nGet contents from a path and return their Entry\n```js\nmyFile.contents('/myFolder', function(list){\n    list instanceof Array;\n    // [FileEntry, DirectoryEntry, ...]\n});\n```\n\n\n### Directory Entry\n#### newFolder\nCreate new folder and get it's Entry\n```js\ndirEntry.newFolder('myFolder', function(subFolder){\n    subFolder.isDirectory === true;\n});\n```\n\n#### newFile\nCreate new file and get it's Entry\n```js\ndirEntry.newFile('myFile', function(fileEntry){\n    // fileEntry.write('stuff');\n});\n```\n\n#### getFolder\nGo to deeper folder and return the Directory Entry\n```js\ndirEntry.getFolder('myFolder', function(subFolder){\n    subFolder.isDirectory === true;\n});\n```\n\n#### getFile\nGet the file entry inside current folder\n```js\ndirEntry.getFile('myFile', function(fileEntry){\n    fileEntry.isFile === true;\n});\n```\n\n#### exist\nCheck if file/folder was exist and return the type of the target\n```js\ndirEntry.exist('myFolder', function(list){\n    if(exist === 'file' || exist === 'folder')\n        console.log(true);\n    else\n        console.log(false);\n});\n```\n\n#### contents\nGet contents from current folder and return their Entry\n```js\ndirEntry.contents(function(list){\n    list instanceof Array;\n    // [FileEntry, DirectoryEntry, ...]\n});\n```\n\n#### list\nGet contents from current folder and return their Entry\n```js\ndirEntry.list(function(list){\n    list instanceof Array;\n    // ['myFile.txt', 'myFolder']\n});\n```\n\n### File Entry\n#### write\nWrite blob or string to current file\n```\nfileEntry.write('string' || new Blob(['any'], {type:\"text/plain\"}));\n```\n\n#### append\nAppend blob or string to current file\n```\nfileEntry.append('string' || new Blob(['any'], {type:\"text/plain\"}));\n```\n\n#### read\nRead current file as a string\n```\nfileEntry.read(function(value){\n    console.warn(value);\n});\n\n// The alternative method is accessing the file from it's url\nvar url = fileEntry.toURL();\n```\n\n### Both Entry\n#### remove\nRename current file/folder\n```\nanyEntry.remove();\ndirEntry.removeRecursively();\n```\n\n#### rename\nRename current file/folder\n```\nanyEntry.rename('targetName');\n```\n\n#### copyTo\nCopy current file/folder to other directory\n```\nanyEntry.copyTo('path' || DirectoryEntry);\n```\n\n#### moveTo\nMove current file/folder to other directory\n```\nanyEntry.moveTo('path' || DirectoryEntry);\n```\n\n#### getParent\nGet parent directory for current file/folder\n```\nanyEntry.getParent(function(dirEntry){\n    dirEntry.isDirectory == true;\n});\n```\n\n#### isFile\nReturn true is current entry is a file\n```\nif(anyEntry.isFile)\n    console.log(\"I'm a file\");\n```\n\n#### isDirectory\nReturn true is current entry is a folder\n```\nif(anyEntry.isDirectory)\n    console.log(\"I'm a folder\");\n```\n\n#### toURL\nReturn absolute URL of current file/folder\n```\nvar url = anyEntry.toURL();\n// url = filesystem:http://localhost/...\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscarletsfiction%2Fsffilesystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscarletsfiction%2Fsffilesystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscarletsfiction%2Fsffilesystem/lists"}