Local filesystem adapter for Nodestream
This adapter provides interface for Nodestream to transfer bytes between your app and the local filesystem storage on which the app runs.
npm install --save nodestream-filesystem
This adapter has only one confuguration option -
root - a path to a folder where Nodestream should expect to find/write your files to. If you do not provide this option, then Nodestream will try its best to determine that path for you:
- By checking the presence of
require.mainand using it
- By using the current working directory
In all these default cases, the target folder will be named .storage. If it does not exist, it will be created on first write.
Even with these defaults, you should always explicitly state where Nodestream should put your files. It's the only way to guarantee that you will not spend hours searching through your project's files trying to figure out where the hell did that file go. 😀
const Nodestream =const nodestream =adapter: 'filesystem'config:// You MUST provide either an absolute path or nothing at all// You can use array notation, the parts will be `path.join()`ed for youroot: __dirname '.storage'
This software is licensed under the BSD-3-Clause License. See the LICENSE file for more information.