{"_id":"datasets-us-states-names-abbr","_rev":"4-9b6ef115a8398696c689bf5f7c6275c4","name":"datasets-us-states-names-abbr","description":"Maps US state names to state abbreviations.","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"datasets-us-states-names-abbr","version":"0.0.0","description":"Maps US state names to state abbreviations.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","codecov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/codecov/coverage --report lcovonly -- -R spec && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/datasets-io/us-states-names-abbr.git"},"keywords":["datasets.io","datasets-io","datasets","dataset","data","sample","states","us","names","abbr","abbreviation","mapping","hash","table"],"bugs":{"url":"https://github.com/datasets-io/us-states-names-abbr/issues"},"dependencies":{},"devDependencies":{"chai":"3.x.x","codecov.io":"^0.1.5","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"7bcb7a83c55f4669ea7e837a8351428d64a48da6","homepage":"https://github.com/datasets-io/us-states-names-abbr#readme","_id":"datasets-us-states-names-abbr@0.0.0","_shasum":"1053656e02d4a491c2f815d8ea1347f76ba5425f","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"1053656e02d4a491c2f815d8ea1347f76ba5425f","tarball":"https://registry.npmjs.org/datasets-us-states-names-abbr/-/datasets-us-states-names-abbr-0.0.0.tgz","integrity":"sha512-lVySy8zQq6PxVsPWptHIDFqsAdAIKDZexHKMQFcumbI0XBOUFKweZjqUU0MbrD0swOmrcVJg61WRkpRGaR5edg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICtrPML/yvVUVElxCMz+EU6aB6sGhWFjh5woKRflrM4vAiB+dlbplKA7dF0LOAOSfHc/IaM1kN7e2+6zQ9NCFf3fdQ=="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]},"1.0.0":{"name":"datasets-us-states-names-abbr","version":"1.0.0","description":"Maps US state names to state abbreviations.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","codecov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/codecov/coverage --report lcovonly -- -R spec && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/datasets-io/us-states-names-abbr.git"},"keywords":["datasets.io","datasets-io","datasets","dataset","data","sample","states","us","names","abbr","abbreviation","mapping","hash","table"],"bugs":{"url":"https://github.com/datasets-io/us-states-names-abbr/issues"},"dependencies":{},"devDependencies":{"chai":"3.x.x","codecov.io":"^0.1.5","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"fac2db0066f39ebe88d783d2f01af3f70322c1ff","homepage":"https://github.com/datasets-io/us-states-names-abbr#readme","_id":"datasets-us-states-names-abbr@1.0.0","_shasum":"d65ca12d67c98cb04cce92ba6fe71effaca57de2","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"d65ca12d67c98cb04cce92ba6fe71effaca57de2","tarball":"https://registry.npmjs.org/datasets-us-states-names-abbr/-/datasets-us-states-names-abbr-1.0.0.tgz","integrity":"sha512-ODi9DL4RjIS1paDAXl7qQnZ+xabvaiTvndsYHyfy/0S1G/UeFgy8au4h+cC4YSUfV07OrXtRsCVZxOm8HZMvxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMuVH4xwCzjLqUhVgI2MF8jBUCU91cLI6wZGcEBZWd8wIgcvPRuCNL739tEr0GyePB4CQYJ2xut4HRwF/c6Rq12Os="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]}},"readme":"US State Names and Abbreviations\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> Maps US state names to state abbreviations.\n\n\n## Installation\n\n``` bash\n$ npm install datasets-us-states-names-abbr\n```\n\nFor use in the browser, use [browserify](https://github.com/substack/node-browserify).\n\n\n## Usage\n\n``` javascript\nvar table = require( 'datasets-us-states-names-abbr' );\n```\n\n#### table\n\nMaps US state names to state abbreviations.\n\n``` javascript\nconsole.dir( table );\n/*\n\t{\n\t\t\"Alabama\": \"AL\",\n\t\t\"Alaska\": \"AK\",\n\t\t\"Arizona\": \"AZ\",\n\t\t\"Arkansas\": \"AR\",\n\t\t\"California\": \"CA\",\n\t\t...\n\t}\n*/\n```\n\n\n## Examples\n\n``` javascript\nvar table = require( 'datasets-us-states-names-abbr' );\n\nfunction getAbbr( state ) {\n\tvar parts,\n\t\tabbr,\n\t\tlen,\n\t\ti;\n\n\t// Ensure the first letter of each word comprising a state name is capitalized...\n\tparts = state.split( ' ' );\n\tlen = parts.length;\n\tstate = '';\n\tfor ( i = 0; i < len; i++ ) {\n\t\tstate += parts[ i ][ 0 ].toUpperCase() + parts[ i ].substring( 1 );\n\t\tif ( i < len-1 ) {\n\t\t\tstate += ' ';\n\t\t}\n\t}\n\t// Get the state abbreviation:\n\tabbr = table[ state ];\n\n\t// Ensure a valid state name was provided...\n\tif ( abbr === void 0 ) {\n\t\tthrow new Error( 'unrecognized state name. Value: `' + state + '`.' );\n\t}\n\treturn abbr;\n}\n\nconsole.log( getAbbr( 'Missouri' ) );\nconsole.log( getAbbr( 'New Jersey' ) );\nconsole.log( getAbbr( 'California' ) );\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n## Tests\n\n### Unit\n\nUnit tests use the [Mocha](http://mochajs.org/) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright &copy; 2015. The [Compute.io](https://github.com/compute-io) Authors.\n\n\n[npm-image]: http://img.shields.io/npm/v/datasets-us-states-names-abbr.svg\n[npm-url]: https://npmjs.org/package/datasets-us-states-names-abbr\n\n[travis-image]: http://img.shields.io/travis/datasets-io/us-states-names-abbr/master.svg\n[travis-url]: https://travis-ci.org/datasets-io/us-states-names-abbr\n\n[codecov-image]: https://img.shields.io/codecov/c/github/datasets-io/us-states-names-abbr/master.svg\n[codecov-url]: https://codecov.io/github/datasets-io/us-states-names-abbr?branch=master\n\n[dependencies-image]: http://img.shields.io/david/datasets-io/us-states-names-abbr.svg\n[dependencies-url]: https://david-dm.org/datasets-io/us-states-names-abbr\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/datasets-io/us-states-names-abbr.svg\n[dev-dependencies-url]: https://david-dm.org/dev/datasets-io/us-states-names-abbr\n\n[github-issues-image]: http://img.shields.io/github/issues/datasets-io/us-states-names-abbr.svg\n[github-issues-url]: https://github.com/datasets-io/us-states-names-abbr/issues\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2022-06-14T19:40:00.173Z","created":"2015-08-03T15:48:17.453Z","0.0.0":"2015-08-03T15:48:17.453Z","1.0.0":"2015-08-03T15:49:39.600Z"},"homepage":"https://github.com/datasets-io/us-states-names-abbr#readme","keywords":["datasets.io","datasets-io","datasets","dataset","data","sample","states","us","names","abbr","abbreviation","mapping","hash","table"],"repository":{"type":"git","url":"git://github.com/datasets-io/us-states-names-abbr.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/datasets-io/us-states-names-abbr/issues"},"license":"MIT","readmeFilename":"README.md"}