npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

greip.js

v2.4.9

Published

The official Javascript library of Greip.

Readme

Greip Javascript Package

The official Javascript package of Greip API

Report Issue · Request Feature · Greip Website · Documentation

NPM Package of Greip Github Repository jsDelivery CDN Link

npm version    GitHub code size in bytes    License: Apache 2.0    API Status


Installation

You can install the Greip JavaScript package using npm, yarn, or via CDN.

Using npm

npm install greip.js --save

Using yarn

yarn add greip.js

CDN Integration

Add the following script tag to your HTML file:

<script src="https://cdn.jsdelivr.net/gh/Greipio/javascript/greip.bundle.js" type="text/javascript"></script>

Note: For Node.js environments, please use our Node.js library.


Getting Started

Importing Greip Methods

For React.js, React Native, etc.

import {
  Lookup,
  Threats,
  GeoIP,
  BulkLookup,
  ASN,
  BadWord,
  Country,
  EmailValidation,
  PhoneValidation,
  PaymentFraud,
  IBANValidation,
} from 'greip.js';

For CDN Integration

The Greip object is available globally. You can use its methods directly:

Greip.GeoIP({
  key: 'your-api-key',
  // other options
}).then((response) => {
  console.log(response);
});

Usage Examples

Below are examples for each available method. All methods return Promises.

1. IP Geolocation

Options:

| Option | Type | Required | Description | | ------ | -------- | -------- | ----------------------------------------------------------------- | | key | string | Yes | Your API key | | params | string[] | No | Modules: location, security, timezone, currency, device | | format | string | No | Response format: JSON, XML, CSV, Newline | | lang | string | No | Language: EN, AR, DE, FR, ES, JA, ZH, RU | | mode | string | No | live (default) or test |

await GeoIP({ key: 'your-api-key' })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

2. IP Threats

Options:

| Option | Type | Required | Description | | ------ | ------ | -------- | ------------------------------------------------ | | key | string | Yes | Your API key | | ip | string | Yes | IP address to check | | format | string | No | Response format: JSON, XML, CSV, Newline | | mode | string | No | live (default) or test |

await Threats({ key: 'your-api-key', ip: '1.1.1.1' })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

3. IP Lookup

Options:

| Option | Type | Required | Description | | ------ | -------- | -------- | ----------------------------------------------------------------- | | key | string | Yes | Your API key | | ip | string | Yes | IP address to lookup | | params | string[] | No | Modules: location, security, timezone, currency, device | | format | string | No | Response format: JSON, XML, CSV, Newline | | lang | string | No | Language: EN, AR, DE, FR, ES, JA, ZH, RU | | mode | string | No | live (default) or test |

await Lookup({ key: 'your-api-key', ip: '1.1.1.1' })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

4. Bulk IP Lookup

Options:

| Option | Type | Required | Description | | ------ | -------- | -------- | ----------------------------------------------------------------- | | key | string | Yes | Your API key | | ips | string[] | Yes | Array of IP addresses | | params | string[] | No | Modules: location, security, timezone, currency, device | | format | string | No | Response format: JSON, XML, CSV, Newline | | lang | string | No | Language: EN, AR, DE, FR, ES, JA, ZH, RU | | mode | string | No | live (default) or test |

await BulkLookup({ key: 'your-api-key', ips: ['1.1.1.1', '2.2.2.2'] })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

5. ASN Lookup

Options:

| Option | Type | Required | Description | | ------ | ------ | -------- | -------------------------- | | key | string | Yes | Your API key | | asn | string | Yes | ASN to lookup | | mode | string | No | live (default) or test |

await ASN({ key: 'your-api-key', asn: 'AS01' })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

6. Profanity Detection

Options:

| Option | Type | Required | Description | | ------ | -------- | -------- | -------------------------------------------------------- | | key | string | Yes | Your API key | | text | string | Yes | Text to check | | params | string[] | No | Additional params (see docs) | | format | string | No | Response format: JSON, XML, CSV | | lang | string | No | Language: EN, AR, DE, FR, ES, JA, ZH, RU | | mode | string | No | live (default) or test |

await BadWord({ key: 'your-api-key', text: 'Sample text.' })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

7. Country Lookup

Options:

| Option | Type | Required | Description | | ----------- | -------- | -------- | -------------------------------------------------------- | | key | string | Yes | Your API key | | countryCode | string | Yes | ISO 3166-1 alpha-2 country code | | params | string[] | No | Modules: language, flag, currency, timezone | | format | string | No | Response format: JSON, XML, CSV, Newline | | lang | string | No | Language: EN, AR, DE, FR, ES, JA, ZH, RU | | mode | string | No | live (default) or test |

await Country({ key: 'your-api-key', countryCode: 'SA' })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

8. Email Validation

Options:

| Option | Type | Required | Description | | ------ | ------ | -------- | -------------------------- | | key | string | Yes | Your API key | | email | string | Yes | Email to validate | | mode | string | No | live (default) or test |

await EmailValidation({ key: 'your-api-key', email: '[email protected]' })
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

9. Phone Validation

Options:

| Option | Type | Required | Description | | ----------- | ------ | -------- | -------------------------- | | key | string | Yes | Your API key | | phone | string | Yes | Phone number | | countryCode | string | Yes | Country code (ISO) | | mode | string | No | live (default) or test |

await PhoneValidation({
  key: 'your-api-key',
  phone: '123123123',
  countryCode: 'US',
})
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

10. Payment Fraud Prevention

Options:

| Option | Type | Required | Description | | ------ | ------ | -------- | ----------------------------------------------------------------------------------------------------------------- | | key | string | Yes | Your API key | | data | object | Yes | Transaction data (see all fields) | | mode | string | No | live (default) or test |

await PaymentFraud({
  key: 'your-api-key',
  data: {
    // ...transaction and customer details...
  },
})
  .then((res) => console.log(res.data))
  .catch((error) => console.error(error));

11. IBAN Validation

Options:

| Option | Type | Required | Description | | ------ | ------ | -------- | -------------------------- | | key | string | Yes | Your API key | | iban | string | Yes | IBAN to validate | | mode | string | No | live (default) or test |

await IBANValidation({ key: 'your-api-key', iban: 'BY86AKBB10100000002966000000' })
  .then((res) => console.log(res))
  .catch((error) => console.error(error));

Documentation

For detailed documentation, options, and advanced usage, please visit our official documentation.


Credits


Repository Activity

Alt