Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-card-swipe

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-card-swipe

A React plugin for reading or capturing data from magnetic card readers.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
113
increased by7.62%
Maintainers
1
Weekly downloads
 
Created
Source

react-card-swipe

A React plugin for reading or capturing card data from magnetic swipe readers.

Note: Requires a magnetic card reader to executed.

npm npm

Installation

npm install react-card-swipe

Using this plugin

import React from "react"
import CardSwipe from 'react-card-swipe'

class SearchPatient extends React.Component {
  constructor(props) {
    super(props)

    this.state = {
      swipeData: {}
    }

    CardSwipe.init({
      success: this.handleSwipeSuccess,
      debug: false
    })
  }

  handleSwipeSuccess = (swipeData) => {
    console.log(swipeData)

    this.setState({
      swipeData: swipeData
    })
  }

  render() {
    return (
      <React.Fragment>
        <pre>{JSON.stringify(this.state.swipeData) }</pre>
      </React.Fragment>
    )
  }
}

Credits

This plugin was originally of CarlRaymond/jquery.cardswipe. This instance simply ports the functionalities into a React plugin.

MIT

Keywords

FAQs

Package last updated on 25 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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