1.0.0 • Published 5 years ago
extreader v1.0.0
extreader - Open Source Node Module
Purpose
The purpose of this simple module is to quickly and easily read files from an <input type="file">
element.
Dependencies
The only dependency for this module is Node.js. Node is needed for using the require
syntax.
How to use
To install, in your project directory, simply run npm install extreader
Example for use
const Extreader = require('extreader');
let fileInput = document.getElementById('fileInput');
const extreader = new Extreader(fileInput);
fileInput.addEventListener('load', () => {
console.log(extreader.readFiles());
});
When the user adds files to the file input element in the app, an array of all the file data will be printed, with each item in the array corresponding to each file selected.
The constructor takes in one argument, the file input element.
The function readFiles()
returns an array for the file data of all the files selected.
1.0.0
5 years ago