docparse-default-upload
v1.0.6
Published
instatiate a default upload mongoose model in memory
Downloads
3
Readme
Docparse Default Uploads
Create default upload mongoose model in memory for use in docparse tests
Dependency tracking by David
Usage
Default object
var inspect = require('eyespect').inspector()
var createDefaultUpload = require('docparse-default-upload')
createDefaultUpload(function(err, upload) {
if (err) {
inspect(err, 'error creating upload')
return;
}
inspect(upload.toObject(), 'created upload');
});
With custom data
var billID = new ObjectId();
var data = {
billNumber: 'bar bill number',
textPages: ['bar page 1 text', 'bar page 2 text'],
hash: 'bar hash',
supplier: new ObjectId(),
status: 'bar status',
supplierCode: 'POS',
billIDs: [billID]
};
var createDefaultUpload = require('docparse-default-upload')
createDefaultUpload(data, function(err, upload) {
if (err) {
inspect(err, 'error creating upload')
return;
}
inspect(upload.toObject(), 'default upload');
});
Installation
npm install docparse-default-upload