Socket
Book a DemoInstallSign in
Socket

rxjs-file

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rxjs-file

RxJS File utils

latest
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

RxJS File

A small package with a couple of File utils for RxJS.

npm GitHub Workflow Status Coveralls github branch

Table of Contents

Installation

You can install this package from NPM:

npm add rxjs rxjs-file

Or with Yarn:

yarn add rxjs rxjs-file

CDN

For CDN, you can use unpkg:

https://unpkg.com/rxjs-file/dist/bundles/rxjs-file.umd.min.js

The global namespace for rxjs-file is rxjsFile:

const {toArrayBuffer} = rxjsFile;

toArrayBuffer(file)
    .subscribe(buffer => {
        // Do something with the buffer 
    });

Usage

ES6

Read a file as ArrayBuffer:

import {toArrayBuffer} from 'rxjs-file';

toArrayBuffer(file)
    .subscribe(buffer => {
        // Do something with the buffer 
    });

Read the file as ArrayBuffer in chunks:

import {toArrayBuffer} from 'rxjs-file';

toArrayBuffer(file, {chunkSize: 1000 /* bytes */})
    .subscribe(chunk => {
        // Do something with each chunk
    });

Read a file as text:

import {toString} from 'rxjs-file';

toString(file)
    .subscribe(str => {
        // Do something with the string
    });

CommonJS

Read a file as ArrayBuffer:

const {toArrayBuffer} = require('rxjs-file');

toArrayBuffer(file)
    .subscribe(buffer => {
        // Do something with the buffer 
    });

Contribute

If you wish to contribute, please use the following guidelines:

Keywords

rxjs

FAQs

Package last updated on 06 Sep 2020

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