f1-api-node
Advanced tools
Comparing version 0.3.1 to 0.3.2
import { isDriver } from "../types/types"; | ||
export declare const getDriverLineups: () => Promise<isDriver[]>; | ||
export declare const getDriverLineup: () => Promise<isDriver[]>; |
@@ -15,7 +15,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDriverLineups = void 0; | ||
exports.getDriverLineup = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
const cheerio_1 = __importDefault(require("cheerio")); | ||
const endpoints_1 = require("../endpoints/endpoints"); | ||
const getDriverLineups = () => __awaiter(void 0, void 0, void 0, function* () { | ||
const getDriverLineup = () => __awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
@@ -54,3 +54,3 @@ let drivers = []; | ||
}); | ||
exports.getDriverLineups = getDriverLineups; | ||
exports.getDriverLineup = getDriverLineup; | ||
//# sourceMappingURL=driver-lineup.js.map |
import { isTeam } from "../types/types"; | ||
export declare const getTeamLineups: () => Promise<isTeam[]>; | ||
export declare const getTeamLineup: () => Promise<isTeam[]>; |
@@ -15,7 +15,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTeamLineups = void 0; | ||
exports.getTeamLineup = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
const cheerio_1 = __importDefault(require("cheerio")); | ||
const endpoints_1 = require("../endpoints/endpoints"); | ||
const getTeamLineups = () => __awaiter(void 0, void 0, void 0, function* () { | ||
const getTeamLineup = () => __awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
@@ -55,3 +55,3 @@ let teams = []; | ||
}); | ||
exports.getTeamLineups = getTeamLineups; | ||
exports.getTeamLineup = getTeamLineup; | ||
//# sourceMappingURL=team-lineup.js.map |
@@ -1,3 +0,3 @@ | ||
export { getDriverLineups } from "./scraper/driver-lineup"; | ||
export { getTeamLineups } from "./scraper/team-lineup"; | ||
export { getDriverLineup } from "./scraper/driver-lineup"; | ||
export { getTeamLineup } from "./scraper/team-lineup"; | ||
export { getDriverStandings } from "./scraper/driver-standings"; | ||
@@ -4,0 +4,0 @@ export { getConstructorStandings } from "./scraper/constructors-standings"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getRaceResults = exports.getWorldChampions = exports.getConstructorStandings = exports.getDriverStandings = exports.getTeamLineups = exports.getDriverLineups = void 0; | ||
exports.getRaceResults = exports.getWorldChampions = exports.getConstructorStandings = exports.getDriverStandings = exports.getTeamLineup = exports.getDriverLineup = void 0; | ||
var driver_lineup_1 = require("./scraper/driver-lineup"); | ||
Object.defineProperty(exports, "getDriverLineups", { enumerable: true, get: function () { return driver_lineup_1.getDriverLineups; } }); | ||
Object.defineProperty(exports, "getDriverLineup", { enumerable: true, get: function () { return driver_lineup_1.getDriverLineup; } }); | ||
var team_lineup_1 = require("./scraper/team-lineup"); | ||
Object.defineProperty(exports, "getTeamLineups", { enumerable: true, get: function () { return team_lineup_1.getTeamLineups; } }); | ||
Object.defineProperty(exports, "getTeamLineup", { enumerable: true, get: function () { return team_lineup_1.getTeamLineup; } }); | ||
var driver_standings_1 = require("./scraper/driver-standings"); | ||
@@ -9,0 +9,0 @@ Object.defineProperty(exports, "getDriverStandings", { enumerable: true, get: function () { return driver_standings_1.getDriverStandings; } }); |
{ | ||
"name": "f1-api-node", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "A simple library written in typescript to fetch Formula-1 data", | ||
@@ -5,0 +5,0 @@ "main": "dist/server.js", |
@@ -7,61 +7,74 @@ # Formula1 API | ||
## Installation | ||
# Installation | ||
```bash | ||
npm i f1-api-node | ||
``` | ||
## Functions | ||
# Example snippet | ||
The following function will print the current lineup of F1 drivers. | ||
- **getConstructorStandings** | ||
```javascript | ||
const f1Api = require('f1-api-node') | ||
const myFunction = async () => { | ||
const driverLineup = await f1Api.getDriverData() | ||
console.log(driverLineup) | ||
} | ||
myFunction() | ||
``` | ||
# Functions | ||
### **1. getConstructorStandings** | ||
Fetch Constructors standings from points table. | ||
The function takes one argument: The year from which you want to extract points table for. | ||
Default argument is the current year. | ||
| Description | Needs Paramter ? | Paramter Description | Default Argument | | ||
|:------------|------------------|----------------------|------------------| | ||
| Fetch Constructors standings from points table | Yes - 1 | The year from which you want to extract points table for (1950 - current) | current year | | ||
- **getDriverStandings** | ||
Fetch F1 driver standings from points table. | ||
The function takes one argument: The year from which you want to extract points table for. | ||
Default argument is the current year. | ||
### **2. getDriverStandings** | ||
- **getDriverData** | ||
Fetch the current lineup of F1 drivers. | ||
_No arguments_ | ||
| Description | Needs Paramter ? | Paramter Description | Default Argument | | ||
|:------------|------------------|----------------------|------------------| | ||
| Fetch F1 driver standings from points table | Yes - 1 | The year from which you want to extract points table for (1950 - current) | current year | | ||
- **getTeamsData** | ||
Fetch the current list of F1 teams along with their information. | ||
_No arguments_ | ||
### **3. getDriverLineup** | ||
| Description | Needs Paramter ? | Paramter Description | Default Argument | | ||
|:------------|------------------|----------------------|------------------| | ||
| Fetch the current lineup of F1 drivers | No | - | - | | ||
### **4. getTeamLineup** | ||
| Description | Needs Paramter ? | Paramter Description | Default Argument | | ||
|:------------|------------------|----------------------|------------------| | ||
| Fetch the current list of F1 teams | No | - | - | | ||
- **getWorldChampions** | ||
Fetch all the world champions | ||
_No arguments_ | ||
### **5. getWorldChampions** | ||
| Description | Needs Paramter ? | Paramter Description | Default Argument | | ||
|:------------|------------------|----------------------|------------------| | ||
| Fetch all the world champions | No | - | - | | ||
- **getRaceResults** | ||
Fetch race results for all the grand prix in a given year. | ||
The function takes one argument: The year from which you want to extract race results. | ||
## Snapshots | ||
### **6. getRaceResults** | ||
| Description | Needs Paramter ? | Paramter Description | Default Argument | | ||
|:------------|------------------|----------------------|------------------| | ||
| Fetch race results of all the grand prix in a given year | Yes - 1 | The year from which you want to extract race results (1950 - current) | - | | ||
If you want to have a look at the output from the given functions check [this](https://github.com/yashkathe/F1-API/tree/master/__tests__/__snapshots__). | ||
## Example snippet | ||
# Snapshots | ||
Example on how to use one of the given functions. | ||
The following function will print the current lineup of F1 drivers. | ||
If you want to have a look at the output from the given functions check [this](https://github.com/yashkathe/F1-API/tree/master/__tests__/__snapshots__). | ||
```javascript | ||
const f1Api = require('f1-api-node') | ||
const myFunction = async () => { | ||
const driverLineup = await f1Api.getDriverData() | ||
console.log(driverLineup) | ||
} | ||
myFunction() | ||
``` | ||
## Usage | ||
# Usage | ||
WARNING: Abusing this library may result in an IP ban from the host website. | ||
Please use with caution and try to limit the rate and amount of your requests if you value your access to formula1.com | ||
## Report Problems | ||
# Report Problems | ||
If you have any problems regarding this project, read the following [disclaimer](https://github.com/yashkathe/F1-API/blob/master/DISCLAIMER.md). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69932
79