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

@snippetify/haiti-localities

v1.1.1

Published

List of localities in Haiti

Downloads

20

Readme

Haiti localities

This module exposes a public API for Haiti's localities. You can search, filter or list localities by county, district, municipality and submunicipality.

Cette librairie expose une API publique pour les localités d'Haïti. Vous pouvez rechercher, filtrer ou lister toutes les localités par département, arrondissement, commune et section communale.

About Snippetify

Snippetify is a community snippets warehouse but also a suite of tools that allow you to exploit these snippets.

  • Save your snippets to the cloud
  • Search snippets
  • Deep searching (search for snippets all over the web)
  • Share your snippets
  • Embed snippets in your forum or blog
  • Organize your snippets with tags
  • Contribute on snippets of others
  • Enhance your snippets by receiving votes and comments
  • Make coding fun by challenging your friends
  • Work on your notoriety by publishing good snippets which will allow you to receive stars, badges and privileges

snippetify.com

Installation

Via npm:

npm install @snippetify/haiti-localities

Via yarn:

yarn add @snippetify/haiti-localities

In a browser via a script tag:

<script src="haiti-localities.js"></script>

CommonJS module require:

const haitiLocalities = require("@snippetify/haiti-localities")

ES2015 module import:

import haitiLocalities from "@snippetify/haiti-localities"

AMD module require:

require(['haitiLocalities'], function (haitiLocalities) {
  // ...
});

API

haitiLocalities.getCounties()

Return an array of counties(départements)

const items = haitiLocalities.getCounties()
console.log(JSON.stringify(items))
// [
//     {
//         "map_id": 1,
//         "area": 4987,
//         "density": 350,
//         "region": "Centre",
//         "name": "Artibonite",
//         "capital": "Gonaïves",
//         "population": 1727524
//     },
//     {
//         "map_id": 2,
//         "area": 3487,
//         "density": 210,
//         "region": "Centre",
//         "name": "Centre",
//         "capital": "Hinche",
//         "population": 746236
//     },
//     ...
// ]

haitiLocalities.getDistricts()

Return an array of districts(arrondissements)

const items = haitiLocalities.getDistricts()
console.log(JSON.stringify(items))
// [
//     { county: 'Artibonite', name: 'Dessalines', aliases: [] },
//     { county: 'Artibonite', name: 'Gonaïves', aliases: [] },
//     { county: 'Artibonite', name: 'Gros Morne', aliases: [] },
//     ...
// ]

haitiLocalities.getDistrictsByCounty(string)

Return an array of districts(arrondissements) for a county.

haitiLocalities.getMunicipalities()

Return an array of municipalities(communes)

const items = haitiLocalities.getMunicipalities()
console.log(JSON.stringify(items))
// [
//     {
//         county: 'Ouest',
//         district: 'Arcahaie',
//         name: 'Arcahaie',
//         aliases: []
//       },
//       {
//         county: 'Ouest',
//         district: 'Arcahaie',
//         name: 'Cabaret',
//         aliases: []
//       },
//     ...
// ]

haitiLocalities.getMunicipalitiesByDistrict(string)

Return an array of municipalities(communes) for a district.

haitiLocalities.getMunicipalitiesByCounty(string)

Return an array of municipalities(communes) for a county.

haitiLocalities.getSubMunicipalities()

Return an array of submunicipalities(sections communales)

const items = haitiLocalities.getSubMunicipalities()
console.log(JSON.stringify(items))
// [
//     {
//         county: 'Centre',
//         district: 'Mirebalais',
//         municipality: "Saut d'Eau",
//         name: 'Montagne Terrible',
//         aliases: [],
//         postal_code: 'HT0000'
//       },
//       {
//         county: "Grand'Anse",
//         district: "Anse d'Hainault",
//         municipality: "Anse d'Hainault",
//         name: 'Grandoit',
//         aliases: [],
//         postal_code: 'HT0000'
//       },
//     ...
// ]

haitiLocalities.getSubMunicipalitiesByMunicipality(string)

Return an array of submunicipalities(sections communales) for a municipality.

haitiLocalities.getSubMunicipalitiesByDistrict(string)

Return an array of submunicipalities(sections communales) for a district.

haitiLocalities.getSubMunicipalitiesByCounty(string)

Return an array of submunicipalities(sections communales) for a county.

haitiLocalities.find(string)

Return any county, district, municipality or submunicipality that matches the string.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

npm test

Contributing

Please see CONTRIBUTING for details.

Credits

  1. Evens Pierre

License

The MIT License (MIT). Please see License File for more information.