Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calmm-js/karet.fr
An observable wrapper for FileReader using Kefir
https://github.com/calmm-js/karet.fr
direct-style kefir observable property reactive
Last synced: about 2 months ago
JSON representation
An observable wrapper for FileReader using Kefir
- Host: GitHub
- URL: https://github.com/calmm-js/karet.fr
- Owner: calmm-js
- Created: 2018-07-01T19:53:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-13T12:26:18.000Z (almost 6 years ago)
- Last Synced: 2024-04-26T20:49:09.830Z (8 months ago)
- Topics: direct-style, kefir, observable, property, reactive
- Language: JavaScript
- Size: 86.9 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [≡](#contents) Karet FR · [![Gitter](https://img.shields.io/gitter/room/calmm-js/chat.js.svg)](https://gitter.im/calmm-js/chat) [![GitHub stars](https://img.shields.io/github/stars/calmm-js/karet.fr.svg?style=social)](https://github.com/calmm-js/karet.fr)
This library provides a thin wrapper over the standard
[`FileReader`](https://developer.mozilla.org/en-US/docs/Web/API/FileReader) API.
See also [Karet XHR](https://github.com/calmm-js/karet.xhr/).Examples:
* Live [Image Upload](https://codesandbox.io/s/oo8nz1kk7z) CodeSandbox.[![npm version](https://badge.fury.io/js/karet.fr.svg)](http://badge.fury.io/js/karet.fr)
[![Build Status](https://travis-ci.org/calmm-js/karet.fr.svg?branch=master)](https://travis-ci.org/calmm-js/karet.fr)
[![Code Coverage](https://img.shields.io/codecov/c/github/calmm-js/karet.fr/master.svg)](https://codecov.io/github/calmm-js/karet.fr?branch=master)
[![](https://david-dm.org/calmm-js/karet.fr.svg)](https://david-dm.org/calmm-js/karet.fr)
[![](https://david-dm.org/calmm-js/karet.fr/dev-status.svg)](https://david-dm.org/calmm-js/karet.fr?type=dev)* [Reference](#reference)
* [Starting](#starting)
* [`FR.readAsArrayBuffer(file) ~> fileReader`](#FR-readAsArrayBuffer)
* [`FR.readAsBinaryString(file) ~> fileReader`](#FR-readAsBinaryString)
* [`FR.readAsDataURL(file) ~> fileReader`](#FR-readAsDataURL)
* [`FR.readAsText(file) ~> fileReader`](#FR-readAsText)
* [State](#state)
* [`FR.hasEnded(fileReader) ~> boolean`](#FR-hasEnded)
* [`FR.hasFailed(fileReader) ~> boolean`](#FR-hasFailed)
* [`FR.hasStarted(fileReader) ~> boolean`](#FR-hasStarted)
* [`FR.hasSucceeded(fileReader) ~> boolean`](#FR-hasSucceeded)
* [`FR.isDone(fileReader) ~> boolean`](#FR-isDone)
* [`FR.isProgressing(fileReader) ~> boolean`](#FR-isProgressing)
* [`FR.loaded(fileReader) ~> number`](#FR-loaded)
* [`FR.readyState(fileReader) ~> number`](#FR-readyState)
* [`FR.total(fileReader) ~> number`](#FR-total)
* [Result](#result)
* [`FR.result(fileReader) ~> varies`](#FR-result)
* [`FR.error(fileReader) ~> exception`](#FR-error)The interface of this library consists of named exports. Typically one just
imports the library as:```js
import * as FR from 'karet.fr'
```### [≡](#contents) [Starting](#starting)
#### [≡](#contents) [`FR.readAsArrayBuffer(file) ~> fileReader`](#FR-readAsArrayBuffer)
#### [≡](#contents) [`FR.readAsBinaryString(file) ~> fileReader`](#FR-readAsBinaryString)
#### [≡](#contents) [`FR.readAsDataURL(file) ~> fileReader`](#FR-readAsDataURL)
#### [≡](#contents) [`FR.readAsText(file) ~> fileReader`](#FR-readAsText)### [≡](#contents) [State](#state)
#### [≡](#contents) [`FR.hasEnded(fileReader) ~> boolean`](#FR-hasEnded)
#### [≡](#contents) [`FR.hasFailed(fileReader) ~> boolean`](#FR-hasFailed)
#### [≡](#contents) [`FR.hasStarted(fileReader) ~> boolean`](#FR-hasStarted)
#### [≡](#contents) [`FR.hasSucceeded(fileReader) ~> boolean`](#FR-hasSucceeded)
#### [≡](#contents) [`FR.isDone(fileReader) ~> boolean`](#FR-isDone)
#### [≡](#contents) [`FR.isProgressing(fileReader) ~> boolean`](#FR-isProgressing)
#### [≡](#contents) [`FR.loaded(fileReader) ~> number`](#FR-loaded)
#### [≡](#contents) [`FR.readyState(fileReader) ~> number`](#FR-readyState)
#### [≡](#contents) [`FR.total(fileReader) ~> number`](#FR-total)### [≡](#contents) [Result](#result)
#### [≡](#contents) [`FR.result(fileReader) ~> varies`](#FR-result)
#### [≡](#contents) [`FR.error(fileReader) ~> exception`](#FR-error)