0.0.4 • Published 5 years ago

third-party-decode v0.0.4

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

Unmaintained

I would recommend using the third-party-web NPM module. It's straightforward to use and easy to contribute back to.

Cheers.


third-party-decode Build Status NPM third-party-decode package

Why?

Because you want to decode URLs to figure out what 3rd party they are. The data comes from the Chrome DevTools 3rd Party Badges.

Usage

const decode3P = require('third-party-decode');

const entry = decode3P('http://cdn.krxd.net');
console.log(entry.name); // 'Krux Digital, Inc.'
console.log(entry.type); // 'analytics'

Install

$ npm install third-party-decode

API

decode3P(url: string)

  • Returns null if no third party entry found
  • Otherwise returns {{name: string, type: string}}

CLI

You can also run this from the command line. It will emit the JSON results to stdout.

node index.js "http://cdn.krxd.net"
# {
#   "name": "Krux Digital, Inc.",
#   "type": "analytics"
# }

External

Visit https://third-party-decode.glitch.me/ to view the results in your browser. You can also send a request to https://third-party-decode.glitch.me/badge?url=https://cdn.krxd.net which returns results in JSON format as follows:

{
    "name": "Krux Digital, Inc.",
    "type": "analytics",
    "badge": "KD"
}

License

MIT © Paul Irish

0.0.4

5 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago