egoist / is-trademarked

Check if a word is trademarked.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is-trademarked NPM version NPM downloads Build Status

Check if a word is trademarked.

Install

$ npm install --save is-trademarked

Usage

const isTrademarked = require('is-trademarked')

// not trademarked yet
isTrademarked('unicorns')
  .then(trademarked => {
    console.log(trademarked) //=> false
  })

// trademarked
// return an array which contains a single item
isTrademarked('apple')
  .then(trademarks => {
    if (trademarks) {
      trademarks.forEach(t => console.log(t.wordmark))
    }
  })

// wildcard
// return an array which contains multiple items
// it searches `macbook` `macbook air` etc...
isTrademarked('mac*')
  .then(/* your code */)

API

isTrademarked(input, opts)

input

Type: string

The term to search. Support wildcard by using * symbol.

opts

Type: object

token

API token to retrieve data from markerapi.com, sign up to get one here for free.

return

[
  {
    wordmark: 'NAME',
    reg: Tue May 20 2008 00:00:00 GMT+0800 (CST),
    description: 'General feature magazines',
    sn: '77119087',
    serviceCode: 'GS0161'
  }
]

Or return false when it's not trademarked.

Related

License

MIT © EGOIST

About

Check if a word is trademarked.

License:MIT License


Languages

Language:JavaScript 100.0%