New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@sk-global/text-extractor

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sk-global/text-extractor

A text extractor for extracting text from HTML, PDF, Image and other files.

latest
Source
npmnpm
Version
0.2.3
Version published
Maintainers
1
Created
Source

text-extractors

A text extractor for extracting text from HTML, PDF, Image and other files.

Currently supported types ...

  • HTML, use html-to-text
  • PDF, use pdfjs
  • Image (PNG, JPEG, GIF, BMP, TIFF, ICO, SVG). Use tesseract.js for OCR.
  • ... and more to come

Installation

npm install text-extractors

Usage

CommonJS

const { fromUrl, fromBufferWithMimeType, fromBuffer } = require('text-extractors');

// fromUrl
const text = await fromUrl('https://www.digital.go.jp/assets/contents/node/basic_page/field_ref_resources/d6cfdcdd-75e4-460c-9ec0-af4f952e03d5/20210906_meeting_promoting_01.pdf');

// fromBufferWithMimeType
const text = await fromBufferWithMimeType(buffer, 'image/png');

// fromBuffer
const text = await fromBuffer(buffer);

ES6

import { fromUrl, fromBufferWithMimeType, fromBuffer } from 'text-extractors';

Roadmap

  • Add support for more file types
  • Add support for options passed to the underlying libraries

FAQs

Package last updated on 17 May 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