waterline-blob
Factory method which generates waterline adapter definitions from blob adapter definitions
This should eventually be dmerge into waterline core
Usage
// Your blob adapter definition// (should have methods `read` and `write`)var BlobAdapterDefinition = /* ... */ ; // **BAM**var AdapterFactory = ; // Your ready-to-go sails/waterline-compatible adapter definitionvar AdapterDef = ;
Writing Your Own Blob Adapter
You can export up to two methods from a BlobAdapter definition: write()
and read()
.
/** * `Adapter.write( uploadStream, [options], [cb] )` * * Pipe initial FieldStreams (files) into a destination stream, * then set up events to automatically pipe the FieldStream of any newly detected file * from the UploadStream to the destination stream * * @param * and fires when new ones are added * @param * container : * maxBytes : * maxBytesPerFile : */
/** * Usages: * * Adapter.read() * Adapter.read(destinationStream) * Adapter.read(cb) * Adapter.read({}) * Adapter.read({}, cb) * Adapter.read({}, destinationStream) * Adapter.read({}, destinationStream, cb) */