We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
US State Abbreviations
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url]
A list of US state two-letter abbreviations.
bash
npm install @stdlib/datasets-us-states-abbr
javascript
var abbr = require( '@stdlib/datasets-us-states-abbr' );
#### abbr()
Returns a list of US state two-letter abbreviations in alphabetical order according to state name.
javascript
var data = abbr();
/* returns
[
'AL',
'AK',
'AZ',
'AR',
'CA',
'CO',
'CT',
'DE',
'FL',
'GA',
'HI',
'ID',
'IL',
'IN',
'IA',
'KS',
'KY',
'LA',
'ME',
'MD',
'MA',
'MI',
'MN',
'MS',
'MO',
'MT',
'NE',
'NV',
'NH',
'NJ',
'NM',
'NY',
'NC',
'ND',
'OH',
'OK',
'OR',
'PA',
'RI',
'SC',
'SD',
'TN',
'TX',
'UT',
'VT',
'VA',
'WA',
'WV',
'WI',
'WY'
]
*/
javascript
var floor = require( '@stdlib/math-base-special-floor' );
var randu = require( '@stdlib/random-base-randu' );
var abbr = require( '@stdlib/datasets-us-states-abbr' );
var data = abbr();
var len = data.length;
var idx;
var i;
// Select random abbreviations from the list...
for ( i = 0; i < 100; i++ ) {
idx = floor( randu()*len );
console.log( data[ idx ] );
}
License
The data files (databases) are licensed under an [Open Data Commons Public Domain Dedication & License 1.0][pddl-1.0] and their contents are licensed under [Creative Commons Zero v1.0 Universal][cc0]. The software is licensed under [Apache License, Version 2.0][apache-license].
@stdlib/datasets-us-states-abbr-cli
][@stdlib/datasets-us-states-abbr-cli]: CLI package for use as a command-line utility.
- [@stdlib/datasets-us-states-capitals
][@stdlib/datasets/us-states-capitals]: A list of US state capitals in alphabetical order according to state name.
- [@stdlib/datasets-us-states-names
][@stdlib/datasets/us-states-names]: A list of US state names in alphabetical order.