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

react-obfuscate

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-obfuscate

An intelligent React component to obfuscate any contact link

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.4K
decreased by-17.26%
Maintainers
1
Weekly downloads
 
Created
Source

React-Obfuscate Build Status

An intelligent React component to obfuscate any contact link

How it works

The user passes the contact link as a email, tel, sms, or facetime prop. The component obfuscates href data until an onClick event. The link is rendered in reverse in the dom, but reversed again with css. This making the link user friendly on screen, but useless for spammers.

Why

The world needs obfuscated links that display the link in a friendly way.

Usage

npm install --save react-obfuscate

Input

import react = from 'react'
import Obfuscate = from 'react-obfuscate'

export default () => (
  <p>
    Phone: <Obfuscate tel='205-454-1234' /><br />
    Email: <Obfuscate 
      email='hello@coston.cool' 
      headers={
        {subject:'Question from the website'},
        {cc:'friend@coston.cool'}
        }/>
  </p>
)

Output

<p>
  Phone: <a href="obfuscated" style="direction: rtl; unicode-bidi: bidi-override;">4321-454-502</a><br>
  Email: <a href="obfuscated" style="direction: rtl; unicode-bidi: bidi-override;">looc.notsoc@olleh</a>
</p>

Options

PropTypeArgumentDefaultDescription
emailstring<optional>nullemail address of the intended recipient.
telstring<optional>nulltelephone number of the intended recipient.
smsstring<optional>nullsms number of the intended recipient.
facetimestring<optional>nullfacetime address of the intended recipient.
obfuscateboolean<optional>trueset to false if you would like.
headersobject<optional>nullany standard mail header fields. The most commonly-used of these are "subject", "cc", and "body" (which is not a true header field, but allows you to specify a short content message for the new email).

Development

npm run build

Contributing

Please help make this react component better. Submit any issue and/or make a pull request!

To Do

  • Write some good tests
  • Convert clipboard text left to right

License

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 11 Jul 2017

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