# j-FileSaver

> This component is a wrapper for the [FileSaver.js library](https://github.com/eligrey/FileSaver.js/). With this component you can easily save locally generated files directly in the web browser.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: b7bd27ae5922a8ec9f48cb64cd5c34e50035deb3b15170a503d212a3a1c6634a
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

This component is a wrapper for the [FileSaver.js library](https://github.com/eligrey/FileSaver.js/). With this component you can easily save locally generated files directly in the web browser.

- singleton

### Methods

- `component.save(filename, string/blob, [contentType])`

Use it with `<ui-component name="filesaver">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="LAZY filesaver"></ui-component>
<button>Save something</button>

<script>

	$(document).on('click', 'button', function() {
		SETTER('filesaver/save', 'totaljs.txt', 'Hello world!\n\nwww.totaljs.com');
	});

</script>
```
