Skip to content

Parsing MPAN identificator using JavaScript for UK's energy market

License

Notifications You must be signed in to change notification settings

vtashlikovich/mpan

Repository files navigation

Mpan parser

Parsing MPAN identificator on JavaScript for UK energy market.

Usage

const MPAN = require('mpan-uk').MPAN; // as installed npm package

var mpan = new MPAN('1000071051506'); // init with 13-digit short version or 21-digit version
mpan.longString // contains long version of Mpan
mpan.shortString // contains short version of Mpan
mpan.isValid; // indicates if Mpan has correct format, both short and long version
mpan.isShort; // indicates if Mpan initially is in short format
mpan.profile; // contains profile code (long version only)
mpan.timeCode; // contains time code (long version only)
mpan.llf; // contains LLF, line loss factor (long version only)
mpan.distributorCode; // contains Dsitrubution zone code
mpan.distributionZone; // contains DNO zone name
mpan.distributionOperator; // constains DNO name

Plese refer to usage.js for an example. [index.ts] contains TypeScript ready version. [module/index.js] contains JavaScript ready version.

Compilation

# build JS version out of TS
$ npm run build

# run tests for JS version
$ npm run test

License

You can modify and distribute the code under MIT license.

Author

Vadim Tashlikovich, http://tashlikovich.info/

About

Parsing MPAN identificator using JavaScript for UK's energy market

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published