Skip to content

A lib created to return all brands and models of vehicles in the world.

License

Notifications You must be signed in to change notification settings

mxtheussouza/fetchicles

Repository files navigation

Fetchicles

A lib created to return all brands and models of vehicles in the world.

Installing

npm

npm install --save fetchicles

yarn

yarn add fetchicles

Getting started

Retrieving all vehicle brands (example: CAR):

import { brands } from "fetchicles";

// Using the then method
brands("CAR").then(data => console.log(data));
import { brands } from "fetchicles";

// Using await inside an immediately invoked function
(async () => {
	const carBrands = await brands("CAR");
	console.log(carBrands);
})();

return:

[
	"Ford",
	"Chevrolet",
	"Fiat",
	"Citroen",
	"Honda",
	"Hyundai",
	"Renault",
	"Toyota",
	"Volkswagen",
]

Retrieving all vehicle models by brands (example: CAR):

And now, inside params it will be an object, with first parameter a vehicle name, as string, and second parameter a brand name as string.

import { models } from "fetchicles";

// Using the then method
models({ vehicle: "CAR", brand: "fiat" }).then(data => console.log(data));
import { models } from "fetchicles";

// Using await inside an immediately invoked function
(async () => {
	const carModels = await models({ vehicle: "CAR", brand: "fiat" });
	console.log(carModels);
})();

return:

[
    "Uno",
    "Doblo",
    "Pulse",
    "Argo",
    "Strada",
    "Cronos",
    "Mobi"
]

This will be standard for all vehicles (vehicle names must be uppercase).

Vehicles types available:

  • CAR
  • MOTORCYCLE

How to contribute

Read our contribution guide.

Contributors

Author


@mxtheussouza

LICENSE

This repository use MIT License.

About

A lib created to return all brands and models of vehicles in the world.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published