Socket
Socket
Sign inDemoInstall

skaleb-ipstack-client

Package Overview
Dependencies
5
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    skaleb-ipstack-client

A client for the IP Stack API


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
450 kB
Created
Weekly downloads
 

Readme

Source

IP Stack API Client

Build Status Quality Gate Status Bugs Code Smells Coverage

ipstack offers a powerful, real-time IP to geolocation API capable of looking up accurate location data and assessing security threats originating from risky IP addresses. Results are delivered within milliseconds in JSON format. Using the ipstack API you will be able to locate website visitors at first glance and adjust your user experience and application accordingly.

Installation

You can install this package via npm

$ npm install skaleb-ipstack-client

Usage

Getting the geolocation based on a single IP address.

import { 
  Geolocation,
  IPStackClient, 
  InvalidAccessKeyError,
  IPStackClientConfiguration
} from 'ipstack-client'

const ipAddress = '41.121.45.123'
const configuration: IPStackClientConfiguration = {
  token: 'some-token',
  timeout: 1000
}

const client = new IPStackClient(configuration)

// Getting the ISO country code for an IP address
client.getLocation(ipAddress)
    .then((response: Geolocation) => {
      console.log(response.getRawLocationData())
    })
    .catch((invalidAccess: InvalidAccessKeyError) => {
      console.log(invalidAccess.message)
    })

Testing

This project is mostly covered by unit tests. Various cases have been accounted for both in the codebase and in the tests covering it. If a bug is picked up regarding the test suite or code, feel free to make a contribution to help correct the bug.

To run the tests, you can simply run the following test command/s.

npm run test
npm run coverage

Upcoming

Still working on the multiple addresses and selected fields.

Contribution

Feedback and contributions are more than welcome. Should you feel there is something you wish to contribute to this project, feel free to make a merge request. Ensure that whatever proposed change, has tests covering various cases for the change and if required, update all relevant documentation.

Keywords

FAQs

Last updated on 15 Jan 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc