dyna-client-down-load
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

About

Download files from the browser.

Runs only on browsers.

Written in Typescript, runs everywhere.

Import

npm install dyna-client-down-load

Note: The npm package name is dyna-client-down-load and not dyna-client-download due to an npm restriction.

Use cases

  • Build some data on browser (csv, etc..) and download them without need of server.
  • Export data from client for debugging purposes.

Methods

dynaClientDownloadText = (filename: string, text: string): void

Downloads a file with text content.

dynaClientDownloadObject = (filename: string, data: any, compressed: boolean = false): void

Downloads a file with json format with the data of the data object.

Note: that the object should be able to be stringified.

The dynaClientDownloadObject method, adds the .json extension if needed.

Examples

dynaClientDownloadText("hello.txt", "Hello world!");
dynaClientDownloadObject("hello", {message: "Hello world!"});

Readme

Keywords

none

Package Sidebar

Install

npm i dyna-client-down-load

Weekly Downloads

4

Version

1.0.5

License

MIT

Unpacked Size

35.7 kB

Total Files

29

Last publish

Collaborators

  • dennisat