@ashuhrai_71/city-count
v1.0.6
Published
A package to count how many people are in each city
Readme
@ashuhrai_71/city-count
A lightweight Node.js package to count people by city from an array of data.
📦 Installation
npm install @ashuhrai_71/city-count🚀 Usage
const checkCityCount = require('@ashuhrai_71/city-count');
const data = [
{ name: 'Saurabh', city: 'Mumbai' },
{ name: 'Tejas', city: 'Pune' },
{ name: 'Ashutosh', city: 'Delhi' },
{ name: 'Priya', city: 'Mumbai' },
{ name: 'Rahul', city: 'Pune' },
{ name: 'Neha', city: 'Delhi' }
];
const count = checkCityCount(data, 'Mumbai');
console.log(count); // Output: 2📖 API
checkCityCount(data, city)
| Parameter | Type | Description |
|-----------|------|-------------|
| data | Array | Array of objects with a city property |
| city | string | City name to count (case-insensitive) |
Returns: number - Count of matching entries
📄 License
ISC
👤 Author
Ashurai84 - GitHub
Made with ❤️ in India
