paperless
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

API Client for paperless-ng

Installation

# yarn
yarn install paperless

# NPM
npm install paperless

Usage

Here are some examples how this library works. Since it is fully typed I won't explain every method here. Just dive into the types and you're ready to roll. Also note that not all functions are available right now. Mostly GET functions work.

import { Paperless } from 'paperless';

const paperless = new Paperless({
  username: 'dunklestoast',
  password: 'mucho_secret',
  host: 'paperless.example.com',
  port: 1337,
});

// Get a document by Id
const document = await paperless.getDocument(2);

// Download a document
const file = await paperless.downloadDocument(2);
fs.writeFileSync(`${document.title}.pdf`, file);

// Get a documents thumbnail
await paperless.getThumbnail(2);

React Native

This package is compatible with React Native. However, the ignoreSSL feature is not supported and will throw errors, if you set this to true.

Readme

Keywords

none

Package Sidebar

Install

npm i paperless

Weekly Downloads

1

Version

0.2.3

License

MIT

Unpacked Size

34.4 kB

Total Files

33

Last publish

Collaborators

  • dunklestoast