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

guinea-subdivision

v1.1.3

Published

Des subdivision fiables pour la prise de décisions de la Guinée

Downloads

22

Readme

guinea-subdivision

This package give you all guinea administrative subdivision. by regions, prefectures, sous-prefectures.

Installation

With yarn:

$ yarn add guinea-subdivision --save

With npm:

$ npm i guinea-subdivision --save
Functions:

here are all the functions, that you can import and use some of them return and array and some of them retourn a json object

| Function | Explaination | Return Type | | -----------------------------------------------|------------------------------------------------------ |--------------| | getRegionsAndCodes() | return all regions and their codes | Json | | getRegions() | return the list of the regions (names only) | Array | | getRegionsCodes() | return the regions codes only | Array | | getRegionNameByCode() | you give it a region code and it return you the name | String | | getRegionCodeByName() | you give it a region name and it return you the code | String | | ----------------------- | -------------------------------------------- | ------- | | getPrefecturesAndCodes() | return all prefectures and their codes | Json | | getPrefecturesCodes() | return the prefecutres codes only | Array | | getPrefectures() | return the list of the prefecutres | Array | | getPrefecturesAndCodesByRegionCode() | return all prefectures and thier code by it region code| Json | | getPrefecturesByRegionCode() | return all prefectures by it region code | Array | | getPrefecturesByRegionName() | return all prefectures by it region name | Array | | getPrefectureNameByCode() | you give it a prefecture code and it give you the name | String | | getPrefectureCodeByName() | you give it a prefecture anme and it give you the code | String | | ------------------------ | ----------------------------------------- | ------- | | getSousprefecturesAndCodes() | return all sousprefectures and their codes | Json | | getSousprefecturesCodes() | return all sousprefectures codes | Array | | getSousprefectures() | return all sousprefectures codes | Array | | getSousprefecturesAndCodesByPrefectureCode() | it return all sous prefectures and their codes based on a given prefecture code |json| | getSousprefecturesAndCodesByPrefectureName() |it return all sous prefectures and their codes based on a given prefecture name| Json | | getSousprefecturesByPrefectureCode() | it return all sous prefectures based on a given prefecture code| Array | | getSousprefecturesByPrefectureName() | it return all sous prefectures based on a given prefecture name| Array | | getSousprefectureNameByCode() | you give it a sousprefecture code and it give you the name | String | | getSousprefectureCodeByName() | you give it a sousprefecture name and it give you the code | String |

Usage

If you have successfully installed this package and you're ready to use it, first import the functions you need based on the top table like this:

import { getRegions, getPrefecturesCodes, getSousprefecturesByPrefectureCode } from 'guinea-subdivision';

// then call them like
console.log(getRegions())
console.log(getPrefecturesCodes())
console.log(getSousprefecturesByPrefectureCode(getPrefecturesCodes()[3]))

Developpers Section

If you wan to help improving this package, or you want to fix a bug founded bug or anything else like documentation, etc.. You are welcome, we hope that you will make this package very usefull to some other people. then go ahead an make a PR.

The code

The code is writen in ES6 (es2015) and compiled with babel, packaged (minified) under webpack 4 (see package.json file)

  • First of all, you need to install dependancies (including devDepenancies)
  • go to src/index.js, this is where all the logic function are
  • go to src/data/ to update the subdivision data

Building

If you have done a changes and you want to build, just run the following command

Test build

To build a test version (not minified) run the following command

npm run dev

Prod build

To build a minified version for production use, run the following command

npm run prod

Runing the test suite

To run the test suite make sure first you've :

  • 1 - ran the dev build command
  • 2 - ran the prod build thos are needed to minify administrative json files that are used in the dist/index.js note: the test suite are made on dist/index.js

then run the following command npm run test

A bug on UMD (Universal Module Definition)

A Tuto can be found here

After a build including the UMD extension, i notice that there is a bug on compiled version located at './dist/index.js' the variable global on a dev build (Line 10) or a prod build (Line 3) that variable should be replace by this reserved word.

// this is a dev build
// replace this line
})(global, function() {

// by the following
})(this, function() {

Then go ahead and make your PR

Data source: www.stat-guinee.org guinee-decouverte.com