Catalog npm
Back to packageRELEASE DETAILS

1.0.11

npm

7x-sdk

The 7x JavaScript SDK

Published29 May 2023
Direct dependencies4
Transitive dependenciesNot calculated

README

Current package documentation

A JavaScript SDK for 7x APIs

To use this SDK, you will need an API Key. Sign up on https://7x.ax to get started.

Install

npm i 7x-sdk

Usage

Timezone API

const Timezone = require('7x-sdk').Timezone;

let tz = new Timezone(API_KEY);
let data = tz.get(30.0444, 31.2357);
// data is an instance of the Timezone DTO
console.log(data.timezones);

Distance API

Distance by Coordinates

const Distance = require('7x-sdk').Distance;

let d = new Distance(API_KEY);
let data = d.getByCoordinates(22.22, 33.33, 44.44, 55.55, 'km');
// data is an instance of the Distance DTO.
data.distance;
data.unit; // km if you specified km, or mi if you specified mi. Defaults to km if not specified.

Distance by Address

const Distance = require('7x-sdk').Distance;

let d = new Distance(API_KEY);
let data = d.getByAddress('London, UK', 'Paris, France', 'km');
// data is an instance of the Distance DTO.
$data.distance;
$data.unit; // km if you specified km, or mi if you specified mi. Defaults to km if not specified.

Geocoding API

Geocode by City / Address String

const Geocode = require('7x-sdk').Geocode;

let g = new Geocode(API_KEY);
let data = g.get('Trafalgar Square, London, UK');
// data is an instance of GeocodeCollection. This contains an array of objects.
for (let obj of data.objects) {
    obj.coordinates; // Instance of Coordinates
    obj.location; // Instance of Location}
}

Geocode Search (to build search suggest / autocomplete functionality)

const Geocode = require('7x-sdk').Geocode;

let g = new Geocode(API_KEY);
let data = g.search('Lon');
// data is an instance of the GeocodeCollection DTO. This contains an array of objects.
for (let obj of data.objects) {
    obj.coordinates; // Instance of Coordinates
    obj.location; // Instance of Location
}

Reverse Geocoding by Coordinates

const Geocode = require('7x-sdk').Geocode;

let g = new Geocode(API_KEY);
let data = g.reverse(22.223232, 33.343443);
// data is an instance of the GeocodeCollection DTO. This contains an array of objects.
for (let obj of data.objects) {
    obj.coordinates; // Instance of Coordinates
    obj.location; // Instance of Location
}

Numbers

const Numbers = require('7x-sdk').Numbers;

let g = new Numbers(API_KEY);
let data = g.latinToArabic(22.223232);
// data is an instance of the Arabic DTO. This contains an array of objects.
data.arabic;
data.latin

let data = g.arabicToLatin('١٢٣٤٥٦٧٨٩٠');
// data is an instance of the Arabic DTO. This contains an array of objects.
data.arabic;
data.html

let data = g.arabicToHtml('١٢٣٤٥٦٧٨٩٠');
// data is an instance of the Arabic DTO. This contains an array of objects.
data.arabic;
data.html

Date and Time

const Dt = require('7x-sdk').DateAndTime;

let g = new Dt(API_KEY);
let data = g.byTimezone('Africa/Cairo');
// or 
let data = g.byCoordinates(22.223232, 33.343443);
// or
let data = g.byAddress('Trafalgar Square, London, UK');
// data is an instance of the DateAndTime DTO.
data.time;
data.timezone;

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 4

Native requirements
4 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^29.5.1development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^29.5.0development
ts-jest
Environment
{
  "local_name": "ts-jest",
  "alias": false,
  "peer_metadata": null
}
^29.1.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.0.4development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-ndNy1gZHnUS1LPbGX/I32Sltz8IqV4mm/+GpFOieDA5V6uAQ75ky+tUfx1r8o3u8jcEMu4CwGGay7g2PP22mRQ==",
  "shasum": "da36986dda2a259102dd43585583d66f6a44e046",
  "tarball": "https://registry.npmjs.org/7x-sdk/-/7x-sdk-1.0.11.tgz",
  "fileCount": 45,
  "unpackedSize": 31071,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCRNJ3Ji+P4atmMe5HZvLSlUBO7QaC4J3+6VmLqx7omvAIhAN4Hdw/zY0Nzo+OY3gywxEfb+0BfHfwjjzre6LvBtEiY"
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:13 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:9af7e95edb298e5682adb9bbecee6ec6e9e087f1474004eee328b83fc5f9dfed

Other collected versions

1.0.1420 Jul1.0.1320 Jul1.0.1212 Jun1.0.1029 May1.0.929 May1.0.829 MayView all collected versions →