@clemox/ngx-file-saver
Advanced tools
Comparing version
{ | ||
"name": "@clemox/ngx-file-saver", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"peerDependencies": { | ||
@@ -11,2 +11,3 @@ "@angular/common": "^10.0.14", | ||
}, | ||
"license": "", | ||
"main": "bundles/clemox-ngx-file-saver.umd.js", | ||
@@ -13,0 +14,0 @@ "module": "fesm2015/clemox-ngx-file-saver.js", |
@@ -1,2 +0,51 @@ | ||
This projet is an inspiration of eligrey FileSave.js for Angular. | ||
https://github.com/eligrey/FileSaver.js | ||
# ngx-file-saver | ||
This projet is an inspiration of eligrey [FileSave.js](https://github.com/eligrey/FileSaver.js). | ||
The library is full compatible with Angular, and it's simple to use. | ||
## Source code | ||
Source code can be found on my [GitHub](https://github.com/clem4net/angular-library). | ||
## Browsers | ||
I made some test on following browsers. | ||
| Browser | Version | | ||
| ----------------------- | -------------- | | ||
| Firefox | 80 | | ||
| Google Chrome | 84 | | ||
| Microsoft Edge Chromium | 85 | | ||
## Install | ||
```bash | ||
npm install @clemox/ngx-file-saver | ||
``` | ||
## Usage | ||
1) Import module | ||
```typescript | ||
import { NgxFileSaverModule } from './../../projects/ngx-file-saver/src/lib/ngx-file-saver.module'; | ||
@NgModule({ | ||
imports: [ NgxFileSaverModule ] | ||
}) | ||
``` | ||
2) Declare service | ||
```typescript | ||
import { NgxFileSaverModule } from './../../projects/ngx-file-saver/src/lib/ngx-file-saver.module'; | ||
constructor( | ||
private fileSaver: NgxFileSaverService | ||
) { } | ||
``` | ||
3) Download file or blob | ||
```typescript | ||
this.fileSaver.saveUrl(url, 'Test.docx'); | ||
``` | ||
```typescript | ||
const blob = new Blob(['Test de blob'], { type: 'text/plain' }); | ||
this.fileSaver.saveBlob(blob, 'Test.txt');- | ||
``` |
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 2 instances in 1 package
44009
2.82%51
1600%2
Infinity%