mpan
1.0.0
Análisis del identificador mpan en JavaScript para el mercado energético del Reino Unido.
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
Consulte use.js para ver un ejemplo. [ index.ts ] contiene la versión lista para TypeScript. [ module/index.js ] contiene una versión lista para JavaScript.
# build JS version out of TS
$ npm run build
# run tests for JS version
$ npm run test
Puede modificar y distribuir el código bajo licencia MIT.
Vadim Tashlikovich, http://tashlikovich.info/