@tater-archives/upload
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@tater-archives/upload

A simple utility to read a file as a string in the browser

Example Usage

// Get the input
const fileInput = document.getElementById('fileInput');
// Set the listener
fileInput.addEventListener('change', handleFileUpload(content => {
    // ... do stuff with content
}))

In React/Preact:

<input
    type="file"
    onChange={handleFileUpload(content => {
        /* ... do stuff with content */
    })}
/>

You can use it in the browser via esm.sh or unpkg.

import { handleFileUpload } from 'https://esm.sh/@tater-archives/upload';
// or
import { handleFileUpload } from 'https://unpkg.com/@tater-archives/upload';

Readme

Keywords

Package Sidebar

Install

npm i @tater-archives/upload

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

4.92 kB

Total Files

7

Last publish

Collaborators

  • tater-archives