0.1.2 • Published 1 year ago

@webufs/webufs-idb v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago