Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sane-scanimage-wrapper

simple wrapper around sane scanimage to scan images from nodejs.

Requirements

This module is a wrapper around sane's scanimage utility, you need to have sane installed.

sudo apt-get install sane

Install

npm install --save sane-scanimage-wrapper

API

listDevices

Returns a promise that is resolved to an Array of available devices.

Example:

var sane = require('sane-scanimage-wrapper');

sane.listDevices().then(console.log);

/* output :
[ { name: 'epson2:net:192.168.0.38',
    vendor: 'Epson',
    model: 'PID 0891',
    type: 'flatbed scanner',
    index: '0' } ]
*/

Scan

Return a stream of the scaned image.

var sane = require('sane-scanimage-wrapper');
var fs = require('fs');

var scanner = new sane.Scanner();
scanner.scan().pipe(fs.createWriteStream('./output.png'));

Specify scan options :

var sane = require('sane-scanimage-wrapper');
var fs = require('fs');

var scanner = new sane.Scanner();
scanner.scan({ format: 'png', resolution: '150dpi'}).pipe(fs.createWriteStream('./output.png'));

Any options passed to the scan method is appended to the underlying command line.

About

simple wrapper around sane scanimage to scan images from node

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages