docparse-default-upload

instatiate a default upload mongoose model in memory

npm install docparse-default-upload
10 downloads in the last week
20 downloads in the last month

Docparse Default Uploads

Create default upload mongoose model in memory for use in docparse tests

Build Status Dependency Status 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

npm loves you