
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
@forlagshuset/simple-fs
Advanced tools
A minimal, extensible and promise based filesystem layer for modern browsers.
Simple-fs provides two storage backend. It's possible to write your own stoage backend using Storage API
import { IndexedDbStorage } from '@forlagshuset/simple-fs'
import { MemoryStorage } from '@forlagshuset/simple-fs'
npm:
npm install --save @forlagshuset/simple-fs
browser (umd):
<script src='https://unpkg.com/@forlagshuset/simple-fs@latest/dist/SimpleFS.js' async></script>
<script>
// by default SimpleFS uses IndexedDB
const fs = new SimpleFS.FileSystem()
// do stuff
await fs.mkdir('/myproject')
// create a file under root folder
const content = new Blob(['This is my cool project'], {type: 'plain/text'})
await fs.writeFile('/myproject/test.txt', content)
// get content as blob
let blob = await fs.readFile('/myproject/test.txt')
</script>
browser (modules)
import SimpleFS from '@forlagshuset/simple-fs'
// OR es6 modules from unpkg
import SimpleFS from "//unpkg.com/@forlagshuset/simple-fs?module"
const fs = new SimpleFS.FileSystem()
// first create root folder
await fs.mkdir('/myproject')
// create a file under root folder
const content = new Blob(['This is my cool project'], {type: 'plain/text'})
await fs.writeFile('/myproject/test.txt', content)
// get content as blob
let blob = await fs.readFile('/myproject/test.txt')
FileSystem
constructor({storage: storageObj = new IndexedDbStorage('my-storage-name')})
mkdir(path: string)
mkdirParents(path: string) // wraps mkdir -p
rmdir(path: string)
rmdirRecursive(path: string) // removes dirs recursively
readFile(path: string, options={}) // returns Blob
writeFile(path: string, data: Blob, options={}) // data should be Blob type
outputFile(path: string, data: Blob, options={}) // Wraps writeFile and recursively creates path if not exists
bulkOutputFiles([{path: string, blob: Blob, options:{}]) // Output files in one transaction, speeds up in chrome
unlink(path: string)
exists(path: string)
stats(path: string)
FAQs
File system in indexeddb
We found that @forlagshuset/simple-fs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.

Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.

Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.