Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

mongoose-blob-store

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-blob-store

store blobs using mongoose gridfs

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

mongoose-blob-store

store blobs using mongoose gridfs

npm version Build Status

blob-store-compatible

compatible with the abstract-blob-store API and passes its test suite

eg. Usage

Please note that the configuration has a breaking change since v0.*

const store = require('mongoose-blob-store');
// connect mongoose to mongo db then use the connection
const mongooseConnection = require('mongoose').connection;
const blobStorage = store({
  mongooseConnection,
  collection: 'attachments',
  modelName: 'Attachment',
});

//write
blobStorage.createWriteStream(opts, cb);

//read
const stream = blobStorage.createReadStream(opts);

//remove
blobStorage.remove(opts, cb);

//check if file exists
blobStorage.exists(opts, cb);

pull requests are welcome

Keywords

mongoose

FAQs

Package last updated on 15 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts