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

@ideal-postcodes/core-axios

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ideal-postcodes/core-axios

Axios based client for api.ideal-postcodes.co.uk

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8K
increased by9.11%
Maintainers
1
Weekly downloads
 
Created
Source

Ideal Postcodes Axios

Axios backed JavaScript client for api.ideal-postcodes.co.uk

CircleCI codecov Dependency Status npm version install size Release

@ideal-postcodes/core-axios is the Axios backed client for api.ideal-postcodes.co.uk. Axios is a promise based HTTP client for the browser and node.js

Our JavaScript client implements a common interface defined at @ideal-postcodes/core-interface.

High level client documentation can be found at core-interface.

In depth client documentation can be found at core-interface.ideal-postcodes.dev.

Other JavaScript Clients

Documentation

Configuration & Usage

Install
npm install @ideal-postcodes/core-axios
Instantiate
const { Client } = require("@ideal-postcodes/core-axios");

// or, if applicable,
import { Client } from "@ideal-postcodes/core-axios"

const client = new Client({ api_key: "iddqd" });

Configuration options

Use
const addresses = await client.lookupPostcode({ postcode: "SW1A2AA" });
Catch Errors
const { IdpcRequestFailedError } = Client.errors;

try {
  await client.lookupAddress({ query: "10 downing street" });
} catch (error) {
  if (error instanceof IdpcRequestFailedError) {
    // IdpcRequestFailedError indicates a 402 response code
    // Possibly the key balance has been depleted
  }
}

Test

npm test

Licence

MIT

Keywords

FAQs

Package last updated on 22 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