mpan
1.0.0
영국 에너지 시장을 위해 JavaScript에서 mpan 식별자를 구문 분석합니다.
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
예제는 Usage.js 를 참조하세요. [ index.ts ]에는 TypeScript 지원 버전이 포함되어 있습니다. [ module/index.js ]에는 JavaScript 지원 버전이 포함되어 있습니다.
# build JS version out of TS
$ npm run build
# run tests for JS version
$ npm run test
MIT 라이센스에 따라 코드를 수정하고 배포할 수 있습니다.
바딤 타쉬리코비치, http://tashlikovich.info/