Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

skaleb-ipstack-client

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skaleb-ipstack-client

A client for the IP Stack API

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 15 Jan 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc