-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,26 @@ const newLocation = location.getCurrentAddress(); | |
|
||
``` | ||
|
||
## Build your own location.json | ||
|
||
In case the package is not packed with the latest location data, get/clone the data from [mumuy/data_location(list.json)](https://github.com/mumuy/data_location), | ||
and clone this repo and: | ||
|
||
```bash | ||
git clone [email protected]:JasonBoy/china-location.git | ||
cd china-location | ||
npm run reformat -- /path/to/data_location/list.json | ||
# and the location(.min).json will be output to ./dist dir | ||
``` | ||
And in your project, you can: | ||
|
||
```javascript | ||
const yourNewLocation = require('path/to/location.json'); | ||
const ChinaLocation = require('china-location'); | ||
const location = new ChinaLocation(yourNewLocation); | ||
//... | ||
``` | ||
|
||
## LICENSE | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters