File Storage Abstraction module for Node.js?
Asked Answered
R

4

20

Working on applications in PHP, I like to use a file storage abstraction layer (for instance Flysystem). This makes it trivial to switch between locations where files should be persisted to (cloud storage, local drive, ZIP, whatever).

Currently I am getting started in Node.js so I was wondering if a similar module exists for node?

Searching the NPM site gave me a ton of hits related to the filesystem but nothing in regards to this level of abstraction.

Rameau answered 31/5, 2014 at 19:36 Comment(0)
R
5

As of 2023 there is Flystorage.

FlyStorage Has adapters for:
FlyStorage Logo
Built by the maintainer of PHP FlySystem
  • Amazon S3
  • Azure Storage Blob
  • Google Cloud Storage
  • In-Memory
  • Local filesystem
  • (S)FTP 🔜 Soon™️
  • For Node.js, written in TypeScript.

    Rameau answered 18/1 at 19:51 Comment(0)
    C
    7

    pkgcloud integrates multiple services (compute, storage, database. etc) and supports multiple cloud providers. The storage service's API is simple to use and supports streams, making it memory efficient as well.

    Unfortunately, the project is longer maintained.

    Cyril answered 13/6, 2015 at 13:42 Comment(4)
    Does this also support local file system? Would be nice to abstract local from AWS.Localize
    It does not. However, I have made cloudcp which uses pkgcloud under the hood and supports copying local files to the cloud.Cyril
    Yes, it supports local file system through package filesystem-storage-pkgcloud. Add and then enable it in your code var pkgcloud = require('pkgcloud'); pkgcloud.providers.filesystem = {}; pkgcloud.providers.filesystem.storage = require('filesystem-storage-pkgcloud');.Annora
    FYI pkgcloud only abstracts those providers that the web service owner typically pays for and fully controls (e.g. AWS S3). It does not support any storage providers that your users are responsible for (e.g. Google Drive.)Insipid
    E
    6

    There used to be Flydrive, but as of 2022 it is no longer maintained.

    It has support for:

    • Local
    • Amazon S3
    • Digital Ocean Spaces
    • FTP
    Efrem answered 18/7, 2018 at 7:5 Comment(1)
    Unfortunately, the project is longer maintained as a stand-alone package. It has been integrated in the AdonisJS Framework.Tranship
    L
    5

    There is filefog, which is intended to support Google Drive, Dropbox, SkyDrive and Box, as well as the local filesystem. Like passport it uses ‘strategies’ published as separate modules for each provider (filefog-dropbox, filefog-onedrive, etc.).

    However, it has not seen any activity since 2018.

    Leyden answered 23/6, 2014 at 22:4 Comment(2)
    Looks exactly like what I mean. I like the fact it uses the "promise" design pattern. Thanks!Rameau
    I am very curious why this answer gets downvoted without the downvoters stating what their problem with this answer is...Rameau
    R
    5

    As of 2023 there is Flystorage.

    FlyStorage Has adapters for:
    FlyStorage Logo
    Built by the maintainer of PHP FlySystem
  • Amazon S3
  • Azure Storage Blob
  • Google Cloud Storage
  • In-Memory
  • Local filesystem
  • (S)FTP 🔜 Soon™️
  • For Node.js, written in TypeScript.

    Rameau answered 18/1 at 19:51 Comment(0)

    © 2022 - 2024 — McMap. All rights reserved.