Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-textract

Package Overview
Dependencies
Maintainers
5
Versions
419
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-textract

AWS SDK for JavaScript Textract Client for Node.js, Browser and React Native

  • 3.709.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is @aws-sdk/client-textract?

@aws-sdk/client-textract is an AWS SDK for JavaScript package that allows developers to interact with Amazon Textract, a service that automatically extracts text and data from scanned documents. This package provides methods to analyze documents, detect text, and extract structured data from forms and tables.

What are @aws-sdk/client-textract's main functionalities?

Detect Document Text

This feature allows you to detect text in a document. The code sample demonstrates how to use the DetectDocumentTextCommand to extract text from a document provided as a byte array.

const { TextractClient, DetectDocumentTextCommand } = require('@aws-sdk/client-textract');

const client = new TextractClient({ region: 'us-west-2' });
const params = {
  Document: {
    Bytes: Buffer.from('...') // Replace with your document bytes
  }
};

const run = async () => {
  try {
    const data = await client.send(new DetectDocumentTextCommand(params));
    console.log(data);
  } catch (err) {
    console.error(err);
  }
};

run();

Analyze Document

This feature allows you to analyze a document for tables and forms. The code sample demonstrates how to use the AnalyzeDocumentCommand to extract structured data from a document provided as a byte array.

const { TextractClient, AnalyzeDocumentCommand } = require('@aws-sdk/client-textract');

const client = new TextractClient({ region: 'us-west-2' });
const params = {
  Document: {
    Bytes: Buffer.from('...') // Replace with your document bytes
  },
  FeatureTypes: ['TABLES', 'FORMS']
};

const run = async () => {
  try {
    const data = await client.send(new AnalyzeDocumentCommand(params));
    console.log(data);
  } catch (err) {
    console.error(err);
  }
};

run();

Start Document Text Detection

This feature allows you to start an asynchronous job to detect text in a document stored in an S3 bucket. The code sample demonstrates how to use the StartDocumentTextDetectionCommand to initiate the text detection process.

const { TextractClient, StartDocumentTextDetectionCommand } = require('@aws-sdk/client-textract');

const client = new TextractClient({ region: 'us-west-2' });
const params = {
  DocumentLocation: {
    S3Object: {
      Bucket: 'your-bucket-name',
      Name: 'your-document-name'
    }
  }
};

const run = async () => {
  try {
    const data = await client.send(new StartDocumentTextDetectionCommand(params));
    console.log(data);
  } catch (err) {
    console.error(err);
  }
};

run();

Other packages similar to @aws-sdk/client-textract

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc