Skip to content

Commit 5f7cd7e

Browse files
committed
Readme changes
1 parent b7d375c commit 5f7cd7e

File tree

3 files changed

+51
-16
lines changed

3 files changed

+51
-16
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
11
# Fctrlx Angular File Reader
22
Angular library that helps convert file (from input[type=file]) to base64/arrayBuffer/text using FileReader API.
3+
4+
#Installation
5+
6+
1. `npm install --save fctrlx-angular-file-reader`
7+
2. add dependency to your project
8+
9+
`
10+
import { FctrlxAngularFileReader } from 'fctrlx-angular-file-reader';
11+
12+
@NgModule({
13+
...
14+
imports: [
15+
...,
16+
FctrlxAngularFileReader,
17+
]
18+
})
19+
`
20+
21+
3. Enjoy!
22+
23+
#Usage:
24+
`<input fileToBase64 type="file" [(files)]="fileModel">`
25+
26+
#Available Directives
27+
- `fileToBase64`
28+
- `fileToArrBuf`
29+
- `fileToText`
30+
31+
#Events and attributes.
32+
- `files` - your model that will be converted.
33+
- `type` - directives working only with type=file.
34+
- `multiple` - if you input is multiple - you will get in response array of files, in other case it will be an object.
35+
- `filesChange` - Event that calling when you select a file(s), usage: `<input fileToText type="file" [(files)]="fileModelText" (filesChange)="onTextChanges($event)">`
36+
37+
#Response
38+
`{
39+
name: string;//file name
40+
size: number;//file size
41+
type: string;//file type
42+
base64?: string;// base64 data
43+
text?: string;// text data
44+
arrBuf?: any;// array buffer data
45+
}`
46+
47+
48+
#Full example:
49+
50+
51+
#Author
52+
_Alexey Khamitsevich_

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fctrlx-angular-file-reader",
3-
"version": "0.0.7",
3+
"version": "1.0.0",
44
"description": "Angular library that helps convert file (from input[type=file]) to base64/arrayBuffer/text using FileReader API.",
55
"keywords": [
66
"angular",

tsconfig.spec.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)