npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@digitalbonds/un-sdgs

v1.0.0

Published

Library that contains a set of data related to the Sustainable Development Goals of United Nations.

Downloads

89

Readme

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 @digitalbonds/un-sdgs

If you want to make use of the json image of each goal, you will need to install a Lottie library. If you're using React you can use:

npm install react-lottie

Usage

import Sdgs from '@digitalbonds/un-sdgs';

let sdgs = Sdgs.listGoals('eng', 'color');
let sdg = Sdgs.getGoal('eng', 'color', 1);

Methods

listGoals(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.listGoals(language, color);

sdgs = [
    {
        id: 'Integer',
        number: 'Integer',
        name: 'String',
        color: 'String - hexadecimal code',
        json: 'lottie options'
    },...
];
...
getGoal(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',
    json: 'lottie options'
};
...

Using react-lottie

For use the Sustainable Development Goals icons using react-lottie, you can do it easy:

...
import Lottie from 'react-lottie';
import { listGoals, getGoal } from '@digitalbonds/un-sdgs';
...

let language = 'eng';   // 'eng', 'spa'
let color = 'color';    // 'color', 'white'
let number = 1;         // 1 ... 17
let height = '100px'    // desired height in px or %

render() {
    return(
        <Lottie
            options={getGoal(language, color, number)}
            height={height}
        />
    )
}

Conclusions

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