mpan-uk
v1.0.1
Published
Helps to parse and extract information out of MPAN for UK's energy market
Downloads
20
Maintainers
Readme
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 namePlese 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 testLicense
You can modify and distribute the code under MIT license.
Author
Vadim Tashlikovich, http://tashlikovich.info/
