Gathering detailed insights and metrics for ampersand-filereader-input-view
Gathering detailed insights and metrics for ampersand-filereader-input-view
Gathering detailed insights and metrics for ampersand-filereader-input-view
Gathering detailed insights and metrics for ampersand-filereader-input-view
A view module for returning metadata via callback using browser FileReader.
npm install ampersand-filereader-input-view
Typescript
Module System
Node Version
NPM Version
59.5
Supply Chain
85.1
Quality
67.6
Maintenance
100
Vulnerability
96.5
License
v1.0.4: file-field change event error fix
Updated on Apr 17, 2015
v1.0.3: required flag operable
Updated on Feb 03, 2015
v1.0.2: repo moved to new home
Updated on Feb 01, 2015
v1.0.1: memory cleanup enhancement
Updated on Feb 01, 2015
v1.0.0: initial release
Updated on Feb 01, 2015
JavaScript (100%)
Total Downloads
6,310
Last Day
1
Last Week
3
Last Month
54
Last Year
230
MIT License
1 Stars
18 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Jul 24, 2017
Minified
Minified + Gzipped
Latest Version
1.2.0
Package Id
ampersand-filereader-input-view@1.2.0
Size
4.29 kB
NPM Version
3.10.6
Node Version
8.1.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-50%
3
Compared to previous week
Last Month
100%
54
Compared to previous month
Last Year
-35%
230
Compared to previous year
1
2
A view module for returning metadata via callback using browser FileReader. Works well with ampersand-form-view.
It does the following:
callback
prop/method with metadata for file selected.npm install ampersand-filereader-input-view
The only required attributes are name and type. Everything else is optional (even the callback.)
1var InputView = require('ampersand-filereader-input-view'); 2 3 4var field = new FileReaderInputView({ 5 // form input's `name` attribute 6 name: 'file', 7 // You can replace the built-in template for the parent item 8 // just give it an html string. Make sure it has a single "root" element that contains: 9 // - an element with a `data-hook="label"` attribute 10 // - an element with a `data-hook="fieldContainer"` this is where individual fields go 11 // - an element with a `data-hook="main-message-container"` attribute (this we'll show/hide) 12 // - an elememt with a `data-hook="main-message-text"` attribute (where message text goes for error) 13 template: // some HTML string, 14 // Template for individual view. It should be a string of HTML 15 // Make sure it has a single "root" element that contains 16 // - an element with a `data-hook="label"` attribute 17 // - an element with a `data-hook="message-container"` attribute (this we'll show/hide) 18 // - an elememt with a `data-hook="message-text"` attribute (where message text goes for error) 19 // function called when file selected 20 // - arguments returned by callback: 21 // * 1st: fileInputView - view object of the file form-field 22 // * 2nd: data - object containing metadata for file selected 23 callback: function (fileInputView, data) {} 24 // Label name 25 label: 'File', 26 // Optional placeholder attribute 27 placeholder: 'file', 28 // optional, this is the element that will be 29 // replaced by this view. If you don't 30 // give it one, it will create one. 31 el: document.getElementByID('field'), 32 // class to set on input when input is valid 33 validClass: 'input-valid', // <- that's the default 34 // type value to use for the input tag's type value 35 type: 'file', 36 // class to set on input when input is valid 37 invalidClass: 'input-invalid', // <- that's the default 38 // Message to use if error is that it's required 39 // but no value was set. 40 requiredMessage: 'This field is required.', 41 // optional, you can pass in the parent view explicitly 42 parent: someViewInstance 43}); 44 45// append it somewhere or use it in side an ampersand-form-view 46document.querySelector('form').appendChild(field.el); 47
Created by @gdibble.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More