{"_id":"@buge/ts-units","_rev":"9-06ed0775948ddc14360024f5ae954e37","time":{"1.0.0":"2021-08-24T11:11:29.514Z","created":"2021-08-25T13:53:45.451Z","1.1.0":"2021-08-25T13:53:45.734Z","modified":"2023-12-19T20:44:47.540Z","1.2.0":"2021-10-04T14:46:09.636Z","1.2.1":"2022-11-01T20:35:04.229Z","1.2.2":"2022-12-03T13:24:07.504Z","1.2.3":"2023-12-19T20:44:47.403Z"},"name":"@buge/ts-units","dist-tags":{"latest":"1.2.3"},"versions":{"1.1.0":{"name":"@buge/ts-units","version":"1.1.0","description":"Physical Units for TypeScript","author":{"name":"Philipp Bunge","email":"buge@crimson.ch"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/buge/ts-units.git"},"bugs":{"url":"https://github.com/buge/ts-units/issues"},"homepage":"https://github.com/buge/ts-units#readme","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","clean":"rm -r ./build","fix":"prettier --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' --write && eslint --fix src/ test/","lint":"eslint","test":"mocha -r ts-node/register 'test/**/*.ts'","prepare":"npm run build","prepack":"mv build/* .","postpack":"git clean -fd","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run fix && git add -A src","postversion":"git push && git push --tags","release":"release-it"},"devDependencies":{"@types/chai":"^4.2.12","@types/mocha":"^9.0.0","@typescript-eslint/eslint-plugin":"^4.1.0","@typescript-eslint/parser":"^4.1.0","chai":"^4.2.0","eslint":"^7.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.1.4","mocha":"^9.1.0","prettier":"^2.1.1","release-it":"*","ts-node":"^10.2.1","typescript":"^4.1.6"},"gitHead":"6c8683e1d74f43dcdd1c0112551b8047206a75c7","_id":"@buge/ts-units@1.1.0","_nodeVersion":"15.12.0","_npmVersion":"7.6.3","dist":{"integrity":"sha512-aYsA3k0vPGKS+gL0aVgxjmG6LTk8Wa7Hl9hUqaB6heQKeCX53GIIaJsT8/Jh7VH/MxHLcx651GavY9bR/QfjJg==","shasum":"db77ede95227d7569d443b52a401c71433742232","tarball":"https://registry.npmjs.org/@buge/ts-units/-/ts-units-1.1.0.tgz","fileCount":174,"unpackedSize":142384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJktpCRA9TVsSAnZWagAAJhMP/3xgGQOGOJssqVNr3k4I\njLHi06KlTPgr+njIdJgBXHMawnFLRtG4awgCiU7LvcRuK6/9V/vPUPaECMQt\nu7/WvjNj/IJIsFfpCVX2FcTeOuA+12DSPd4uGiqxUMDd7MNMI5rIoFBUCPMr\nQITOoQhawWKPDtDaU0Wf+xM1EtlKCaBl/2+i15pLV3qSDdPcUg3vyGXqryw9\ncOc/EqALCMCc9usYOm+FVElMb8BQND/tgpxTtH3PNdH9u7vWRhTUkVwYNpy7\ngC4j74rAdBnzNsAzmpbYSGS82Z7IKULH4hTxiJc530AXgituWyOLWETKQV/Q\nHNbtYt2LNXtt9yTXKfenuHUpaICihv9qfeseBfpblZIwB7Fe3avKTOkVy9wM\n3vPUBupbtwI9CDDuQVgt4cSp3UXNuKvrzGmOWkPXuYT2aVU6yac2RPKqyNhg\ntRA7lAIlNb8XZzmp6WeNg9TclO5A3Ve0Gfionao5TVPYOn0hXeZbnOSWGWW0\nD6Oqsh7EztF2RbkKiFmxsU3345/TAnVDlj447bj9LOEXIr/cKbkeZIQ557/A\nIJEYFsVJDZ142iTZpd8n7zeUJ534C7lG6FOlnhNm5fD94bbXUD51yRMYpcQs\nCLe5aEUE/RtQlJNFfRQszrX3ri8gkF07KuHvkAQuo55+swfIMeZrnHVCmc54\nyIgo\r\n=iYZo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyixYpZra0zHioEM4cgxwKlcv6g59IgOrVbHEkiSBC5QIhALneQeondCl8f/Wo/CK8FpUsyl0EML88WfGOoNoYZ1A1"}]},"_npmUser":{"name":"buge","email":"philippbunge@crimson.ch"},"directories":{},"maintainers":[{"name":"buge","email":"philippbunge@crimson.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-units_1.1.0_1629899625511_0.5032060527929838"},"_hasShrinkwrap":false},"1.2.0":{"name":"@buge/ts-units","version":"1.2.0","description":"Physical Units for TypeScript","author":{"name":"Philipp Bunge","email":"buge@crimson.ch"},"license":"Apache-2.0","keywords":["physical","units","units","measure","measures","measurement","measurements","quantity","quantities","amount","amounts","SI","ISQ","metrology"],"repository":{"type":"git","url":"git+https://github.com/buge/ts-units.git"},"bugs":{"url":"https://github.com/buge/ts-units/issues"},"homepage":"https://github.com/buge/ts-units#readme","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","clean":"rm -r ./build","fix":"prettier --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' --write && eslint --fix src/ test/","lint":"eslint","test":"mocha -r ts-node/register 'test/**/*.ts'","prepare":"npm run build","prepack":"mv build/* .","postpack":"git clean -fd","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run fix && git add -A src","postversion":"git push && git push --tags","release":"release-it"},"devDependencies":{"@types/chai":"^4.2.12","@types/mocha":"^9.0.0","@typescript-eslint/eslint-plugin":"^4.1.0","@typescript-eslint/parser":"^4.1.0","chai":"^4.2.0","eslint":"^7.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.1.4","kelonio":"^0.6.0","mocha":"^9.1.0","mocha-multi":"^1.1.5","prettier":"^2.1.1","release-it":"*","ts-node":"^10.2.1","typescript":"^4.1.6"},"gitHead":"4917252a349eb5ab6860e0c0c665f12bac504b1d","_id":"@buge/ts-units@1.2.0","_nodeVersion":"15.12.0","_npmVersion":"7.6.3","dist":{"integrity":"sha512-7CmKLr1cN/waZpGOBWsCXkubfadfMGOsj/+mjiCE7lEfmm+imJ+/KwQ1yLhr6drU2YjUXFcecV0MLMCrogfoow==","shasum":"3708c42e171c3be36b695df468f6e5663915ca67","tarball":"https://registry.npmjs.org/@buge/ts-units/-/ts-units-1.2.0.tgz","fileCount":174,"unpackedSize":145943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzaMyCRA9TVsSAnZWagAA4CIQAJJwRksn8zdi+BvnOZtj\npJxPTUC7LuxXBZdDmIKdMMtnvjeiWqxf3mFuPE5C4GFPz0cqZtNkwT6X24MT\nHbtF4Ztbx/sXHfG4h6+U43u6tQCc9hRaD6at7fQUYqlRi5SeJIR/IHgpN1XC\npF5tBeuAsEglab/oGNUek4KwouUGyJrD4AKbByRkGHEp1caNCQFK7Hpe8Dh8\ntcl8cFKDWRNZMYjuXYbMhtnmxmeAR+qrKl44h4/wB9cxBee/9TEUPfRCNaZY\nftQ2Vuw6Wpsg656BVm7uLMnBkBgqbiXC/pKZJrTxz3FR7P3cLLo8Ay9SwZ64\nztyrH6HzQVCO1FDlbJMMyr+NsmLLqieQ8r9Yzo0jur6CfNRPXg5ObWKs4PTl\ndRBG+j9lMr/Dn8i1V7Gv6wzzbqPBmdRrQKKgXBEdAfe4Kc9ZiAlh49Ve2AXx\nZmuFVBYKf51VIeEcweYWYKsmt/eEoCS7nY6Au6AO6UwYG09/dk18ynk71hdr\nTNBaDiut1Oqe4fq9oSiWomRFVMmK3FTk0G1D2MzGdDyvvyK+fcpi3ZYLICGa\nTiK75B5PPVmNYKLYDg3+p1AWiUahV/0y4M3uDx4Ke/Z/q8RayVF+j8Hx0n2B\nGS1HDZNJqlvACdNAmb5ID7OnQDVGE5kDTUuld6/I9QkNm2qtaNOlwZupPfRV\nZq2G\r\n=FBza\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQJ7U1AC8iBM8f8BDgphXhT8Lh9gkI0syXoIgPCWg7SwIhAIC+zwRkwCqH1vIJmk7BMPKsGkDXaHrN4iyE6sF/bmmq"}]},"_npmUser":{"name":"buge","email":"philippbunge@crimson.ch"},"directories":{},"maintainers":[{"name":"buge","email":"philippbunge@crimson.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-units_1.2.0_1633358769442_0.7286564173401433"},"_hasShrinkwrap":false},"1.2.1":{"name":"@buge/ts-units","version":"1.2.1","description":"Physical Units for TypeScript","author":{"name":"Philipp Bunge","email":"buge@crimson.ch"},"license":"Apache-2.0","keywords":["physical","units","units","measure","measures","measurement","measurements","quantity","quantities","amount","amounts","SI","ISQ","metrology"],"repository":{"type":"git","url":"git+https://github.com/buge/ts-units.git"},"bugs":{"url":"https://github.com/buge/ts-units/issues"},"homepage":"https://github.com/buge/ts-units#readme","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","clean":"rm -r ./build","fix":"prettier --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' --write && eslint --fix src/ test/","lint":"eslint","test":"mocha -r ts-node/register 'test/**/*.ts'","prepare":"npm run build","prepack":"mv build/* .","postpack":"git clean -fd","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run fix && git add -A src","postversion":"git push && git push --tags","release":"release-it"},"devDependencies":{"@types/chai":"^4.2.12","@types/mocha":"^9.0.0","@typescript-eslint/eslint-plugin":"^4.1.0","@typescript-eslint/parser":"^4.1.0","chai":"^4.2.0","eslint":"^7.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.1.4","kelonio":"^0.7.0","mocha":"^9.1.0","mocha-multi":"^1.1.5","prettier":"^2.1.1","release-it":"*","ts-node":"^10.2.1","typescript":"^4.1.6"},"gitHead":"5721b0509bd0a9029a53fb4ff6c76a6571f5186e","_id":"@buge/ts-units@1.2.1","_nodeVersion":"18.3.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-zhJXNXWeyKQMNoCUdx8LwBqOqBytASbSFmETqzZJKPr/jtZrGeSDhQa0V40d53g5t+0//crxIi4LGekzx6OfdA==","shasum":"ca8a074a8a23553a93f9ef9261c4663cd694f2d1","tarball":"https://registry.npmjs.org/@buge/ts-units/-/ts-units-1.2.1.tgz","fileCount":180,"unpackedSize":147457,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8XWxuzNV0ed3e9dnaUVgnkp4O/F8lJRwGBVO2ZtWOYQIhAP2SMswmmVBqdxEVOH9Zr+FnjryPnOBFzcayTTrpzMhm"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYYL4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxRQ//RYkBKDAV/f34iBLFFcj8Cv8gtIcpRW8r1jlfAZgE0I4Ag75i\r\nK9GmPs/wfPIR8x3uzLjj8jT3tTsMpmjiOW9uDUflMfxOazZDR+6oi2lCBIDQ\r\n7IdA+yLensgwJcVKwMku/+FpxMpepiEX79SOSYHGE9PaNLqnJ7zH1HiQOvsB\r\ngpDEl3QIKZzKP2J+KnyGQmwm3UBxKKYxcHDNohoINX23Rw7Qez7GDqQLi3T2\r\nbEK7UAkWVmkNtQR9T9XNI2XFmGcv49ocM1WJX9PdTX7HSEyspxmBwBa3eRPt\r\noQDRHyISxVfOhECSAlQ0e5I0AMVva/viOV8lj6dspua2AlTaOoMHyI9Uhe23\r\nL77zB9oBxEh8+E5oMX9qA83CR55jID2rcl0Lfjq0n0UikVUg/4BwLXgJwH2Q\r\n7qJXUCUHCc5OBaodLFqZkmkySa+98qVraIIukP3IUAypuUAMdYWHu2ds0Ozm\r\nSKjmzErnQIbDxj58foYJ6vwDh1TBiWBaP+zPBQuhVyYQYA1j5sgqyPTA21tc\r\nIFipQgWeR4YbjMU29W1yUcSA0rNCXwnef/Y+5AkfjOUbvR/llhZLuWLAUGkP\r\noxqM7IESeMl6gjZ0LqQXUMDU2SvB8aGyRgN4tkhaFaZKTDvcHoxS+MfiEPpd\r\nu47nGYvpulHAjEWtzXt1agCQIf60VCVTzNA=\r\n=FDLv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"buge","email":"philippbunge@crimson.ch"},"directories":{},"maintainers":[{"name":"buge","email":"philippbunge@crimson.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-units_1.2.1_1667334903994_0.9371167571733938"},"_hasShrinkwrap":false},"1.2.2":{"name":"@buge/ts-units","version":"1.2.2","description":"Physical Units for TypeScript","author":{"name":"Philipp Bunge","email":"buge@crimson.ch"},"license":"Apache-2.0","keywords":["physical","units","units","measure","measures","measurement","measurements","quantity","quantities","amount","amounts","SI","ISQ","metrology"],"repository":{"type":"git","url":"git+https://github.com/buge/ts-units.git"},"bugs":{"url":"https://github.com/buge/ts-units/issues"},"homepage":"https://github.com/buge/ts-units#readme","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","clean":"rm -r ./build","fix":"prettier --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' --write && eslint --fix src/ test/","lint":"eslint","test":"mocha -r ts-node/register 'test/**/*.ts'","prepare":"npm run build","prepack":"mv build/* .","postpack":"git clean -fd","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run fix && git add -A src","postversion":"git push && git push --tags","release":"release-it"},"devDependencies":{"@types/chai":"^4.2.12","@types/mocha":"^9.0.0","@typescript-eslint/eslint-plugin":"^4.1.0","@typescript-eslint/parser":"^4.1.0","chai":"^4.2.0","eslint":"^7.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.1.4","kelonio":"^0.7.0","mocha":"^9.1.0","mocha-multi":"^1.1.5","prettier":"^2.1.1","release-it":"*","ts-node":"^10.2.1","typescript":"^4.1.6"},"gitHead":"f68ae164a8ac02d06d0356da2e40a722260e6082","_id":"@buge/ts-units@1.2.2","_nodeVersion":"18.3.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-SIsisn3k3pkNM/b17393931ynzrXRuOXbwer3PiGTEqgUAYz/yVd5YhmX8aA1rFwldj0GcZ0oPBtX6tJL96/EA==","shasum":"92d1cc946424b55ea9f9d19385d3685ea33ff57d","tarball":"https://registry.npmjs.org/@buge/ts-units/-/ts-units-1.2.2.tgz","fileCount":180,"unpackedSize":150629,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe5oAoCUBxNScSVnR5NKQzAkK6IyroSNU0A4X6ZUlGqwIhANWGOci1fTL5dGGVoYDkODljdr/9IAMSuClXsbB+fXi+"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJji033ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmprbg/+JO3izO8/dCD78y+hxP30pRcKfcbCg6+yiGKDabv+FG0sRhxt\r\nVK4ldm0co+PF54EiwhNio+XQnq9Wi5AP9M6MRi2TYRuF3IAmQEV8zJp3jTp5\r\npeZeSnwEmzQoMu6vpiDtbCrS79ktp73R6UuKzsWxoTujXlN7FYay8WZSyJKd\r\n+7SG3uGW9Dec64OJ8e5yThDSrxVLK6KG3TyuW+a/L+qb6Sl+A47SGs77eL0n\r\n7cVIJPZvTPC6hjEnOhgYv+r75rtk4+UmZaaBtfZoNV0Ct5B21Lx/CURtBijE\r\njvoaU6161/tp+cZtsOktvUr7AmtDflR3KhWWGH0QHs4YYTDpdwizyvjIB48a\r\nVxfRbI6jlqeDOL3obQ6lH9cp7WBweVA+hSy4jrfjugQXObWpAY0UjBaj65lD\r\nLHafvBKa8J+ifi6J64cU2Xv632zduK7xlSmUOuOTZX3227qIb1m/9aOoJurL\r\n0Ke3qTOasXFd5pvHVJ7+xshylg8O02bFp6tRuNpAm66CXIInDApRkfAXv1Fg\r\nQe0OW321mtXNbt9IvQunsE9w5YOlJGNZbYKiE4sLgw+vhBb/mi5oRr3frd6P\r\nqUqiueT4gzE/Ri3dPAxSecLxOIdL8bIA+cAHZK1z8pMIqp3DLf3TE2ARDApu\r\nvU5NTKyCV7U81SVHTkLdfXcLXRTlbJNCqDk=\r\n=t1y8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"buge","email":"philippbunge@crimson.ch"},"directories":{},"maintainers":[{"name":"buge","email":"philippbunge@crimson.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-units_1.2.2_1670073847338_0.48171800457409075"},"_hasShrinkwrap":false},"1.2.3":{"name":"@buge/ts-units","version":"1.2.3","description":"Physical Units for TypeScript","author":{"name":"Philipp Bunge","email":"buge@crimson.ch"},"license":"Apache-2.0","keywords":["physical","units","units","measure","measures","measurement","measurements","quantity","quantities","amount","amounts","SI","ISQ","metrology"],"repository":{"type":"git","url":"git+https://github.com/buge/ts-units.git"},"bugs":{"url":"https://github.com/buge/ts-units/issues"},"homepage":"https://github.com/buge/ts-units#readme","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","clean":"rm -r ./build","fix":"prettier --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' --write && eslint --fix src/ test/","lint":"eslint","test":"mocha -r ts-node/register 'test/**/*.ts'","prepare":"npm run build","prepack":"mv build/* .","postpack":"git clean -fd","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run fix && git add -A src","postversion":"git push && git push --tags","release":"release-it"},"devDependencies":{"@types/chai":"^4.3.4","@types/mocha":"^10.0.1","@typescript-eslint/eslint-plugin":"^6.2.0","@typescript-eslint/parser":"^6.2.0","chai":"^4.3.7","eslint":"^8.46.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","kelonio":"^0.9.0","mocha":"^10.2.0","mocha-multi":"^1.1.7","prettier":"^3.0.0","release-it":"*","ts-node":"^10.9.1","typescript":"^5.0.3"},"gitHead":"e931f9213e75c6fd5872eba9244bcd910addc700","_id":"@buge/ts-units@1.2.3","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-3aatF0mnIxZBMkL2EkKnOEbVAFeZR8oCUwXNTUyOv7hxeCuA8fycVWaVWBiAWdnmMTmLL5KAgzMiQ0MreuaYJg==","shasum":"849515ad812cf08dca0fe11d70b7f4cc8842c739","tarball":"https://registry.npmjs.org/@buge/ts-units/-/ts-units-1.2.3.tgz","fileCount":192,"unpackedSize":204809,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGw+lqdZ4PQAHapOFZi7kFvmPHW/aTtTBbPv7vt2/pQrAiBp0l7qqY3ylEU90ZUbLNiVgAuBCsV7iWtKChr45tARng=="}]},"_npmUser":{"name":"buge","email":"philippbunge@crimson.ch"},"directories":{},"maintainers":[{"name":"buge","email":"philippbunge@crimson.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-units_1.2.3_1703018687123_0.351298909322056"},"_hasShrinkwrap":false}},"maintainers":[{"name":"buge","email":"philippbunge@crimson.ch"}],"description":"Physical Units for TypeScript","homepage":"https://github.com/buge/ts-units#readme","repository":{"type":"git","url":"git+https://github.com/buge/ts-units.git"},"author":{"name":"Philipp Bunge","email":"buge@crimson.ch"},"bugs":{"url":"https://github.com/buge/ts-units/issues"},"license":"Apache-2.0","readme":"# Physical Units for TypeScript\n\n[![CI Build](https://github.com/buge/ts-units/actions/workflows/node.js.yml/badge.svg)](https://github.com/buge/ts-units/actions/workflows/node.js.yml)\n[![npm version](https://badge.fury.io/js/@buge%2Fts-units.svg)](https://badge.fury.io/js/@buge%2Fts-units)\n\n`@buge/ts-units` is a package for modeling typed physical units in TypeScript.\n\nIt allows you to tell users what you need in a typesafe manner\n\n```ts\nfunction setTemperature(t: Temperature) {\n  ...\n}\n```\n\nwhile letting them work in units that make sense to them\n\n```ts\nsetTemperature(celsius(21.3));\n```\n\nUnits can easily be converted from one to another\n\n```ts\nconst t = celsius(21.3).in(fahrenheit);\n```\n\ncompared\n\n```ts\nmeters(1) < feet(4);\n```\n\nand used in mathematical expressions\n\n```ts\nconst length = meters(5).plus(centimeters(3));\nconst speed = length.per(seconds(2));\n```\n\n## Basic Usage\n\nInstall from npm or using your favorite package manager:\n\n```sh\nnpm install @buge/ts-units\n```\n\nSimply declare quantities using the built-in units:\n\n```ts\nimport {Length, meters} from '@buge/ts-units/length';\nconst length: Length = meters(5);\n```\n\nSee [Built-in Units](#built-in-units) below for an overview of all built-in\nunits.\n\n### Displaying\n\nQuantities provide a `toString()` method that allows them to be easily rendered\nto a string:\n\n```ts\ncelsius(23.1).toString(); // '23.1ºC'\n```\n\nFor custom formatting, the amount and symbol can be easily extracted from the\nquantity:\n\n```ts\nconst temp = celsius(23.1);\nconst html =\n  `<span class=\"amount\">${temp.amount.toFixed(1)}</span>` +\n  `<span class=\"symbol\">${temp.unit.symbol}</span>`;\n```\n\n### Conversion\n\nQuantities can easily be converted from one unit to another using the `in`\nmethod:\n\n```ts\nconst length = meters(5.3).in(feet);\nconst temp = celsius(23.1).in(fahrenheit);\n```\n\nQuantities can (perhaps obviously) only be converted from units belonging to\nthe same physical dimension in this way, but see\n[Multiplication and Division](#multiplication-and-division) below for some more\nadvanced conversions.\n\n### Comparing\n\nQuantities can be freely compared to one another using standard TypeScript\noperators (thanks to [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)):\n\n```ts\nmeters(1) < feet(4);\n```\n\nBecause of the inprecision in floating point arithmetics, you should prefer to\nuse the `isCloseTo` method when checking a quantity for equality:\n\n```ts\n// Returns whether 1m is within 0.01 feet of 3.28 feet.\nmeters(1).isCloseTo(feet(3.28), 0.01);\n```\n\n### Addition and Subtracting\n\nQuantities of the same physical dimension can be freely added using `plus` and\nsubtracted using `minus`:\n\n```ts\nconst time = minutes(3).plus(seconds(2));\nconst length = meters(5).minus(feet(1));\n```\n\nThe unit of the quantities returned will default to the unit of the quantity\nbeing added or subtracted.\n\n### Multiplication and Division\n\nQuantities can be multiplied with `times` and divided with `per`, resulting in\nnew dimensions being returned:\n\n```ts\nconst area: Area = meters(5).times(meters(6));\nconst speed: Speed = kilometers(150).per(hours(2));\n```\n\nA special case are multiplications with dimensionless units which result in\nthe same unit being returned:\n\n```ts\nconst length: Length = meters(5).times(percent(10)); // 0.5m\n```\n\nYou can square and cube quantities and take their reciprocal:\n\n```ts\nconst area: Area = meters(3).squared();\nconst volume: Volume = meters(2).cubed();\nconst frequency: Frequency = seconds(3).reciprocal();\n```\n\nYou can use the relationship between quantities to define unit conversions:\n\n```ts\nconst riceDensity = grams(220).per(cups);\nconst iNeed = grams(500).per(riceDensity).in(ounces);\n```\n\n## Built-in Units\n\nHere’s a reference of all units that we currently have built in to the library.\n\n### Planar Angles\n\n```ts\nimport {Angle, degrees, sin} from '@buge/ts-units/angle';\nconst angle: Angle = degrees(30);\nconst s = sin(angle);\n```\n\n**Units:**\\\nradians, degrees, turns\n\n**Trigonometric Functions:**\\\nsin, cos, tan, asin, acos, atan, atan2\n\n### Solid Angles\n\n```ts\nimport {SolidAngle, steradians} from '@buge/ts-units/angle/solid';\nconst angle: SolidAngle = steradians(1);\n```\n\n**Units:**\\\nsteradians, squareDegrees\n\n### Area\n\n```ts\nimport {Area, squareMeters} from '@buge/ts-units/area';\nconst area: Area = squareMeters(15);\n```\n\n**Units:**\\\nsquareMeters\n\n### Electrical Capacitance\n\n```ts\nimport {Capacitance, microfarads} from '@buge/ts-units/eletric/capacitance';\nconst capacitance: Capacitance = microfarads(4700);\n```\n\n**Units:**\\\nfarads, microfarads, nanofarads, picofarads\n\n### Electric Charge\n\n```ts\nimport {Charge, coulombs} from '@buge/ts-units/eletric/charge';\nconst charge: Charge = coulombs(5000);\n```\n\n**Units:**\\\ncoulombs\n\n### Electrical Conductance\n\n```ts\nimport {Conductance, siemens} from '@buge/ts-units/eletric/conductance';\nconst conductance: Conductance = siemens(0.2);\n```\n\n**Units:**\\\nsiemens\n\n### Electrical Current\n\n```ts\nimport {Current, amperes} from '@buge/ts-units/eletric/current';\nconst current: Current = amperes(10);\n```\n\n**Units:**\\\namperes\n\n### Electrical Inductance\n\n```ts\nimport {Inductance, henries} from '@buge/ts-units/eletric/inductance';\nconst inductance: Inductance = henries(1);\n```\n\n**Units:**\\\nhenries\n\n### Electrical Resistance\n\n```ts\nimport {Resistance, ohms} from '@buge/ts-units/eletric/resistance';\nconst resistance: Resistance = ohms(560);\n```\n\n**Units:**\\\nohms\n\n### Electric Voltage\n\n```ts\nimport {Voltage, volts} from '@buge/ts-units/eletric/voltage';\nconst voltage: Voltage = volts(220);\n```\n\n**Units:**\\\nvolts\n\n### Energy\n\n```ts\nimport {Energy, joules} from '@buge/ts-units/energy';\nconst energy: Energy = joules(4.1868);\n```\n\n**Units:**\\\njoules\n\n### Force\n\n```ts\nimport {Force, newtons} from '@buge/ts-units/force';\nconst force: Force = newtons(608);\n```\n\n**Units:**\\\nnewtons\n\n### Frequency\n\n```ts\nimport {Frequency, hertz} from '@buge/ts-units/force';\nconst frequency: Frequency = hertz(608);\n```\n\n**Units:**\\\nhertz\n\n### Length\n\n```ts\nimport {Length, meters} from '@buge/ts-units/length';\nconst length: Length = meters(5);\n```\n\n**Metric Units:**\\\nmeters, kilometers, centimeters, millimeters, micrometers, nanometers,\npicometers, femtometers, fermi, angstroms, microns\n\n**Imperial Units:**\\\nyards, feet, inches, chains, furlongs, miles\n\n**Marine Units:**\\\nfathoms, nauticalMiles\n\n**Astronomical Units:**\\\nastronomicalUnits\n\n### Luminous Flux\n\n```ts\nimport {Flux, lumes} from '@buge/ts-units/luminous/flux';\nconst flux: Flux = lumens(800);\n```\n\n**Units:**\\\nlumens\n\n### Illuminance\n\n```ts\nimport {Illuminance, lux} from '@buge/ts-units/luminous/illuminance';\nconst illuminance: Illuminance = lux(35000);\n```\n\n**Units:**\\\nlux\n\n### Luminous Intensity\n\n```ts\nimport {Intensity, candelas} from '@buge/ts-units/luminous/intensity';\nconst intensity: Intensity = candelas(135);\n```\n\n**Units:**\\\ncandelas\n\n### Magnetic Flux\n\n```ts\nimport {Flux, webers} from '@buge/ts-units/magnetic/flux';\nconst flux: Flux = webers(800);\n```\n\n**Units:**\\\nwebers\n\n### Mass\n\n```ts\nimport {Mass, kilograms} from '@buge/ts-units/mass';\nconst mass: Mass = kilograms(5);\n```\n\n**Units:**\\\nkilograms, grams\n\n### Scalar\n\nTechnically not a physical dimension but still very useful.\n\n```ts\nimport {Scalar, percent} from '@buge/ts-units/scalar';\nconst scalar: Scalar = percent(20);\n```\n\n**Units:**\\\npercent, permille, permyriad\n\n### Speed\n\n```ts\nimport {Speed, metersPerSecond} from '@buge/ts-units/speed';\nconst speed: Speed = metersPerSecond(343);\n```\n\n**Units:**\\\nmetersPerSecond, kilometersPerHour, milesPerHour, knots, feetPerSecond\n\n### Power\n\n```ts\nimport {Power, watts} from '@buge/ts-units/power';\nconst power: Power = watts(800);\n```\n\n**Units:**\\\nwatt\n\n### Pressure\n\n```ts\nimport {Pressure, pascals} from '@buge/ts-units/pressure';\nconst pressure: Pressure = pascals(101325);\n```\n\n**Units:**\\\npascals\n\n### Radioactivity\n\n```ts\nimport {Radioactivity, becquerels} from '@buge/ts-units/radioactive/decay';\nconst radioactivity: Radioactivity = becquerels(20);\n```\n\n**Units:**\\\nbecquerels\n\n### Absorbed and Equivaelnt Doses of Ionizing Radiation\n\n```ts\nimport {Dose, grays, sieverts} from '@buge/ts-units/radioactive/dose';\nconst absorbed: Dose = grays(20e-6);\nconst equivaelnt: Dose = sieverts(1.5e-3);\n```\n\n**Units:**\\\ngrays, sieverts\n\n### Temperature\n\n```ts\nimport {Temperature, celsius} from '@buge/ts-units/temperature';\nconst temperature: Temperature = celsius(23.1);\n```\n\n**Units:**\\\nkelvin, celsius, fahrenheit, rankine\n\n### Time\n\n```ts\nimport {Time, minutes} from '@buge/ts-units/time';\nconst time: Time = minutes(5);\n```\n\n**Units:**\\\nseconds, milliseconds (msec), microseconds (usec), nanoseconds, minutes, hours\n\n### Volume\n\n```ts\nimport {Volume, cubicMeters} from '@buge/ts-units/volume';\nconst volume: Volume = cubicMeters(3);\n```\n\n**Units:**\\\ncubicMeters\n\n## Defining new Units\n\nNew units of existing dimensions can easily be defined on the basis of an\nexisting one. As an example, here’s how the yard is defined:\n\n```ts\nconst yards: Unit<Length> = meters.times(0.9144).withSymbol('yd');\n```\n\nSimilar how quantities can be multiplied and divided you can create new derived\nunits by multiplying them using `time`, dividing them using `per`, squaring\nthem using `squared`, cubing using `cubed` and taking their reciprocal using\n`reciprocal`.\n\n```ts\nconst knots: Unit<Speed> = nauticalMiles.per(hours).withSymbol('kn');\nconst mps2: Unit<Acceleration> = meters\n  .per(seconds.squared())\n  .withSymbol('m/s²');\n```\n\nAs shown above, you can configure the symbol for the unit using `withSymbol`\nthat will be suffixed to the amount when printing a quantity using\n`toString()`. You can provide any arbitrary string. The symbol can be retrieved\nfrom the unit using the `.symbol` property or from a quantity using\n`.unit.symbol`.\n\nWe provide a dedicated method to create derived units with SI prefix that both\nscale the unit and prepend the prefix to the symbol.\n\n```ts\nconst micrograms = gram.withSiPrefix('μ');\nmicrograms(2.13).toString(); // 2.13μg\n```\n\nThe supported SI prefixes are enumerated in `unit.SiPrefix`.\n\n## Defining new Dimensions\n\nWe provide units and dimensions for all SI base units and for many derived\nunits. These can be used as building blocks for defining many other units.\n\nSometimes, you’ll find yourself wanting to define units for a new substance or\n“thing” though.\n\n<!-- prettier-ignore -->\nMeasurable things are defined through “dimensions”. In scientific literature a\ndimension is often denoted with capital letters and square brackets. For\nexample, the dimension of length is often denoted as <code>[L]</code>, that of\narea as <code>[L]<sup>2</sup></code> and that of speed as\n<code>[L][T]<sup>-1</sup></code>.\n\n<!-- prettier-ignore-end -->\n\nWe ensure type safety by encoding the dimensions of units and quantities as\n[TypeScript Literal Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).\nFor example, the dimension mentioned above are defined as:\n\n```ts\ntype Length = {length: 1};\ntype Area = {length: 2};\ntype Speed = {length: 1; time: -1};\n```\n\nTo define a new dimension, start by defining a literal type for it. You’ll\nalso need to define a constant for it that can be used at runtime, since\nTypeScript types all disappear after compilation. For example, if you would\nlike to introduce quantities of money you might write:\n\n```ts\n// In money/dimension.ts\nexport type Money = {money: 1};\nexport const Money: Money = {money: 1};\n```\n\nWe use a convention that we use the same capitalization for the type and for\nthe constant value since it allows us (in most cases) to just forget about\nwhether we are using the type or the value. We also store the dimension in a\n`dimension.ts` alongside the units so that we can distinguish `Length` as a\ndimension vs. a `Length` as an amount of a quantity.\n\nNext, you will want to define a base unit for the dimension. Let’s take the\nUS dollar as the base unit:\n\n```ts\n// In money/units.ts\nimport * as dimension from './dimension';\nexport type Money = Quantity<number, dimension.Money>;\nexport const dollars: Unit<number, dimension.Money> = makeUnit('$', dimension.Money);\n```\n\nYou can now use your new dimension and unit to define quantities:\n\n```ts\nconst pleaseDonateToACharityOfYourChoice: Money = usd(10);\n```\n\n## Defining new Arithmetic\n\nThe default units provided by the library are all based on the native representation of JavaScript number which could lead to a precision error.\nThe most infamous example being (0.1 + 0.2).\n\nThe library provides a way to avoid this problem by giving you the possibility to implement your own arithmetic.\nEach group of units exposes a function `withValueType` that returns the units using your own arithmetic.\n\nConcretely, you can use other external library that provides more robust representation of numbers.\nFor instance [decimal.js](https://github.com/MikeMcl/decimal.js):\n\n```ts\nimport {Arithmetic, Geometric} from \"@buge/ts-units\";\nimport {Decimal } from 'decimal.js';\nimport {withValueType as temperatureWithValueType} from '@buge/ts-units/temperature';\nimport {withValueType as angleWithValueType} from '@buge/ts-units/angle';\n\nconst DecimalArithmetic: Arithmetic<Decimal> = {\n  fromNative(value: number): Decimal {\n    return new Decimal(value);\n  },\n  toNative(value: Decimal): number {\n    return value.toNumber();\n  }\n  add(left: Decimal, right: Decimal): Decimal {\n    return left.add(right);\n  },\n  sub(left: Decimal, right: Decimal): Decimal {\n    return left.sub(right);\n  },\n  mul(left: Decimal, right: Decimal): Decimal {\n    return left.mul(right);\n  },\n  div(left: Decimal, right: Decimal): Decimal {\n    return left.div(right);\n  },\n  pow(base: Decimal, exponent: Decimal): Decimal {\n    return base.pow(exponent);\n  },\n  abs(value: Decimal): Decimal {\n    return value.abs();\n  },\n  compare(left: Decimal, right: Decimal): number {\n    return left.comparedTo(right);\n  }\n};\n\nconst {celsius} = temperatureWithValueType(DecimalArithmetic);\n\n// Planar Angles needs also an implementation of geometric.\nconst DecimalGeometric: Geometric<Decimal> = {\n    sin(value: Decimal): Decimal {\n        return value.sin();\n    },\n    cos(value: Decimal): Decimal {\n        return value.cos();\n    },\n    tan(value: Decimal): Decimal {\n        return value.tan();\n    },\n    asin(value: Decimal): Decimal {\n        return value.asin();\n    },\n    acos(value: Decimal): Decimal {\n        return value.acos();\n    },\n    atan(value: Decimal): Decimal {\n        return value.atan();\n    },\n    atan2(left: Decimal, right: Decimal): Decimal {\n        return Decimal.atan2(left, right);\n    }\n};\n\nconst {radians, sin, cos} = angleWithValueType(DecimalArithmetic, DecimalGeometric);\n```\n\nFinally, if you want to create your units from scratch using your own arithmetic, you can use the function `makeUnitFactory`.\n\n```ts\nimport * as dimension from './dimension';\nimport {DecimalArithmetic} from './arithmetic'\n\nconst {makeUnit} = makeUnitFactory(DecimalArithmetic);\n\nexport type Money = Quantity<Decimal, dimension.Money>;\nexport const dollars: Unit<Decimal, dimension.Money> = makeUnit('$', dimension.Money);\n```\n\n## Limitations\n\n### Lack of Kinds\n\nTwo types are compatible if they share the same dimensions. That is, they can\nbe reduced to the same base unit equivalents. This can mean that some things\nmay be compatible when the actually should not be:\n\n```ts\nsetFrequency(hertz(100));\nsetFrequency(becquerels(100));\n\nradiationAlarm(grays(2));\nradiationAlarm(sieverts(2));\n```\n\n_ISO 80000-1:2009(E)_ defines these as separate “kinds” but we currently\nprovide no way to check for the kind of a quantity at compile time or\nruntime.\n\nIn some cases we have taken the liberty to model the kind of a quantity as a\ndifferent unit, specifically with planar angles and solid angles. While these\nare strictly a dimensionless quantity of `[L]/[L]` and `[L]^2/[L]^2`\nrespectively, we model these as:\n\n```ts\ntype Angle = {angle: 1};\ntype SolidAngle = {angle: 2};\n```\n\n### Lack of input flexibility\n\nCurrently when declaring quantities you can only use native number as input.\n\n```ts\nimport {meters} from '@buge/ts-units/length';\n// It won't work\nconst length = meters('5');\n```\n\n```ts\nimport {withValueType} from '@buge/ts-units/length';\nconst { meters } = withValueType(DecimalArithmetic);\n// It won't work\nconst length = meters(new Decimal(5));\n```\n\nMoreover, the arithmetic function of `Unit` and `Quantity` also support only native number.\n\nIt could be improve in future\n","readmeFilename":"README.md","keywords":["physical","units","units","measure","measures","measurement","measurements","quantity","quantities","amount","amounts","SI","ISQ","metrology"]}