JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 41
  • Score
    100M100P100Q96211F
  • License MIT

A skipper adapter to allow uploading files to MongoDB's GridFS

Package Exports

  • skipper-gridfs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (skipper-gridfs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

skipper emblem - face of a ship's captain GridFS Filesystem Adapter

NPM version     Build Status

GridFS adapter for receiving upstreams. Particularly useful for handling streaming multipart file uploads from the Skipper body parser.

========================================

Installation

$ npm install skipper-gridfs --save

Also make sure you have skipper installed as your body parser.

Skipper is installed by default in Sails v0.10.

========================================

Usage

req.file('avatar')
.upload({
  adapter: require('skipper-gridfs'),
  uri: 'mongodb://jimmy@j1mtr0n1xx@mongo.jimmy.com:27017/coolapp.avatar_uploads'
}, function whenDone(err, uploadedFiles) {
  if (err) return res.negotiate(err);
  else return res.ok({
    files: uploadedFiles,
    textParams: req.params.all()
  });
});

For more detailed usage information and a full list of available options, see the Skipper docs, especially the section on "[https://github.com/balderdashy/skipper#uploading-files-to-gridfs](Uploading to GridFS)".

One important adapter-specific option to note is uri:

Option Type Details
uri ((string)) An optional parameter if you wish the enter your mongodb credentials as a URI, e.g. mongodb://username:password@localhost:27107/databasename.bucket.
(Check mongo client URI syntax).

Note: Please use uri instead of passing in separate options for username, password, host, port, dbname and bucket

========================================

Contributions

are welcomed 👌

See ROADMAP.md.

Also be sure to check out ROADMAP.md in the Skipper repo.

To run the tests:

$ URI=mongodb://username:password@localhost:27107/databasename.bucket npm test

========================================

License

MIT