favelas
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

FAVELAS

The most complete list of all favelas of brazil by states

USAGE

import Favelas from "favelas";

// the constructor is set to default to state ='rj' (Rio de Janeiro)
const favelas = new Favelas();

favelas.getAll();
/**
[
    {
    id: 1,
    name: 'Metral',
    complex: 'Vila Kennedy',
    zone: 'oeste',
    neighborhoods: 'Bangu'
    },
    {...}
]
**/

TYPES

type Favela = {
  id: number,
  name: string,
  complex: string,
  zone: Zone,
  neighborhoods: string,
};

type State = "rj" | "sp";

type Zone = "sul" | "oeste" | "central" | "norte";

API

getAll(): Favela[]

Returns all favelas - full info

getById(favelaId: number): Favela

Returns a favela by the favelaId

getByName(name: string): Favela[]

A list of all favelas that match the name.

getAllNames(): string[]

The Name of all favelas

getFavelasByComplex(complex: string): Favela[]

Returns all favelas that are part of the complex matched.

getFavelasByZone(zone: Zone): Favela[]

Returns all favelas by the zone.

getByNeighborhood(neighborhood: string): Favela[]

Returns all favelas from the neighborhood passed.

total(): number

Return the amount of favelas in that state.

Package Sidebar

Install

npm i favelas

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

199 kB

Total Files

8

Last publish

Collaborators

  • codedavinci