matheusdearaujo / fetchicles

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

Home Page:https://www.npmjs.com/package/fetchicles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


@matheusdearaujo

LICENSE

This repository use MIT License.

About

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

https://www.npmjs.com/package/fetchicles

License:MIT License


Languages

Language:TypeScript 91.5%Language:Shell 8.5%