Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@reuters-graphics/graphics-atlas-client
Advanced tools
[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fgraphics-atlas-client.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fgraphics-atlas-client)
Global country metadata client, based on the International Organization for Standardization 3166 Country Codes. Includes translations for country and UN region names in German, French, Italian, Spanish, Portuguese, Japanese, Chinese and Persian/Fārsī.
Also includes a complete repository of topojson files for countries and UN regions and sub-regions.
$ yarn add @reuters-graphics/graphics-atlas-client
import AtlasMetadataClient from '@reuters-graphics/graphics-atlas-client';
const client = new AtlasMetadataClient();
client.regions;
// [
// {
// name: 'Asia',
// slug: 'asia',
// translations: {
// de: 'Asien',
// en: 'Asia',
// ...
// },
// subregions: [{}, {}],
// countries: [{}, {}],
// }
// ...
// ]
client.getRegion('Northern America'); // Region name or slug
client.getRegionSlug('Northern America');
// 'northern-america'
client.getRegionName('northern-america');
// 'Northern America'
client.getRegionByCountry('China'); // Country name, slug or code
// {
// name: 'Asia',
// slug: 'asia',
// translations: {},
// subregions: [{}, {}],
// countries: [{}, {}],
// }
client.subregions;
// [
// {
// name: 'Middle Africa',
// slug: 'middle-africa',
// region: {},
// countries: [{}, {}],
// }
// ...
// ]
client.getSubregionSlug('Middle Africa');
// 'middle-africa'
client.getSubregionName('middle-africa');
// 'Middle Africa'
client.getSubregionByCountry('DE');
// {
// name: 'Western Europe',
// slug: 'western-europe',
// region: {},
// countries: [{}, {}],
// }
client.countries;
// [
// {
// name: 'United Kingdom',
// slug: 'united-kingdom',
// isoAlpha2: 'GB',
// isoAlpha3: 'GBR',
// isoNumeric: '826',
// translations: {
// de: 'Vereinigtes Königreich',
// en: 'United Kingdom',
// ...
// },
// abbreviations: {
// en: 'U.K.',
// },
// dataProfile: {
// population: {},
// },
// region: {},
// subregion: {},
// }
// ...
// ]
client.getCountry('GB') // Country name, slug or code
// {
// name: 'United Kingdom',
// slug: 'united-kingdom',
// isoAlpha2: 'GB',
// isoAlpha3: 'GBR',
// isoNumeric: '826',
// translations: {
// de: 'Vereinigtes Königreich',
// en: 'United Kingdom',
// ...
// },
// abbreviations: {
// en: 'U.K.',
// },
// region: {},
// subregion: {},
// }
client.getCountriesByRegion('Asia');
client.getCountriesBySubregion('Western Europe');
client.getCountrySlug('Ireland'); // Country name or code
// 'ireland'
client.getCountryName('IRL'); // Country slug or code
// 'Ireland'
Note: Metadata does not include countries which are not assigned a code by the International Organization for Standardization. These include:
// Use a country's ISO alpha 2 code
// Germany
import topology from '@reuters-graphics/graphics-atlas-client/topojson/DE.json';
// Use a UN region or sub-region's slug to get a collection of countries
// Africa
import topology from '@reuters-graphics/graphics-atlas-client/topojson/africa.json';
// Central America
import topology from '@reuters-graphics/graphics-atlas-client/topojson/central-america.json';
// World includes all countries and disputed boundaries
import topology from '@reuters-graphics/graphics-atlas-client/topojson/world.json';
import AtlasMetadataClient from '@reuters-graphics/graphics-atlas-client';
const client = new AtlasMetadataClient();
// Use a country's name, slug or ISO code
client.fetchCountryTopojson('germany')
.then((topojson) => { ... });
// Use a UN region or sub-region's name or slug to get a collection of countries
client.fetchRegionTopojson('Africa')
.then((topojson) => { ... });
// Get the world topojson
client.fetchGlobalTopojson()
.then((topojson) => { ... });
fetch('https://cdn.jsdelivr.net/npm/@reuters-graphics/graphics-atlas-client@latest/topojson/world.json')
.then(res => res.json())
.then((topology) => {
console.log(topology);
});
$ yarn build:metadata
$ yarn build
$ yarn build:maps
$ yarn build:maps:custom
Centroids for each country are automatically calculated and added to the properties of each country's topojson. You can override the default calculation by adding a custom centroid to the data/custom_centroids.csv
file and rebuilding the maps.
FAQs
[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fgraphics-atlas-client.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fgraphics-atlas-client)
We found that @reuters-graphics/graphics-atlas-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.