storm-file-input

1.0.3 • Public • Published

S torm File Input

Build Status codecov.io npm version

Tests support for and wraps file input to style and display the filename

Example

https://mjbp.github.io/storm-file-input

Usage

Test support, then wrap a file input to display the filename(s):

HTML

<div>
    <input type="file" name="f" id="f" multiple>
</div>

JS

npm i -S storm-file-input

either using es6 import

import FileInput from 'storm-file-input';

FileInput.init('input[type=file]');

aynchronous browser loading (use the .standalone version in the /dist folder)

import Load from 'storm-file-input';

Load('/content/js/async/storm-file-input.standalone.js')
    .then(() => FileInput.init('input[type=file]'));

Tests

npm run test

Browser support

This is module has both es6 and es5 distributions. The es6 version should be used in a workflow that transpiles.

This module depends upon Object.assign, element.classList, and Promises, available in all evergreen browsers. ie9+ is supported with polyfills, ie8+ will work with even more polyfills for Array functions and eventListeners.

Dependencies

None

License

MIT

Package Sidebar

Install

npm i storm-file-input

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

37.1 kB

Total Files

15

Last publish

Collaborators

  • mjbp