@futpib/tika-server-client

0.0.5 • Public • Published

Introduction

A client for Apache's tika-server. Built on bluebird promises.

Examples

Meta Requests

metaFromFile( path )

var TikaClient = require( 'tika-server-client' );
var tika = new TikaClient( 'http://localhost:9998' );

tika
    .metaFromFile( 'hello-world.odt' )
    .then( function( meta ) {

        var json = JSON.stringify( meta, null, 4 );
        console.log( json );
    });

metaFromUrl( url )

var TikaClient = require( 'tika-server-client' );
var tika = new TikaClient( 'http://localhost:9998' );

tika
    .metaFromUrl( 'http://localhost:9998/tika' )
    .then( function( meta ) {

        var json = JSON.stringify( meta, null, 4 );
        console.log( json );
    });

metaFromStream( readableStream )

var TikaClient = require( 'tika-server-client' );
var tika = new TikaClient( 'http://remotehost.localdomain:9998' );

tika
    .metaFromStream( fs.createReadStream('hello-world.odt') )
    .then( function( meta ) {

        var json = JSON.stringify( meta, null, 4 );
        console.log( json );
    });

Tika Requests

tikaFromFile( path )

var TikaClient = require( 'tika-server-client' );
var tika = new TikaClient( 'http://localhost:9998' );

tika
    .tikaFromFile( 'hello-world.odt' )
    .then( function( text ) {

        console.log( text );
    });

tikaFromUrl( url )

var TikaClient = require( 'tika-server-client' );
var tika = new TikaClient( 'http://localhost:9998' );

tika
    .tikaFromUrl( 'http://localhost:9998/tika' )
    .then( function( text ) {

        console.log( text );
    });

tikaFromStream( readableStream )

var TikaClient = require( 'tika-server-client' );
var tika = new TikaClient( 'http://remotehost.localdomain:9998' );

tika
    .tikaFromStream( fs.createReadStream('hello-world.odt') )
    .then( function( text ) {

        console.log( text );
    });

Readme

Keywords

Package Sidebar

Install

npm i @futpib/tika-server-client

Weekly Downloads

1

Version

0.0.5

License

None

Last publish

Collaborators

  • futpib