Socket
Socket
Sign inDemoInstall

baffle-react

Package Overview
Dependencies
22
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    baffle-react

Text obfuscation via Baffle, as a React component


Version published
Weekly downloads
18
decreased by-14.29%
Maintainers
1
Install size
1.38 MB
Created
Weekly downloads
 

Readme

Source

baffle-react

CircleCI npm styled with prettier

Baffle as a React component

install

via npm
npm install --save baffle-react
via yarn
yarn add baffle-react

use

example

import React, { Component } from "react";
import Baffle from "baffle-react";

export default class Demo extends Component {
  state = {
    update: true,
    obfuscate: true
  };

  render() {
    const { update, obfuscate } = this.state;

    return (
      <div>
        <button onClick={() => this.setState({ update: !update })}>
          {update ? "Pause" : "Start"}
        </button>
        <button onClick={() => this.setState({ obfuscate: !obfuscate })}>
          {obfuscate ? "Reveal" : "Obfuscate"}
        </button>
        <Baffle
          speed={50}
          characters="!@#$%^&*"
          exclude={[" ", "!"]}
          obfuscate={obfuscate}
          update={update}
          revealDuration={1000}
          revealDelay={0}
        >
          !!!foo bar baz!!!
        </Baffle>
      </div>
    );
  }
}

props

proptypedefaultdescription
childrenstringText to be obfuscated
charactersstring|array"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz~!@#$%^&*()-+=[]{}|;:,./<>?"Character set to be used for obfuscation. See baffle.js options.characters
excludearray[" "]Character set to be ignored during obfuscation. See baffle.js options.exclude
speednumber50Frequency (in milliseconds) at which baffle re-obfuscates text while props.update is true. See baffle.js options.speed
obfuscatebooltrueWhen true, text is obfuscated.
updatebooltrueWhile true, obfuscated text updates every props.speed milliseconds.
revealDurationnumber1000When props.obfuscate changes from true to false and props.update is true, the duration in milliseconds over which text is revealed. See baffle.js reveal()
revealDelaynumber0When props.obfuscate changes from true to false and props.update is true, the delay before revealDuration begins. See baffle.js reveal()

Keywords

FAQs

Last updated on 09 Sep 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc