https://github.com/lafkpages/minifs
An in-memory filesystem-like data structure.
https://github.com/lafkpages/minifs
fs in-memory mini
Last synced: 6 days ago
JSON representation
An in-memory filesystem-like data structure.
- Host: GitHub
- URL: https://github.com/lafkpages/minifs
- Owner: lafkpages
- Created: 2023-12-12T09:43:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T16:37:22.000Z (over 2 years ago)
- Last Synced: 2024-03-14T19:54:26.395Z (over 2 years ago)
- Topics: fs, in-memory, mini
- Language: TypeScript
- Homepage:
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# MiniFS
An in-memory filesystem-like data structure.
## Installation
You can install MiniFS using npm, or your preferred package manager.
```bash
npm i @luisafk/minifs
```
## Usage
```ts
import { MiniFS } from "@luisafk/minifs";
const fs = new MiniFS();
fs.writeFile("foo/bar.txt", "Hello, World"); // true
fs.readDirectory("foo"); // ["bar.txt"]
fs.readFile("foo/bar.txt"); // "Hello, World"
```
## Development
First, clone the repository and install the dependencies.
```bash
git clone https://github.com/lafkpages/minifs.git
cd minifs
bun install
```
Then, configure Git hooks.
```bash
git config core.hooksPath .githooks
```
### Running tests
Tests are automatically run before every commit. You can also run them manually:
```bash
bun test
```