2.4.2 • Published 5 years ago

@panda-clouds/address-formatter v2.4.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

PCAddressFormatter

maintained by PandaClouds.com

PCAddressFormatter is a lightweight JavaScript library for Node.js that provides formatting of postal addresses.

Installation

  1. If you want to use this library, you first need to install the Node.js.

  2. When you install node.js, will also be installed npm.

  3. Please run the following command.

npm install --save @panda-clouds/address-formatter

Usage

Node.js

const PCAddressFormatter = require('@panda-clouds/address-formatter');

// example usage
PCAddressFormatter.street('123 North Happy Street'); // => '123 N Happy St';
PCAddressFormatter.city('San Antonio'); // => 'San Antonio';
PCAddressFormatter.state('Arizona'); // => 'AZ';
PCAddressFormatter.country('United States of America'); // => 'US';
PCAddressFormatter.zipCode(85234); // => '85234';

You can replace PCAddressFormatter with any variable.

Methods

Unit Tests are an additional resource for learning functionality.

- street(input)

Example:

PCAddressFormatter.street('123 North Happy Street'); // => '123 N Happy St;

- city(input)

Example:

PCAddressFormatter.city('San Antonio'); // => 'San Antonio';

- state(input)

Example:

PCAddressFormatter.state('Arizona'); // => 'AZ';

- country(input)

Example:

PCAddressFormatter.country('United States of America'); // => 'US';

- zipcode(input)

Example:

PCAddressFormatter.zipcode(85234); // => '85234';

Contributions

Pull requests are welcome! here is a checklist to speed things up:

  • modify PCAddressFormatter.js
  • add unit tests in PCAddressFormatter.spec.js
  • run npm test
  • document method in README.md
  • add your name to 'Contributors' in README.md

Contributors

(Add your name)