Skip to content

Commit

Permalink
Merge pull request #14 from oprogramador/patch-1
Browse files Browse the repository at this point in the history
refine example formatting
  • Loading branch information
zeke committed Feb 2, 2020
2 parents d215974 + c3b5ee9 commit 20bfb0c
Showing 1 changed file with 37 additions and 38 deletions.
75 changes: 37 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,43 @@ npm install all-the-cities --save
## Usage

```js
const cities = require("all-the-cities")

cities.filter(city => {
return city.name.match('Albuquerque')
})

// [{
// cityId: '5454711',
// name: 'Albuquerque',
// country: 'US',
// altCountry: '',
// muni: '',
// muniSub: '',
// featureClass: 'P',
// featureCode: 'PPLA2',
// adminCode: 'NM',
// population: 545852,
// loc: {
// type: 'Point',
// coordinates: [-106.65114, 35.084]
// }
// }, {
// cityId: '5476960',
// name: 'Los Ranchos de Albuquerque',
// country: 'US',
// altCountry: '',
// muni: '',
// muniSub: '',
// featureClass: 'P',
// featureCode: 'PPL',
// adminCode: 'NM',
// population: 6024,
// loc: {
// type: 'Point',
// coordinates: [-106.6428, 35.16199]
// }
// }]

const cities = require('all-the-cities');

cities.filter(city => city.name.match('Albuquerque'));

/*
[{
cityId: '5454711',
name: 'Albuquerque',
country: 'US',
altCountry: '',
muni: '',
muniSub: '',
featureClass: 'P',
featureCode: 'PPLA2',
adminCode: 'NM',
population: 545852,
loc: {
type: 'Point',
coordinates: [-106.65114, 35.084]
}
}, {
cityId: '5476960',
name: 'Los Ranchos de Albuquerque',
country: 'US',
altCountry: '',
muni: '',
muniSub: '',
featureClass: 'P',
featureCode: 'PPL',
adminCode: 'NM',
population: 6024,
loc: {
type: 'Point',
coordinates: [-106.6428, 35.16199]
}
}]
*/
```

## Fields available to import
Expand Down

0 comments on commit 20bfb0c

Please sign in to comment.