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

pvrm

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pvrm

A node.js module to retrieve information about Hong Kong personalised (vanity) car plates

  • 1.0.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pvrm

7CF VERSION STATUS LICENSE

Description

PVRM stands for Personalized Vehicle Registration Marks. This is the Hong Kong government auction system, created in 2006, by which citizens can bid for a special vehicle registration mark (ie a non-standard number). Auctions are public and the price of each plate published in a (dirty) PDF file at the end of each auction.

This package offers a simple query system for people willing to know whether a plate has already been auctioned and if the case, when the plate was initially purchased from the government and at what price. The underlying database includes:

  • PVRM plates allocated since the first auction held by the government on 16 September 2006.
  • PVRM plates auctioned during the annual lunar year auctions.

Please note that TVRM plates are not included in this set. PVRM ordinary registration marks (such as HK+digits or XX+digits) are not included.

Important notes

Return format:

{ mark: '<string>',       // cleanup result (see below)
  auctionDate: '<date>',  // in ISO-8601 format (standard JSON date)
  value: <value>,         // in Hong Kong dollars
 }

The module cleans up the argument to match qualifying PVRM criteria. In particular:

  • Everything is converted to UPPERCASE
  • All 'O' and 'I' letters are replaced by '0' and '1' digits, respectively
  • All diacritics are removed
  • Spaces are removed, as plate requests that differ from an existing one only by spaces are not allowed

The auctionDate has its hour arbitrarily set to 9:25am Hong Kong time, which is the usual auction time.

If the plate is not found, the auction date is not set and value is set to zero.

The module will throw an error if the requested plate:

  • is longer than 8 characters, even after clean-up and space removal
  • contains the letter 'Q' or other special/illegal characters (eg, non-ASCII letters)
  • is a TVRM plate (eg 1-4 digits only, 2 letters plus 1-4 digits, or special A/F plates)

I am doing my best to keep the module updated as fast as possible after auctions. Please note that due to the uneven frequency of auctions, it is essential to keep the package regularly updated. Don't hesitate to contact me if you detect errors or missing data, as the database is updated semi-manually.

Thanks for respecting the copyright and quoting my name in your work if you use the module. I have spent a significant amount of personal time compiling this data for the past few years.

Install

npm install pvrm

Detailed usage and examples

const pvrm = require('pvrm')

// usage: pvrm.query( 'plate' )

pvrm.query( 'I LOVE U' )
// { mark:'1L0VEU', auctionDate:'2006-09-16T09:25:00.000+08', value:1400000 }

pvrm.query( 'HAVE FUN' )
// { mark:'HAVEFUN', auctionDate:'2008-06-14T09:25:00.000+08', value:7000 }

pvrm.query( 123456 )
// { mark:'123456', auctionDate:'2009-12-19T09:25:00.000+08', value:34000 }

pvrm.query( '7CF148FD' )
// { mark:'7CF148FD', value:0 }

pvrm.query( '123456789' )
// Error Mark is too long

pvrm.query( 'AB 1234' )
// Error Mark is TVRM

pvrm.query( 'FAQ' )
// Error Invalid character

Keywords

FAQs

Package last updated on 28 Jun 2021

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