How to use the @reactioncommerce/file-collections-sa-gridfs.default function in @reactioncommerce/file-collections-sa-gridfs

To help you get started, we’ve selected a few @reactioncommerce/file-collections-sa-gridfs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reactioncommerce / reaction / src / core-services / files / setUpFileCollections.js View on Github external
import fetch from "node-fetch";
import sharp from "sharp";
import config from "./config.js";
import createSaveImageJob from "./util/createSaveImageJob.js";

const require = createRequire(import.meta.url);

const {
  FileDownloadManager,
  FileRecord,
  MongoFileCollection,
  TempFileStore,
  RemoteUrlWorker,
  TempFileStoreWorker
} = require("@reactioncommerce/file-collections");
const GridFSStore = require("@reactioncommerce/file-collections-sa-gridfs").default;

/**
 * @returns {undefined}
 */
export default function setUpFileCollections({
  absoluteUrlPrefix,
  context,
  db,
  Logger,
  MediaRecords,
  mongodb
}) {
  FileRecord.downloadEndpointPrefix = "/assets/files";
  FileRecord.absoluteUrlPrefix = absoluteUrlPrefix;

  // 1024*1024*2 is the GridFSStore default chunk size, and 256k is default GridFS chunk size, but performs terribly

@reactioncommerce/file-collections-sa-gridfs

A GridFS storage adapter for Reaction FileCollections.

MIT
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Popular @reactioncommerce/file-collections-sa-gridfs functions

Similar packages