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

baffle-react

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

baffle-react

Text obfuscation via Baffle, as a React component

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 09 Sep 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