{"id":13695656,"url":"https://github.com/fagbokforlaget/simple-fs","last_synced_at":"2025-10-08T02:51:36.869Z","repository":{"id":33926399,"uuid":"133867052","full_name":"fagbokforlaget/simple-fs","owner":"fagbokforlaget","description":"Handles files on indexeddb like you would do in node.js (promise)","archived":false,"fork":false,"pushed_at":"2024-11-14T16:43:19.000Z","size":3811,"stargazers_count":152,"open_issues_count":7,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T16:11:15.373Z","etag":null,"topics":["browser","filesystem","indexeddb","javascript","promise"],"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/fagbokforlaget.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-17T20:50:14.000Z","updated_at":"2024-11-14T16:43:23.000Z","dependencies_parsed_at":"2025-01-08T23:06:26.754Z","dependency_job_id":null,"html_url":"https://github.com/fagbokforlaget/simple-fs","commit_stats":{"total_commits":158,"total_committers":7,"mean_commits":"22.571428571428573","dds":0.5443037974683544,"last_synced_commit":"8de9433d4d4559646962e98eb0b97a3a73f19d20"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fagbokforlaget%2Fsimple-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fagbokforlaget%2Fsimple-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fagbokforlaget%2Fsimple-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fagbokforlaget%2Fsimple-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fagbokforlaget","download_url":"https://codeload.github.com/fagbokforlaget/simple-fs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248597730,"owners_count":21130933,"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":["browser","filesystem","indexeddb","javascript","promise"],"created_at":"2024-08-02T18:00:31.856Z","updated_at":"2025-10-08T02:51:31.831Z","avatar_url":"https://github.com/fagbokforlaget.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":["Miscellaneous Utilities"],"readme":"# SimpleFS\n[![view on npm](https://img.shields.io/npm/v/@forlagshuset/simple-fs.svg)](https://www.npmjs.com/package/@forlagshuset/simple-fs)\n[![npm module downloads](http://img.shields.io/npm/dt/@forlagshuset/simple-fs.svg)](https://www.npmjs.org/package/@forlagshuset/simple-fs)\n[![Dependency Status](https://david-dm.org/fagbokforlaget/simple-fs.svg)](https://david-dm.org/fagbokforlaget/simple-fs)\n[![Known Vulnerabilities](https://snyk.io/test/github/fagbokforlaget/simple-fs/badge.svg?targetFile=package.json)](https://snyk.io/test/github/fagbokforlaget/simple-fs?targetFile=package.json)\n[![Build Status](https://travis-ci.org/fagbokforlaget/simple-fs.svg?branch=master)](https://travis-ci.org/fagbokforlaget/simple-fs)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nA minimal, extensible and promise based filesystem layer for modern browsers.\n\n[Live Demo](https://codepen.io/iapain/full/MxLNeg)\n\n## Supported storage backend\nSimple-fs provides two storage backend. It's possible to write your own stoage backend using [Storage API](https://github.com/fagbokforlaget/simple-fs/blob/master/src/storages/base.js)\n\n* IndexedDB (default)\n```\nimport { IndexedDbStorage } from '@forlagshuset/simple-fs'\n```\n* Memory (experimental and used for testing)\n```\nimport { MemoryStorage } from '@forlagshuset/simple-fs'\n```\n\n## Installation\n\nnpm:\n```\nnpm install --save @forlagshuset/simple-fs\n```\n\n## Usage\nbrowser (umd):\n```html\n\u003cscript src='https://unpkg.com/@forlagshuset/simple-fs@latest/dist/SimpleFS.js' async\u003e\u003c/script\u003e\n\u003cscript\u003e\n  // by default SimpleFS uses IndexedDB\n  const fs = new SimpleFS.FileSystem()\n  // do stuff\n\n  await fs.mkdir('/myproject')\n\n  // create a file under root folder\n  const content = new Blob(['This is my cool project'], {type: 'plain/text'})\n  await fs.writeFile('/myproject/test.txt', content)\n\n  // get content as blob\n  let blob = await fs.readFile('/myproject/test.txt')\n\n\u003c/script\u003e\n```\n\n\nbrowser (modules)\n```javascript\nimport SimpleFS from '@forlagshuset/simple-fs'\n// OR es6 modules from unpkg\nimport SimpleFS from \"//unpkg.com/@forlagshuset/simple-fs?module\"\n\nconst fs = new SimpleFS.FileSystem()\n\n// first create root folder\nawait fs.mkdir('/myproject')\n\n// create a file under root folder\nconst content = new Blob(['This is my cool project'], {type: 'plain/text'})\nawait fs.writeFile('/myproject/test.txt', content)\n\n// get content as blob\nlet blob = await fs.readFile('/myproject/test.txt')\n```\n\n## API\n\nFileSystem\n```javascript\nconstructor({storage: storageObj = new IndexedDbStorage('my-storage-name')})\nmkdir(path: string)\nmkdirParents(path: string) // wraps mkdir -p\nrmdir(path: string)\nrmdirRecursive(path: string) // removes dirs recursively\nreadFile(path: string, options={}) // returns Blob\nwriteFile(path: string, data: Blob, options={}) // data should be Blob type\noutputFile(path: string, data: Blob, options={}) // Wraps writeFile and recursively creates path if not exists\nbulkOutputFiles([{path: string, blob: Blob, options:{}]) // Output files in one transaction, speeds up in chrome\nunlink(path: string)\nexists(path: string)\nstats(path: string)\n```\n\n## Browser support\n\n* Chrome\n* IE Edge\n* Firefox\n* Safari\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffagbokforlaget%2Fsimple-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffagbokforlaget%2Fsimple-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffagbokforlaget%2Fsimple-fs/lists"}