README
doxie-node
Node.js library for Doxie go Wi-fi, Doxie Q, and Doxie Go SE
This is a Node js wrapper library/SDK for the API provided from the Doxie series of Wi-Fi document scanners.
Documentation
See Doxie's offical API documentation
installation
yarn add doxie-node
or
npm install doxie-node --save
Usage / Initialize
This requires knowing your Doxie's IP address on your network. All methods return a promise.
import doxieNode from 'doxie-node';
const doxie = new doxieNode({ doxieURL: 'http://192.168.1.3' });
Available options
doxie-node can take the following options:
username
optional - defaults:doxie
password
optionaltoken
optional - base64 encoded username and password token (ie. Basic [token]) if username and password provided, this token is created for you.doxieURL
requireddoxiePort
optional - default:8080
Methods
hello
Used to check the status of your Doxie.
If calling on a Doxie go SE or Doxie Q the return will include the firmware
and connectedToExternalPower
.
return doxie.hello().then(response);
returns
{
model: 'DX250',
name: 'Doxie_042D6A',
firmwareWiFi: '1.29',
hasPassword: false,
MAC: '00:11:E5:04:2D:6A',
mode: 'AP'
}
(Only for Doxie Go Wi-Fi) scanner_status
This method was deprecated for Doxie go SE, Doxie Q
returns
{
"firmware": "0.26",
"connectedToExternalPower": true
}
restart
returns 204 No Content and then restarts the scanner's Wi-Fi system. The scanner's status light blinks blue during the restart.
return doxie.restart().then(response);
list_all_scans
returns an array of all scans currently in the scanner’s memory. After scanning a document, the scan will available via the API several second later
return doxie.list_all_scans().then(response);
returns
[
{
name: '/DOXIE/JPEG/IMG_0001.JPG',
size: 241220,
modified: '2010-05-01 00:10:06'
},
{
name: '/DOXIE/JPEG/IMG_0002.JPG',
size: 265085,
modified: '2010-05-01 00:09:26'
},
{
name: '/DOXIE/JPEG/IMG_0003.JPG',
size: 273522,
modified: '2010-05-01 00:09:44'
}
];
most_recent_scan
returns the path to the last scan if available. Monitoring this value for changes provides a simple way to detect new scans without having to fetch the entire list of scans.
return doxie.most_recent_scan().then(response);
returns
{
"path":"/DOXIE/JPEG/IMG_0003.JPG"
}
get_scan
returns the scan at the specified path or 404 Not Found
This method also will retry (default: 3
) when a 404 is not found assuming the image
is not ready.
params
scanPath
required - String (ie.'/DOXIE/JPEG/IMG_0001.JPG'
)retries
optional -default: 3
- Number of retires to attempt when image is not ready
return doxie.get_scan('/DOXIE/JPEG/IMG_0001.JPG').then(response);
get_thumbnail
Thumbnails are constrained to fit within 240x240 pixels. Thumbnails for new scans are not
generated until after the scan has been made available in get_scan()
and most_recent_scan()
.
This function will return 404 Not Found if the thumbnail has not yet been
generated. This method also will retry (default: 3
) when a 404 is not found assuming
the image is not ready.
params
scanPath
required - String (ie.'/DOXIE/JPEG/IMG_0001.JPG'
)retries
optional -default: 3
- Number of retires to attempt when image is not ready
return doxie.get_thumbnail('/DOXIE/JPEG/IMG_0001.JPG').then(response);
returns on success the stream of the thumbnail
200
returns on failure
404 Not Found
delete_scan
deletes the scan at the specified path
return doxie.delete_scan('/DOXIE/JPEG/IMG_0001.JPG').then(response);
returns on success
204 No Content
when deleteing multiple scans use delete_mutiple_scans
for the best performance.
delete_multiple_scans
deletes multiple scans in a single operation. This is much faster than deleting each scan individually. Multiple scans are referenced using a JSON array of paths
const scans = [
'/DOXIE/JPEG/IMG_0001.JPG',
'/DOXIE/JPEG/IMG_0002.JPG',
'/DOXIE/JPEG/IMG_0003.JPG'
];
return doxie.delete_multiple_scans(scans).then(response);
returns on success
204 No Content
Development
yarn install
yarn test
to run tests
deployment
npm version [minor, patch, major]
git push origin master --tag
Auto publishes on tag commit to master. orgit push --follow-tags
This library is released under the MIT License