Socket
Socket
Sign inDemoInstall

vue-barcode-scanner

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-barcode-scanner - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

85

index.js

@@ -1,77 +0,3 @@

// const VueBarcodeScanner = {
// install (Vue, options) {
// /* global Audio */
// // default plugin setting
// let attributes = {
// barcode: '',
// setting: {
// sound: false,
// soundSrc: ''
// },
// callback: null
// }
// // initial plugin setting
// if (options) {
// attributes.setting.sound = options.sound
// attributes.setting.soundSrc = options.soundSrc
// }
// Vue.prototype.$barcodeScanner = {}
// Vue.prototype.$barcodeScanner.init = (callback) => {
// // add listenter for scanner
// console.log('Vue barcode scanner is ready !!')
// attributes.callback = callback
// window.addEventListener('keydown', onInputScanned)
// }
// Vue.prototype.$barcodeScanner.destroy = () => {
// // remove listener
// window.removeEventListener('keydown', onInputScanned)
// }
// function onInputScanned (event) {
// if (document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {
// // if input text not on focus scanner will not allow to scan
// event.preventDefault()
// } else if (event.keyCode === 13 && attributes.barcode !== '') {
// // scanner is done and trigger "Enter" then clear barcode and play the sound if it's set as true
// attributes.callback(attributes.barcode)
// attributes.barcode = ''
// if (attributes.setting.sound) {
// triggerSound()
// }
// } else {
// // scan and validate each charactor
// attributes.barcode += validateInput(event.keyCode)
// }
// }
// // validate each input for special charactor
// function validateInput (input) {
// let inputChar = ''
// switch (input) {
// case 189: inputChar = '-'; break
// default: inputChar = String.fromCharCode(input); break
// }
// return inputChar
// }
// // init audio and play
// function triggerSound () {
// let audio = new Audio(attributes.setting.soundSrc)
// audio.play()
// }
// }
// }
// // // Automatic installation if Vue has been added to the global scope.
// // if (typeof window !== 'undefined' && window.Vue) {
// // window.Vue.use(MyPlugin)
// // }
// export default VueBarcodeScanner
exports.install = function (Vue, options) {
const VueBarcodeScanner = {
install (Vue, options) {
/* global Audio */

@@ -142,1 +68,8 @@ // default plugin setting

}
// // Automatic installation if Vue has been added to the global scope.
// if (typeof window !== 'undefined' && window.Vue) {
// window.Vue.use(MyPlugin)
// }
export default VueBarcodeScanner

2

package.json
{
"name": "vue-barcode-scanner",
"version": "0.0.2",
"version": "0.0.3",
"description": "Barcode Scanner Plugin for Vue.js",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc