0.1.2 • Published 2 months ago

@webufs/webufs-idb v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Webufs-idb is an IndexedDB implementation of webufs.

This is a plugin library for @webufs/webufs (also an example).

Usage

import { createDefaultContext } from '@webufs/webufs'
import { IDBFS } from '@webufs/webufs-idb'

const ctx = await createDefaultContext()
ctx.getVFS().registerFSType(IDBFS)
await ctx.mkdir('idb')
await ctx.mount('idbfs', '/idb')
await ctx.chdir('idb')

Mounting Options

Example:

import { indexedDB } from 'fake-indexeddb'

// ...

await ctx.mount('idbfs', '/idb', {
	/**
	 * type: IDBFactory
	 * defualt: indexedDB (in the corresponding global context)
	 * 
	 * You can choose any other custom indexedDB implementation
	 * instead of the default one.
	 */
	indexedDB: indexedDB,

	/**
	 * type: string
	 * default: 'webufs-idb'
	 * 
	 * the name of the IndexedDB database that our filesystem uses
	 * as the storage
	 * 
	 * In this way we can have multiple independent idbfs storages 
	 * at the same time.
	 */
	dbName: 'hello-webufs-idb'
})

// ...
0.1.2

2 months ago

0.1.1

2 months ago

0.1.0

3 months ago

0.0.11

3 months ago

0.0.10

3 months ago

0.0.8

3 months ago

0.0.7

3 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago