npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

docscan4nodejs

v2.0.2

Published

Node.js API for Dynamsoft Document Scanning Service. Supports TWAIN, SANE, ICA, WIA, eSCL scanners.

Readme

Document Scanner SDK for Node.js

The package provides Node.js APIs for invoking the Dynamic Web TWAIN Service REST API. It helps developers create desktop or server-side document scanning and processing applications with ease.


🚀 Key Features

  • 🖨️ Multi-Driver Support

    • TWAIN (32-bit & 64-bit)
    • WIA (Windows Image Acquisition)
    • SANE (Scanner Access Now Easy)
    • ICA (Image Capture Architecture)
    • eSCL (AirScan/Mopria)
    • Wi-Fi Direct
  • 🌐 Cross-Platform Compatibility

    • Windows 7+
    • macOS 10.15+
    • Linux (x64 / ARM64 / MIPS64)

⚙️ Prerequisites

✅ Install Dynamic Web TWAIN Service:

🔑 Get a License

Request a free trial license for the Dynamic Web TWAIN Service.


🧩 Configuration

After installation, open http://127.0.0.1:18625/ in your browser to configure the host and port settings.

By default, the service is bound to 127.0.0.1. To access it across the LAN, change the host to your local IP (e.g., 192.168.8.72).

dynamsoft-service-config


📡 REST API Endpoints

https://www.dynamsoft.com/web-twain/docs/info/api/restful.html

📦 Node.js APIs

🔍 Scanner APIs

  • getDevices(host, scannerType)
    Get available scanners. Returns an array of devices.

  • createJob(host, parameters)
    Create a new scan job. Returns a job object.

  • checkJob(host, jobId)
    Check job status (e.g., running, canceled, etc.)

  • deleteJob(host, jobId)
    Delete a scan job and terminate scanning.

  • updateJob(host, jobId, parameters)
    Update job status (e.g., cancel a running job).

  • getScannerCapabilities(host, jobId)
    Get scanner capabilities like resolution, color modes.

🖼️ Image Retrieval

  • getImageFile(host, jobId, directory)
    Fetch one image and save to local disk.

  • getImageFiles(host, jobId, directory)
    Fetch all images for a job and save to local disk.

  • getImageStream(host, jobId)
    Fetch one image as a readable stream.

  • getImageStreams(host, jobId)
    Fetch all images as streams.

  • getImageInfo(host, jobId)
    Retrieve metadata of the next page.

📄 Document APIs

  • createDocument(host, parameters)
    Create a new empty document (PDF).

  • getDocumentInfo(host, docId)
    Get document metadata and structure.

  • deleteDocument(host, docId)
    Delete an existing document.

  • getDocumentFile(host, docId, directory)
    Download the document and save as a PDF.

  • getDocumentStream(host, docId)
    Download document as a stream.

  • insertPage(host, docId, parameters)
    Insert a new page into an existing document.

  • deletePage(host, docId, pageId)
    Remove a page from an existing document.


⚙️ Scan Job Parameters

The configuration follows Dynamsoft Web TWAIN DeviceConfiguration.

let parameters = {
  license: "LICENSE-KEY",
  device: devices[0].device,
  config: {
    IfShowUI: false,
    PixelType: 2, // Color
    Resolution: 200,
    IfFeederEnabled: false,
    IfDuplexEnabled: false
  }
};

🧪 Examples

Set the LICENSE-KEY before running the examples.

🖥️ Command-line App

🌐 Web Server App