New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

postman-paf

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postman-paf

Unofficial JavaScript library to apply Royal Mail Rules & Exceptions to PAF (Postcode Address File) addresses when converting to a printable format.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by300%
Maintainers
0
Weekly downloads
 
Created
Source

postman-paf-js

Unofficial Javascript library to apply Royal Mail Rules & Exceptions to PAF (Postcode Address File) addresses when converting to a printable format.

Address Converter

This module enables the conversion of a PAF (Postal Address File) formatted address to an unstructured printable address, i.e. 5 lines and a postcode. The Royal Mail rules for PAF address conversion are applied here, however this module deviates slightly from these rules to actually match what Royal Mail do as their implementation sometimes does not match the documentation.

Based Royal Mail rules for formatting a PAF address for printing, outlined from page 27 onwards of the Royal Mail programmers guide.

Usage

Currently only one function is exported out of the module.

const { convertStructuredToUnstructured } = require('postman-paf-js');

const structuredAddressToConvert = {
    buildingNumber: '1',
    thoroughfareName: 'Example Street',
    postTown: 'City',
    postcode: 'AA1 1AA',
};

const convertedUnstructuredAddress = convertStructuredToUnstructured(structuredAddressToConvert);

convertStructuredToUnstructured takes 1 parameter which is the structuredAddress to be converted.

Here convertedUnstructuredAddress would have the following structure:

convertedUnstructuredAddress = {
    line1: '1 Example Street',
    line2: 'City',
    postcode: 'AA1 1AA',
};

FAQs

Package last updated on 16 Dec 2024

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