1.0.6 • Published 4 years ago

un-sdgs v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

United Nations - Sustainable Development Goals

Library by Nestor Bonilla

This project is a library that contains a set of data related to the Sustainable Development Goals of United Nations, ready to be consumed by your application. The properties each goal contains are: number, hexadecimal color, name, and image in vector format for english and spanish languages.

Prerequisites

To make use of the library United Nations - Sustainable Development Goals you will need the following:

Installation

To install the library you will need to run the following command:

npm install un-sdgs

Usage

require { Sdgs } from "un-sdgs";

let sdgs = Sdgs.list('eng', 'color');
let sdg = Sdgs.get('eng', 'color', 1);

Methods

list(language:String, color: String)

Get a list of the 17 Sustainable Development Goals, where each one will have the following structure:

...
let language = 'eng';   // 'eng', 'spa'
let color = 'color';    // 'color', 'white'

let sdgs = Sdgs.list(language, color);

sdgs = [
    {
        id: 'Integer',
        number: 'Integer',
        name: 'String',
        color: 'String - hexadecimal code',
        vector: 'String - scalable vector graphic'
    },...
];
...
get(language:String, color: String, number: Integer)

Get an object of the Sustainable Development Goal asked, having the following structure:

...
let language = 'eng';   // 'eng', 'spa'
let color = 'color';    // 'color', 'white'
let number = 1;         // 1 ... 17

let sdg = Sdgs.get(language, color, number);

sdg = {
    id: 'Integer',
    number: 'Integer',
    name: 'String',
    color: 'String - hexadecimal code',
    vector: 'String - scalable vector graphic'
};
...

Conclusions

⚠️ This first release, contains the data for two languages: english and spanish. Depending on the adoption of the library more languages could be added to it. Thanks to use it.

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago