Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

us-regions

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

us-regions

Lists of US and Canadian states and territories

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
122
decreased by-23.75%
Maintainers
1
Weekly downloads
 
Created
Source

US Regions

Lists of states and territories in the US and Canada, and mappings to regions. Data sources:

Installation

npm install us-regions

Usage

var regions = require("us-regions");
  • regions.postalAbbr(name): Returns a postal abbreviation (e.g. "CA", "MT", "MA") for the given state or territory name or abbreviation (e.g. "calif", "Montana", "Mass."), or undefined if not found.
  • regions.normalize(name): Returns a normalized full name ("District of Columbia", "Newfoundland and Labrador", "Wyoming") for the given state or territory name or abbreviation ("DC", "Newfoundland", "wyo"), or undefined if not found.
  • regions.region(name): Returns a US geographic region for the given state or territory name or abbreviation. Regions: "Northeast", "Midwest", "South", "West".

Also includes several mappings for raw usage -- consult index.js for details:

  • regions.US_STATES_AND_TERRITORIES
  • regions.FIFTY_STATES
  • regions.CANADIAN_TERRITORIES
  • regions.US_AND_CANADA
  • regions.STATES_NORMALIZED
  • regions.US_REGIONS
  • regions.US_REGIONS_BY_STATE

Data sources:

FAQs

Package last updated on 22 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc