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

1.2.3 • Public • Published

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.

Package Sidebar

Install

npm i fetchicles

Weekly Downloads

3

Version

1.2.3

License

MIT

Unpacked Size

12.5 kB

Total Files

22

Last publish

Collaborators

  • matheusdearaujo