condos
v0.1.0
Published
Condos is a promise-based Node.js library for the Condos.ca api.
Downloads
2
Readme
Condos
Condos is a promise-based Node.js library for the Condos.ca api.
Installation
Install condos
and save to your package.json
in one easy step.
With npm:
npm install condos --save
With yarn:
yarn add condos
Documentation
You may find the Condos documentation here.
Usage
- Import Condos into your application:
import Condos from 'condos';
- Call an api method to request data:
With Promises:
import Condos, {
Precision,
GroupType,
OfferType,
NeighbourhoodTorontoDowntown,
NeighbourhoodTorontoEastEnd,
SublocalityToronto
} from 'condos';
Condos.listings({
precision: Precision.Normal,
neighbourhood: [
NeighbourhoodTorontoDowntown.KingWest,
NeighbourhoodTorontoEastEnd.EastEndDanforth,
],
sublocality: [SublocalityToronto.Etobicoke],
groupBy: GroupType.Neighbourhood,
offer: OfferType.Sale,
}).then(data => {
console.log(data);
});
With async/await:
import Condos, {
Precision,
GroupType,
OfferType,
NeighbourhoodTorontoDowntown,
NeighbourhoodTorontoEastEnd,
SublocalityToronto
} from 'condos';
(async () => {
const data = await Condos.listings({
precision: Precision.Normal,
neighbourhood: [
NeighbourhoodTorontoDowntown.KingWest,
NeighbourhoodTorontoEastEnd.EastEndDanforth,
],
sublocality: [SublocalityToronto.Etobicoke],
groupBy: GroupType.Neighbourhood,
offer: OfferType.Sale,
});
console.log(data);
})();