https://github.com/hackergrrl/safe-fs-blob-store
Filesystem blob store with atomic writes and high file limits on Windows
https://github.com/hackergrrl/safe-fs-blob-store
Last synced: 3 months ago
JSON representation
Filesystem blob store with atomic writes and high file limits on Windows
- Host: GitHub
- URL: https://github.com/hackergrrl/safe-fs-blob-store
- Owner: hackergrrl
- Created: 2017-09-27T18:53:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-18T21:17:02.000Z (about 6 years ago)
- Last Synced: 2025-04-12T06:12:43.410Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# safe-fs-blob-store
[](https://github.com/maxogden/abstract-blob-store)
> filesystem [blob store](https://github.com/maxogden/abstract-blob-store) with atomic writes and high file limits on Windows
This module exposes the same API as
[fs-blob-store](https://github.com/mafintosh/fs-blob-store), but with two
additional features:1. File writes are atomic. This is done by maintaining a "staging" area in the
blob store that files are written to, and then renamed (using an atomic
syscall) to the destination filename upon completion.
2. Window's NTFS file system has a limit of ~4 billion files in a directory.
FAT32 has a limit of ~65,000. This module transparently manages
subdirectories from the prefixes of given keys to avoid hitting this limit as
quickly.
3. Adds a `list()` method which lists the key names of all the files in the
media store.## Usage
``` js
var fs = require('safe-fs-blob-store')
var blobs = fs('some-directory')var ws = blobs.createWriteStream({
key: 'some/path/file.txt'
})ws.end('hello world\n')
ws.on('finish', function () {
var rs = blobs.createReadStream({
key: 'some/path/file.txt'
})rs.pipe(process.stdout)
})
```## API
See https://github.com/maxogden/abstract-blob-store and in addition:
### store.list(cb)
Calls `cb` with `err, keys`, where `keys` is an array of string key names of the files in the store.
## License
ISC