search-player
v1.3.2
Published
A simple Node.js module to search for Serie A players in a JSON file. It allows you to filter players by name, position, nationality, or team.
Readme
Players
A simple Node.js module to search for Serie A players in a JSON file. It allows you to filter players by name, position, nationality, or team.
Features
- Search players by name: Find players whose names start with a specific string (case-insensitive).
- Search players by nationality: Filter players by their country of origin.
- Search players by role: Look for players by their position or role in the team.
- Search players by team: Find all players belonging to a specific team.-
Installation
Install the package using npm:
npm install search-playerUsage
Import the package into your project:
const searchPlayer = require("search-player");
// Search players by name
const resultByName = searchPlayer("name", "Ronaldo");
console.log("Players found by name:", resultByName);
// Search players by nationality
const resultByNationality = searchPlayer("nazionality", "Italy");
console.log("Players found by nationality:", resultByNationality);
// Search for players by role
const resultByRole = searchPlayer("role", "Forward");
console.log("Players found by role:", resultByRole);
// Search players by team
const resultByTeam = searchPlayer("team", "Juventus");
console.log("Players found by team:", resultByTeam);License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
Author
Created by GioGuarna33.
