@clemox/ngx-file-saver
TypeScript icon, indicating that this package has built-in type declarations

18.0.0 • Public • Published

ngx-file-saver

This projet is an inspiration of eligrey FileSave.js.
The library is full compatible with Angular, and it's simple to use.

Source code

Source code can be found on my GitHub.

Browsers

I made some test on following browsers.

Browser Version
Firefox 80
Google Chrome 84
Microsoft Edge Chromium 85

Install

npm install @clemox/ngx-file-saver

Usage

  1. Import module
import { NgxFileSaverModule } from '@clemox/ngx-file-saver';

@NgModule({ 
    imports: [ NgxFileSaverModule ]
})
  1. Declare service
import { NgxFileSaverModule } from '@clemox/ngx-file-saver';

constructor(
    private fileSaver: NgxFileSaverService
) { }
  1. Download file or blob
this.fileSaver.saveUrl(url, 'Test.docx');
const blob = new Blob(['Test de blob'], { type: 'text/plain' });
this.fileSaver.saveBlob(blob, 'Test.txt');-

/@clemox/ngx-file-saver/

    Package Sidebar

    Install

    npm i @clemox/ngx-file-saver

    Weekly Downloads

    32

    Version

    18.0.0

    License

    none

    Unpacked Size

    22.2 kB

    Total Files

    10

    Last publish

    Collaborators

    • clemox