fetchicles
v1.2.3
Published
A lib created to return all brands and models of vehicles in the world.
Maintainers
Readme
Installing
npm
npm install --save fetchiclesyarn
yarn add fetchiclesGetting 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
| @matheusdearaujo | | :-----------------------------------------------------------------------------------------------------------------------------------------: |
LICENSE
This repository use MIT License.
