Most of the features of fsa-database wrapped with hooks for easy, clean component creation.
Hooks take care or reloading your data reactively in your components
Uses React Context for state management
// using npm
npm install @philstenning/fsa-database
// using pnpm
pnpm i @philstenning/fsa-database
// yarn
yarn add @philstenning/fsa-database
// app.tsx
// file extensions can be either '.md' or 'md'
import { FsaDbContextProvider } from '@philstenning/react-fsa-database'
function App() {
return (
<FsaDbContextProvider fileExtensionsForApp={['.txt', '.md', 'svg']}>
<YourApp></YourApp>
</FsaDbContextProvider>
)
}
export default App
// TODO
// TODO
// TODO
// TODO
// list of folders that are not scanned.
excludedFolders: string[] = [
"node_modules",
"programFiles",
"junk",
".git",
".changeset",
"bin",
"__pycache__",
]
// list of extensions to scan for
fileTypes: string[] = ['jpg','png','gif']
// How deep you want to scan
maxDepth: number = 10
fsaSetting {
id?: number
// set internally when browser session starts
sessionStarted: number
// when files are removed from a collection,
// or a collection is deleted
// removed files from local disk also
cleanUpFiles: boolean
// when a file is added to collection
// save to disk
autoSaveCollections: boolean
scanInterval: number // default is 0 or none.
// time the user last scanned for file changes.
lastScanned: number
// when adding with drag and drop whether
// to add files to a new folder
allowDndFiles: boolean
// When resetting db retain all root Directories.
retainRootDirectoriesOnReset: boolean;
}
Fully written with TypeScript
I'm open to all community contributions! If you'd like to contribute in any way, file an issue or pull request.
ISC
Generated using TypeDoc