New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@binary-com/binary-document-uploader

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@binary-com/binary-document-uploader

Upload files to binary.com platform

  • 2.4.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
888
increased by44.39%
Maintainers
2
Weekly downloads
 
Created
Source

binary-document-uploader

Uploading files through websocket to binary.com platform

Installation

npm install @binary-com/binary-document-uploader

Publishing a new version

With npm

First increase the version in package.json according to major/minor/patch. Ideally this will be done in the same PR as your changes. After that, you can run:

npm run build
npm publish

With yarn

Yarn automatically increases the version for you, so you only need to run:

yarn publish

The resulting DocumentUploader.js should be committed and uploaded to this repository.

Usage

ES6

import DocumentUploader from 'binary-document-uploader';

const uploader = new DocumentUploader(config);

RequireJS

const DocumentUploader = require('binary-document-uploader');

const uploader = new DocumentUploader(config);

Browser

<script src="./documentUploader.js"></script>
<script>
    const uploader = new DocumentUploader(config);
    uploader(file);
</script>

Example

import DocumentUploader from 'binary-document-uploader';

const uploader = new DocumentUploader(config);

uploader.upload(file)
    .then(result => console.log(`Status: ${result.status}`))
    .catch(error => console.log(error));

file (object)

File information and payload to send

file.filename

Filename

file.buffer

Array buffer containing the file to upload

file.documentType

Document type

file.documentId (optional)

Document id

file.documentFormat

Document format

file.expirationDate (optional)

Expiration date

file.lifetimeValid (optional)

Boolean value that indicates whether this document is lifetime valid (only applies to POI document types, cancels out the expiration_date given if any)

file.chunkSize

Default: 16384 (16 KB)

config (object)

config.connection

A ready websocket connection

config.debug

Default: false

Keywords

FAQs

Package last updated on 20 Jun 2023

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