Installations
npm install ampersand-filereader-input-view
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.1.1
NPM Version
3.10.6
Score
64.9
Supply Chain
87.8
Quality
67.6
Maintenance
100
Vulnerability
96.5
License
Releases
v1.0.4: file-field change event error fix
Published on 17 Apr 2015
v1.0.3: required flag operable
Published on 03 Feb 2015
v1.0.2: repo moved to new home
Published on 01 Feb 2015
v1.0.1: memory cleanup enhancement
Published on 01 Feb 2015
v1.0.0: initial release
Published on 01 Feb 2015
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
firstclass
Download Statistics
Total Downloads
6,206
Last Day
2
Last Week
3
Last Month
18
Last Year
157
GitHub Statistics
1 Stars
18 Commits
1 Forks
2 Watching
1 Branches
1 Contributors
Bundle Size
76.21 kB
Minified
22.95 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
6,206
Last day
0%
2
Compared to previous day
Last week
-57.1%
3
Compared to previous week
Last month
0%
18
Compared to previous month
Last year
-60.1%
157
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
2
ampersand-filereader-input-view
A view module for returning metadata via callback using browser FileReader. Works well with ampersand-form-view.
It does the following:
- Returns an object via
callback
prop/method with metadata for file selected.
install
npm install ampersand-filereader-input-view
example
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
browser support
credits
Created by @gdibble.
license
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
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
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-02-03
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