gridfs-file-tree-manager
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

GridFS-file-tree-manager

CodeFactor codecov

A small package for creating and interacting with file trees for files stored in MongoDB using GridFS. Documentation can be found here: https://herschalo.github.io/GridFS-file-tree-manager/

import MongoFileTree from "GridFS-file-tree-manager"
//MongoFileTree class automatically connects to MongoDB for all methods. 
const fileTree = new MongoFileTree("mongodb://localhost:27017", "GridFS-file-tree-management-sample", "sample-bucket", "sample-folder")

const docId = await fileTree.uploadFile(fs.createReadStream("sample.txt"), {name:"sample.txt", chunkSize:1048576})

If you want to run the tests for this library on your computer, make sure to have MongoDB installed. Additionally, you should also delete the database generated in your MongoDB instance by the test and delete the files generated in the 'test_output' and 'test_output_2' folders after each test. Otherwise,the tests will not be accurate.

License

GridFS-file-tree-manager is licensed under the MIT license.

Package Sidebar

Install

npm i gridfs-file-tree-manager

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

54.7 kB

Total Files

5

Last publish

Collaborators

  • herschalo