react-xash

1.0.9 • Public • Published

React-xash

React Utility for adding hash into your text to protect your content.

yarn add react-xash

You see Hello world You copy it H7ezl7l3o5 wwcohrel4dq

Screenshot

Demo - https://gigantz.github.io/react-xash/

Try out - https://codesandbox.io/s/j75ynj9q49

Import it

import Xash from 'react-xash';
const xash = new Xash();

Use it

const anytext = 'Hello world';
 
return (
    <div>{xash.from(anytext)}</div>
);

Options

const xash = new Xash({
    elementTypes: ['a','td', ...] // elements to use in xashing
    robots: '(googlebot|scraper| ....)' // return plain text if bot indexing it
    userAgent: req.headers['user-agent'] // if you use server side rendering set it
});

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i react-xash

      Weekly Downloads

      1

      Version

      1.0.9

      License

      ISC

      Unpacked Size

      301 kB

      Total Files

      4

      Last publish

      Collaborators

      • gigantz