1.0.2 • Published 4 years ago

adult.js v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

adult.js

Hey, kids! You are not allowed in here!

Intro

This is a react.js component to help you detect if your user was an adult, if it is, we let them use our service, if it's not, we say no to them.

Installation

npm i adult.js

or

yarn add adult.js

Usage

import { ChildGuard } from 'adult.js'

function App() {
  return (
    <div>

      <ChildGuard
        weights_path="/weights"
        show={true}
        callback_function={(adult, age) => {
          if (adult) {
            console.log(`You are adult, your age is ${age}`)
          } else {
            console.log(`You are not adult, your age is ${age}`)
          }
        }}
      />

      <div className="App">
        Welcome!
      </div>

    </div>
  );
}

The /weights is actully in public/weights, you have to download those ML weights from here, and copy those files to your local public/weights folder.

Check the Example for more information.

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago