Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwinch/australian-states
List of Australian state information.
https://github.com/nwinch/australian-states
Last synced: 3 days ago
JSON representation
List of Australian state information.
- Host: GitHub
- URL: https://github.com/nwinch/australian-states
- Owner: nwinch
- License: mit
- Created: 2015-12-04T04:58:34.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-07T22:23:40.000Z (about 9 years ago)
- Last Synced: 2025-01-03T01:53:21.677Z (5 days ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/nwinch/australian-states.svg?branch=master)](https://travis-ci.org/nwinch/australian-states)
# Australian States
List of Australian state information.## Usage
### `.long([{capitalize: true|false}])`
Returns an array of state names. An options object can also be passed which
accepts the `capitalize` property.Example:
```javascript
var states = require('australian-states')states.long() // ["australiation capital territory", "new south wales", ...]
states.long({capitalize: true}) // ["Australiation Capital Territory", "New South Wales", ...]
```### `.short([{capitalize: true|false}])`
Returns an array of state abbreviations. An options object can also be passed
which accepts the `capitalize` property.Example:
```javascript
var states = require('australian-states')states.short() // ["act", "nsw", ...]
states.short({capitalize: true}) // ["ACT", "NSW", ...]
```### `.capitals([{capitalize: true|false}])`
Returns an array of state capital city names. An options object can also be
passed which accepts the `capitalize` property.Example:
```javascript
var states = require('australian-states')states.capitals() // ["canberra", "sydney", ...]
states.capitals({capitalize: true}) // ["Canberra", "Sydney", ...]
```### `.all()`
Returns an array of state objects containing `name`, `abbreviation`, `capital`
and `type`.Example:
```javascript
var states = require('australian-states')states.all()
/*
[{
name: 'australian capital territory',
abbreviation: 'act',
capital: 'canberra',
type: 'territory'
}]
*/
```