engineering-unit-converter 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/engineering-unit-converter.js +170 -94
- package/dist/engineering-unit-converter.umd.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/types.d.ts +26 -1
- package/dist/units/delta-temperature.d.ts +9 -0
- package/dist/units/standard-volume-per-volume.d.ts +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ Available units
|
|
|
29
29
|
|
|
30
30
|
- acceleration
|
|
31
31
|
- area
|
|
32
|
+
- deltaTemperature
|
|
32
33
|
- density
|
|
33
34
|
- electricCharge
|
|
34
35
|
- electricCurrent
|
|
@@ -42,6 +43,7 @@ Available units
|
|
|
42
43
|
- pressureManometric
|
|
43
44
|
- pressure
|
|
44
45
|
- speed
|
|
46
|
+
- standardVolumePerVolume
|
|
45
47
|
- standardVolumetricFlow
|
|
46
48
|
- surfaceTension
|
|
47
49
|
- time
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (r, e, n) => (
|
|
4
|
-
class
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var u = (r, e, n) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
|
|
3
|
+
var c = (r, e, n) => (u(r, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
class m {
|
|
5
5
|
constructor(e, n) {
|
|
6
6
|
c(this, "_definitions");
|
|
7
7
|
c(this, "_val");
|
|
@@ -32,7 +32,7 @@ class u {
|
|
|
32
32
|
class s {
|
|
33
33
|
constructor(e, n) {
|
|
34
34
|
c(this, "_internalConverter");
|
|
35
|
-
this._internalConverter = new
|
|
35
|
+
this._internalConverter = new m(e, n);
|
|
36
36
|
}
|
|
37
37
|
from(e) {
|
|
38
38
|
return this._internalConverter.from(e), new i(this._internalConverter);
|
|
@@ -66,7 +66,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
66
66
|
convertValue: 1 / 3.28084
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, N = a(v), V = {
|
|
70
70
|
baseUnit: "m2",
|
|
71
71
|
units: {
|
|
72
72
|
m2: {
|
|
@@ -114,7 +114,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
114
114
|
// Conversion factor from m2 to hectare
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
},
|
|
117
|
+
}, W = a(V), p = {
|
|
118
118
|
baseUnit: "kg/m3",
|
|
119
119
|
units: {
|
|
120
120
|
"kg/m3": {
|
|
@@ -127,7 +127,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
127
127
|
},
|
|
128
128
|
"g/cm3": {
|
|
129
129
|
name: "Gram per cubic centimeter",
|
|
130
|
-
convertValue:
|
|
130
|
+
convertValue: 1e3
|
|
131
131
|
},
|
|
132
132
|
"kg/ft3": {
|
|
133
133
|
name: "Kilogram per cubic foot",
|
|
@@ -138,7 +138,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
138
138
|
convertValue: 1 / 2.20462
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
},
|
|
141
|
+
}, L = a(p), d = {
|
|
142
142
|
baseUnit: "C",
|
|
143
143
|
units: {
|
|
144
144
|
C: {
|
|
@@ -166,7 +166,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
166
166
|
// Conversion factor from C to pC
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
},
|
|
169
|
+
}, H = a(d), g = {
|
|
170
170
|
baseUnit: "A",
|
|
171
171
|
units: {
|
|
172
172
|
A: {
|
|
@@ -194,7 +194,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
194
194
|
// Conversion factor from A to pA
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
},
|
|
197
|
+
}, J = a(g), h = {
|
|
198
198
|
baseUnit: "J",
|
|
199
199
|
units: {
|
|
200
200
|
J: {
|
|
@@ -232,7 +232,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
232
232
|
// Conversion factor from J to BTU
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
},
|
|
235
|
+
}, O = a(h), b = {
|
|
236
236
|
baseUnit: "N",
|
|
237
237
|
units: {
|
|
238
238
|
N: {
|
|
@@ -255,7 +255,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
255
255
|
// Conversion factor from N to kgf
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
},
|
|
258
|
+
}, j = a(b), C = {
|
|
259
259
|
baseUnit: "m",
|
|
260
260
|
units: {
|
|
261
261
|
m: {
|
|
@@ -295,7 +295,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
295
295
|
convertValue: 1e-9
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
},
|
|
298
|
+
}, z = a(C), f = {
|
|
299
299
|
baseUnit: "kg/s",
|
|
300
300
|
units: {
|
|
301
301
|
"kg/s": {
|
|
@@ -320,7 +320,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
320
320
|
},
|
|
321
321
|
"ton/day": {
|
|
322
322
|
name: "Ton per day",
|
|
323
|
-
convertValue:
|
|
323
|
+
convertValue: 0.011574074074074073
|
|
324
324
|
},
|
|
325
325
|
"oz/min": {
|
|
326
326
|
name: "Ounce per minute",
|
|
@@ -328,7 +328,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
328
328
|
},
|
|
329
329
|
"ton/year": {
|
|
330
330
|
name: "Ton per year",
|
|
331
|
-
convertValue:
|
|
331
|
+
convertValue: 31709791983764585e-21
|
|
332
332
|
},
|
|
333
333
|
"lb/s": {
|
|
334
334
|
name: "Pound per second",
|
|
@@ -340,7 +340,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
340
340
|
// 1 day = 86400 seconds
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
},
|
|
343
|
+
}, E = a(f), M = {
|
|
344
344
|
baseUnit: "kg",
|
|
345
345
|
units: {
|
|
346
346
|
kg: {
|
|
@@ -372,7 +372,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
372
372
|
convertValue: 1e-6
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
},
|
|
375
|
+
}, R = a(M), S = {
|
|
376
376
|
baseUnit: "W",
|
|
377
377
|
units: {
|
|
378
378
|
W: {
|
|
@@ -384,6 +384,11 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
384
384
|
convertValue: 1e3
|
|
385
385
|
// Conversion factor from W to kW
|
|
386
386
|
},
|
|
387
|
+
MW: {
|
|
388
|
+
name: "Megawatt",
|
|
389
|
+
convertValue: 1e6
|
|
390
|
+
// Conversion factor from W to MW
|
|
391
|
+
},
|
|
387
392
|
hp: {
|
|
388
393
|
name: "Horsepower",
|
|
389
394
|
convertValue: 745.7
|
|
@@ -394,13 +399,25 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
394
399
|
convertValue: 1 / 3.41214
|
|
395
400
|
// Conversion factor from W to BTU/h
|
|
396
401
|
},
|
|
402
|
+
// Multiples of BTU/h, written against the factor above so that
|
|
403
|
+
// 1 MMBTU/h is exactly 1e6 BTU/h. M = thousand, MM = million.
|
|
404
|
+
"kBTU/h": {
|
|
405
|
+
name: "Thousand British Thermal Units per hour",
|
|
406
|
+
convertValue: 1e3 / 3.41214
|
|
407
|
+
// 1 kBTU/h = 1000 BTU/h
|
|
408
|
+
},
|
|
409
|
+
"MMBTU/h": {
|
|
410
|
+
name: "Million British Thermal Units per hour",
|
|
411
|
+
convertValue: 1e6 / 3.41214
|
|
412
|
+
// 1 MMBTU/h = 1e6 BTU/h
|
|
413
|
+
},
|
|
397
414
|
"cal/s": {
|
|
398
415
|
name: "Calorie per second",
|
|
399
416
|
convertValue: 1 / 0.23884589662749595
|
|
400
417
|
// Conversion factor from W to cal/s
|
|
401
418
|
}
|
|
402
419
|
}
|
|
403
|
-
},
|
|
420
|
+
}, Y = a(S), P = {
|
|
404
421
|
baseUnit: "Pag",
|
|
405
422
|
units: {
|
|
406
423
|
Pag: {
|
|
@@ -438,7 +455,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
438
455
|
// Conversion factor from Pa to kg/cm²
|
|
439
456
|
}
|
|
440
457
|
}
|
|
441
|
-
},
|
|
458
|
+
}, x = a(P), k = {
|
|
442
459
|
baseUnit: "Pa",
|
|
443
460
|
units: {
|
|
444
461
|
Pa: {
|
|
@@ -475,46 +492,50 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
475
492
|
convertValue: 98066.5
|
|
476
493
|
// Conversion factor from Pa to kg/cm²
|
|
477
494
|
},
|
|
495
|
+
// Gauge units: 0 gauge is one atmosphere absolute. `offset` is expressed in
|
|
496
|
+
// the unit's OWN scale, so each one carries 101325 Pa converted into that
|
|
497
|
+
// unit, not the raw Pascal value.
|
|
478
498
|
Pag: {
|
|
479
|
-
name: "Pascal",
|
|
499
|
+
name: "Pascal Gauge",
|
|
480
500
|
convertValue: 1,
|
|
481
|
-
offset: -
|
|
501
|
+
offset: -101325
|
|
502
|
+
// 1 atm in Pa
|
|
482
503
|
},
|
|
483
504
|
kPag: {
|
|
484
|
-
name: "Kilopascal",
|
|
505
|
+
name: "Kilopascal Gauge",
|
|
485
506
|
convertValue: 1e3,
|
|
486
|
-
offset: -
|
|
487
|
-
//
|
|
507
|
+
offset: -101.325
|
|
508
|
+
// 1 atm in kPa
|
|
488
509
|
},
|
|
489
510
|
MPag: {
|
|
490
|
-
name: "Megapascal",
|
|
511
|
+
name: "Megapascal Gauge",
|
|
491
512
|
convertValue: 1e6,
|
|
492
|
-
offset: -
|
|
493
|
-
//
|
|
513
|
+
offset: -0.101325
|
|
514
|
+
// 1 atm in MPa
|
|
494
515
|
},
|
|
495
516
|
barg: {
|
|
496
|
-
name: "Bar",
|
|
517
|
+
name: "Bar Gauge",
|
|
497
518
|
convertValue: 1e5,
|
|
498
|
-
offset: -1
|
|
499
|
-
//
|
|
519
|
+
offset: -1.01325
|
|
520
|
+
// 1 atm in bar
|
|
500
521
|
},
|
|
501
522
|
atmg: {
|
|
502
|
-
name: "Atmosphere",
|
|
523
|
+
name: "Atmosphere Gauge",
|
|
503
524
|
convertValue: 101325,
|
|
504
525
|
offset: -1
|
|
505
|
-
//
|
|
526
|
+
// 1 atm in atm
|
|
506
527
|
},
|
|
507
528
|
psig: {
|
|
508
|
-
name: "Pound per Square Inch",
|
|
529
|
+
name: "Pound per Square Inch Gauge",
|
|
509
530
|
convertValue: 6894.76,
|
|
510
|
-
offset: -
|
|
511
|
-
//
|
|
531
|
+
offset: -101325 / 6894.76
|
|
532
|
+
// 1 atm in psi, 14.6959...
|
|
512
533
|
},
|
|
513
534
|
"kg/cm2g": {
|
|
514
|
-
name: "Kilogram per Square Centimeter",
|
|
535
|
+
name: "Kilogram per Square Centimeter Gauge",
|
|
515
536
|
convertValue: 98066.5,
|
|
516
|
-
offset: -
|
|
517
|
-
//
|
|
537
|
+
offset: -101325 / 98066.5
|
|
538
|
+
// 1 atm in kg/cm², 1.03323...
|
|
518
539
|
},
|
|
519
540
|
ksi: {
|
|
520
541
|
name: "1000 Pound per Square Inch",
|
|
@@ -522,7 +543,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
522
543
|
// Conversion factor from Pa to psi
|
|
523
544
|
}
|
|
524
545
|
}
|
|
525
|
-
},
|
|
546
|
+
}, Q = a(k), F = {
|
|
526
547
|
baseUnit: "m/s",
|
|
527
548
|
units: {
|
|
528
549
|
"m/s": {
|
|
@@ -555,10 +576,10 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
555
576
|
},
|
|
556
577
|
mph: {
|
|
557
578
|
name: "Miles per hour",
|
|
558
|
-
convertValue:
|
|
579
|
+
convertValue: 0.44704
|
|
559
580
|
}
|
|
560
581
|
}
|
|
561
|
-
},
|
|
582
|
+
}, X = a(F), K = {
|
|
562
583
|
baseUnit: "SCMD",
|
|
563
584
|
units: {
|
|
564
585
|
SCMD: {
|
|
@@ -601,7 +622,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
601
622
|
// Conversion factor from SCMD to MMSCFD
|
|
602
623
|
}
|
|
603
624
|
}
|
|
604
|
-
},
|
|
625
|
+
}, Z = a(K), U = {
|
|
605
626
|
baseUnit: "N/m",
|
|
606
627
|
units: {
|
|
607
628
|
"N/m": {
|
|
@@ -629,7 +650,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
629
650
|
convertValue: 10.945427
|
|
630
651
|
}
|
|
631
652
|
}
|
|
632
|
-
},
|
|
653
|
+
}, ee = a(U), y = {
|
|
633
654
|
baseUnit: "sec",
|
|
634
655
|
units: {
|
|
635
656
|
sec: {
|
|
@@ -662,7 +683,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
662
683
|
// Conversion factor from seconds to days
|
|
663
684
|
}
|
|
664
685
|
}
|
|
665
|
-
},
|
|
686
|
+
}, ae = a(y), q = {
|
|
666
687
|
baseUnit: "cP",
|
|
667
688
|
units: {
|
|
668
689
|
cP: {
|
|
@@ -690,7 +711,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
690
711
|
convertValue: 1 / 3.6
|
|
691
712
|
}
|
|
692
713
|
}
|
|
693
|
-
},
|
|
714
|
+
}, ne = a(q), $ = {
|
|
694
715
|
baseUnit: "V",
|
|
695
716
|
// transform: (val) => val * baseValue,
|
|
696
717
|
units: {
|
|
@@ -707,7 +728,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
707
728
|
convertValue: 1e3
|
|
708
729
|
}
|
|
709
730
|
}
|
|
710
|
-
},
|
|
731
|
+
}, re = a($), w = {
|
|
711
732
|
baseUnit: "m3",
|
|
712
733
|
units: {
|
|
713
734
|
m3: {
|
|
@@ -743,7 +764,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
743
764
|
convertValue: 16387e-9
|
|
744
765
|
}
|
|
745
766
|
}
|
|
746
|
-
},
|
|
767
|
+
}, te = a(w), _ = {
|
|
747
768
|
baseUnit: "m3/h",
|
|
748
769
|
units: {
|
|
749
770
|
"m3/h": {
|
|
@@ -783,7 +804,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
783
804
|
convertValue: 378541e-8 * 3600
|
|
784
805
|
}
|
|
785
806
|
}
|
|
786
|
-
},
|
|
807
|
+
}, oe = a(_), G = {
|
|
787
808
|
baseUnit: "C",
|
|
788
809
|
units: {
|
|
789
810
|
C: {
|
|
@@ -804,7 +825,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
804
825
|
// Subtract 273.15 to convert from K to C
|
|
805
826
|
}
|
|
806
827
|
}
|
|
807
|
-
},
|
|
828
|
+
}, ce = a(G), D = {
|
|
808
829
|
baseUnit: "Pa/m",
|
|
809
830
|
units: {
|
|
810
831
|
"Pa/m": {
|
|
@@ -822,7 +843,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
822
843
|
// 1 kPa = 1000 Pa
|
|
823
844
|
},
|
|
824
845
|
"kPa/km": {
|
|
825
|
-
name: "Kilopascal per
|
|
846
|
+
name: "Kilopascal per Kilometer",
|
|
826
847
|
convertValue: 1
|
|
827
848
|
},
|
|
828
849
|
"bar/m": {
|
|
@@ -837,7 +858,7 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
837
858
|
},
|
|
838
859
|
"psi/ft": {
|
|
839
860
|
name: "Pound per Square Inch per Foot",
|
|
840
|
-
convertValue:
|
|
861
|
+
convertValue: 22620.594793858265
|
|
841
862
|
// 1 psi = 6894.76 Pa, 1 ft = 0.3048 m
|
|
842
863
|
},
|
|
843
864
|
"psi/m": {
|
|
@@ -865,39 +886,36 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
865
886
|
convertValue: 98.0665
|
|
866
887
|
// 1 kg/cm² = 98066.5 Pa / 1000 m
|
|
867
888
|
},
|
|
868
|
-
// Gauge
|
|
889
|
+
// Gauge gradients. No offset: a gradient is a pressure DIFFERENCE per
|
|
890
|
+
// length, so the atmospheric datum cancels — 1 barg/m is exactly
|
|
891
|
+
// 1 bar/m. These keys are aliases of their absolute counterparts.
|
|
869
892
|
"barg/m": {
|
|
870
893
|
name: "Bar Gauge per Meter",
|
|
871
|
-
convertValue: 1e5
|
|
872
|
-
|
|
873
|
-
// Remove atmospheric pressure
|
|
894
|
+
convertValue: 1e5
|
|
895
|
+
// 1 bar = 100,000 Pa
|
|
874
896
|
},
|
|
875
897
|
"psig/ft": {
|
|
876
898
|
name: "Pound per Square Inch Gauge per Foot",
|
|
877
|
-
convertValue:
|
|
878
|
-
|
|
879
|
-
// Remove atmospheric pressure in Pa
|
|
899
|
+
convertValue: 22620.594793858265
|
|
900
|
+
// 1 psi = 6894.76 Pa, 1 ft = 0.3048 m
|
|
880
901
|
},
|
|
881
902
|
"psig/m": {
|
|
882
903
|
name: "Pound per Square Inch Gauge per Meter",
|
|
883
|
-
convertValue: 6894.76
|
|
884
|
-
|
|
885
|
-
// Remove atmospheric pressure in Pa
|
|
904
|
+
convertValue: 6894.76
|
|
905
|
+
// 1 psi = 6894.76 Pa
|
|
886
906
|
},
|
|
887
907
|
"kg/cm2g/m": {
|
|
888
908
|
name: "Kilogram per Square Centimeter Gauge per Meter",
|
|
889
|
-
convertValue: 98066.5
|
|
890
|
-
|
|
891
|
-
// Remove atmospheric pressure in Pa
|
|
909
|
+
convertValue: 98066.5
|
|
910
|
+
// 1 kg/cm² = 98066.5 Pa
|
|
892
911
|
},
|
|
893
912
|
"kg/cm2g/km": {
|
|
894
913
|
name: "Kilogram per Square Centimeter Gauge per Kilometer",
|
|
895
|
-
convertValue: 98.0665
|
|
896
|
-
|
|
897
|
-
// Remove atmospheric pressure divided by 1000
|
|
914
|
+
convertValue: 98.0665
|
|
915
|
+
// 1 kg/cm² = 98066.5 Pa / 1000 m
|
|
898
916
|
}
|
|
899
917
|
}
|
|
900
|
-
},
|
|
918
|
+
}, le = a(D), T = {
|
|
901
919
|
baseUnit: "kg/Sm3",
|
|
902
920
|
units: {
|
|
903
921
|
"kg/Sm3": {
|
|
@@ -950,30 +968,88 @@ const a = (r) => (e) => new s(e, r), v = {
|
|
|
950
968
|
// Conversion factor from kg/Sm3 to kg/MMSCF
|
|
951
969
|
}
|
|
952
970
|
}
|
|
953
|
-
},
|
|
971
|
+
}, ue = a(T), B = {
|
|
972
|
+
baseUnit: "Sm3/m3",
|
|
973
|
+
units: {
|
|
974
|
+
"Sm3/m3": {
|
|
975
|
+
name: "Standard Cubic Meter per Cubic Meter",
|
|
976
|
+
convertValue: 1
|
|
977
|
+
},
|
|
978
|
+
"Sm3/L": {
|
|
979
|
+
name: "Standard Cubic Meter per Liter",
|
|
980
|
+
convertValue: 1e3
|
|
981
|
+
// 1 m3 = 1000 L
|
|
982
|
+
},
|
|
983
|
+
"SCF/m3": {
|
|
984
|
+
name: "Standard Cubic Foot per Cubic Meter",
|
|
985
|
+
convertValue: 0.3048 ** 3
|
|
986
|
+
// 1 SCF = 0.028316846592 Sm3
|
|
987
|
+
},
|
|
988
|
+
"SCF/gal": {
|
|
989
|
+
name: "Standard Cubic Foot per US Gallon",
|
|
990
|
+
convertValue: 0.3048 ** 3 / 0.003785411784
|
|
991
|
+
// 1 ft3 = 7.4805 US gal
|
|
992
|
+
},
|
|
993
|
+
"SCF/bbl": {
|
|
994
|
+
name: "Standard Cubic Foot per Barrel",
|
|
995
|
+
convertValue: 0.3048 ** 3 / (42 * 0.003785411784)
|
|
996
|
+
// 1 bbl = 42 US gal
|
|
997
|
+
},
|
|
998
|
+
"MSCF/bbl": {
|
|
999
|
+
name: "Thousand Standard Cubic Feet per Barrel",
|
|
1000
|
+
convertValue: 0.3048 ** 3 / (42 * 0.003785411784) * 1e3
|
|
1001
|
+
// M = thousand SCF
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}, me = a(B), I = {
|
|
1005
|
+
baseUnit: "C",
|
|
1006
|
+
units: {
|
|
1007
|
+
C: {
|
|
1008
|
+
name: "Delta Celsius",
|
|
1009
|
+
convertValue: 1
|
|
1010
|
+
},
|
|
1011
|
+
K: {
|
|
1012
|
+
name: "Delta Kelvin",
|
|
1013
|
+
convertValue: 1
|
|
1014
|
+
// a kelvin interval is exactly a celsius interval
|
|
1015
|
+
},
|
|
1016
|
+
F: {
|
|
1017
|
+
name: "Delta Fahrenheit",
|
|
1018
|
+
convertValue: 5 / 9
|
|
1019
|
+
// 1 F interval = 5/9 C interval
|
|
1020
|
+
},
|
|
1021
|
+
R: {
|
|
1022
|
+
name: "Delta Rankine",
|
|
1023
|
+
convertValue: 5 / 9
|
|
1024
|
+
// a rankine interval is exactly a fahrenheit interval
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
}, se = a(I);
|
|
954
1028
|
export {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
H as
|
|
960
|
-
J as
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
z as
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
Z as
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
ne as
|
|
978
|
-
re as
|
|
1029
|
+
N as acceleration,
|
|
1030
|
+
W as area,
|
|
1031
|
+
se as deltaTemperature,
|
|
1032
|
+
L as density,
|
|
1033
|
+
H as electricCharge,
|
|
1034
|
+
J as electricCurrent,
|
|
1035
|
+
O as energy,
|
|
1036
|
+
j as force,
|
|
1037
|
+
z as length,
|
|
1038
|
+
R as mass,
|
|
1039
|
+
E as massFlow,
|
|
1040
|
+
ue as massPerStandardVolume,
|
|
1041
|
+
Y as power,
|
|
1042
|
+
Q as pressure,
|
|
1043
|
+
x as pressureManometric,
|
|
1044
|
+
le as pressurePerLength,
|
|
1045
|
+
X as speed,
|
|
1046
|
+
me as standardVolumePerVolume,
|
|
1047
|
+
Z as standardVolumetricFlow,
|
|
1048
|
+
ce as temperature,
|
|
1049
|
+
ae as time,
|
|
1050
|
+
ee as torque,
|
|
1051
|
+
ne as viscosity,
|
|
1052
|
+
re as voltage,
|
|
1053
|
+
te as volume,
|
|
1054
|
+
oe as volumetricFlow
|
|
979
1055
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["engineering-unit-converter"]={}))})(this,function(e){"use strict";var Z=Object.defineProperty;var x=(e,t,o)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var u=(e,t,o)=>(x(e,typeof t!="symbol"?t+"":t,o),o);class t{constructor(a,r){u(this,"_definitions");u(this,"_val");u(this,"_fromUnit",null);this._definitions=r,this._val=a}from(a){return this._checkUnit(a),this._fromUnit=a,this}to(a){if(!this._fromUnit)throw new Error('Please specify the "from" unit using the from() method before calling to().');this._checkUnit(a);const r=this._getUnit(this._fromUnit),c=this._getUnit(a);let l=this._val;return r.offset!==0&&(l-=r.offset),l=l*r.convertValue/c.convertValue,c.offset!==0&&(l+=c.offset),l}_getUnit(a){const r=this._definitions.units[a],c=r.offset??0;return{convertValue:r.convertValue,offset:c}}_checkUnit(a){const r=Object.keys(this._definitions.units);if(!r.includes(a))throw new Error(`Invalid unit "${a}". Available units: ${r.join(", ")}`)}}class o{constructor(a,r){u(this,"_internalConverter");this._internalConverter=new t(a,r)}from(a){return this._internalConverter.from(a),new i(this._internalConverter)}}class i{constructor(a){this._internalConverter=a}to(a){return this._internalConverter.to(a)}}const n=m=>a=>new o(a,m),s={baseUnit:"m/s2",units:{"m/s2":{name:"Meter per Second Squared",convertValue:1},"km/s2":{name:"Kilometer per Second Squared",convertValue:1e3},"cm/s2":{name:"Centimeter per Second Squared",convertValue:1/100},"ft/s2":{name:"Foot per Second Squared",convertValue:1/3.28084}}},v=n(s),V={baseUnit:"m2",units:{m2:{name:"Square Meter",convertValue:1},km2:{name:"Square Kilometer",convertValue:1/1e-6},cm2:{name:"Square Centimeter",convertValue:1/1e4},mm2:{name:"Square Millimeter",convertValue:1/1e6},sqin:{name:"Square Inch",convertValue:1/1550.0031},sqft:{name:"Square Foot",convertValue:1/10.763888889},sqyd:{name:"Square Yard",convertValue:1/1.1959876543333339},acre:{name:"Acre",convertValue:1/247105e-9},hectare:{name:"Hectare",convertValue:1/1e-4}}},d=n(V),p={baseUnit:"kg/m3",units:{"kg/m3":{name:"Kilogram per cubic meter",convertValue:1},"lb/ft3":{name:"Pound per cubic foot",convertValue:1/.062427962},"g/cm3":{name:"Gram per cubic centimeter",convertValue:.001},"kg/ft3":{name:"Kilogram per cubic foot",convertValue:1/.0283168},"lb/m3":{name:"Pound per cubic meter",convertValue:1/2.20462}}},g=n(p),f=n({baseUnit:"C",units:{C:{name:"Coulomb",convertValue:1},mC:{name:"MilliCoulomb",convertValue:.001},μC:{name:"MicroCoulomb",convertValue:1e-6},nC:{name:"NanoCoulomb",convertValue:1e-9},pC:{name:"PicoCoulomb",convertValue:1e-12}}}),h=n({baseUnit:"A",units:{A:{name:"Ampere",convertValue:1},mA:{name:"Milliampere",convertValue:.001},μA:{name:"Microampere",convertValue:1e-6},nA:{name:"Nanoampere",convertValue:1e-9},pA:{name:"Picoampere",convertValue:1e-12}}}),b={baseUnit:"J",units:{J:{name:"Joule",convertValue:1},kJ:{name:"Kilojoule",convertValue:1/.001},cal:{name:"Calorie",convertValue:1/.239006},kcal:{name:"Kilocalorie",convertValue:1/239006e-9},Wh:{name:"Watt-hour",convertValue:1/277778e-9},kWh:{name:"Kilowatt-hour",convertValue:1/277778e-12},BTU:{name:"British Thermal Unit",convertValue:1/947817e-9}}},C=n(b),M={baseUnit:"N",units:{N:{name:"Newton",convertValue:1},dyn:{name:"Dyne",convertValue:1e-5},lbf:{name:"Pound-force",convertValue:1/.224809},kgf:{name:"Kilogram-force",convertValue:9.80665}}},S=n(M),P=n({baseUnit:"m",units:{m:{name:"Meter",convertValue:1},km:{name:"Kilometer",convertValue:1e3},mm:{name:"Millimeter",convertValue:.001},cm:{name:"Centimeter",convertValue:.01},in:{name:"Inch",convertValue:.0254},ft:{name:"Foot",convertValue:.3048},um:{name:"Micrometer",convertValue:1e-6},nm:{name:"Nanometer",convertValue:1e-9}}}),k={baseUnit:"kg/s",units:{"kg/s":{name:"Kilogram per second",convertValue:1},"kg/h":{name:"Kilogram per hour",convertValue:1/3600},"lb/day":{name:"Pound per day",convertValue:1/190479},"g/s":{name:"Gram per second",convertValue:.001},"lb/h":{name:"Pound per hour",convertValue:1/(190479/24)},"ton/day":{name:"Ton per day",convertValue:1/(34762.5/365)},"oz/min":{name:"Ounce per minute",convertValue:1/2116.4394433764},"ton/year":{name:"Ton per year",convertValue:1/34762.5},"lb/s":{name:"Pound per second",convertValue:1/(190479/86400)},"kg/day":{name:"Kilogram per day",convertValue:1/86400}}},y=n(k),K=n({baseUnit:"kg",units:{kg:{name:"Kilogram",convertValue:1},g:{name:"Gram",convertValue:.001},lb:{name:"Pound",convertValue:.453592},oz:{name:"Ounce",convertValue:.0283495},ton:{name:"Ton",convertValue:1e3},mg:{name:"Miligram",convertValue:1e-6}}}),F={baseUnit:"W",units:{W:{name:"Watt",convertValue:1},kW:{name:"Kilowatt",convertValue:1e3},hp:{name:"Horsepower",convertValue:745.7},"BTU/h":{name:"British Thermal Unit per hour",convertValue:1/3.41214},"cal/s":{name:"Calorie per second",convertValue:1/.23884589662749595}}},U=n(F),q=n({baseUnit:"Pag",units:{Pag:{name:"Pascal",convertValue:1},kPag:{name:"Kilopascal",convertValue:1e3},MPag:{name:"Megapascal",convertValue:1e6},barg:{name:"Bar",convertValue:1e5},atmg:{name:"Atmosphere",convertValue:101325},psig:{name:"Pound per Square Inch",convertValue:6894.76},"kg/cm2g":{name:"Kilogram per Square Centimeter",convertValue:98066.5}}}),$={baseUnit:"Pa",units:{Pa:{name:"Pascal",convertValue:1},kPa:{name:"Kilopascal",convertValue:1e3},MPa:{name:"Megapascal",convertValue:1e6},bar:{name:"Bar",convertValue:1e5},atm:{name:"Atmosphere",convertValue:101325},psi:{name:"Pound per Square Inch",convertValue:6894.76},"kg/cm2":{name:"Kilogram per Square Centimeter",convertValue:98066.5},Pag:{name:"Pascal",convertValue:1,offset:-1},kPag:{name:"Kilopascal",convertValue:1e3,offset:-1},MPag:{name:"Megapascal",convertValue:1e6,offset:-1},barg:{name:"Bar",convertValue:1e5,offset:-1},atmg:{name:"Atmosphere",convertValue:101325,offset:-1},psig:{name:"Pound per Square Inch",convertValue:6894.76,offset:-1},"kg/cm2g":{name:"Kilogram per Square Centimeter",convertValue:98066.5,offset:-1},ksi:{name:"1000 Pound per Square Inch",convertValue:6894.76*1e3}}},w=n($),_={baseUnit:"m/s",units:{"m/s":{name:"Meter per second",convertValue:1},"km/h":{name:"Kilometer per hour",convertValue:.277778},"ft/s":{name:"Foot per second",convertValue:.3048},"mi/h":{name:"Mile per hour",convertValue:.44704},knot:{name:"Knot",convertValue:.514444},"m/h":{name:"Meter per hour",convertValue:1/3600},"ft/h":{name:"Foot per hour",convertValue:1/11811},mph:{name:"Miles per hour",convertValue:2.23694}}},D=n(_),I={baseUnit:"SCMD",units:{SCMD:{name:"Standard Cubic Meters per Day",convertValue:1},SCFD:{name:"Standard Cubic Feet per Day",convertValue:1/35.3147},MSCMD:{name:"Million Standard Cubic Meters per Day",convertValue:1e3},MMSCMD:{name:"Million Million Standard Cubic Meters per Day",convertValue:1e6},MSCFD:{name:"Million Standard Cubic Feet per Day",convertValue:1/35.3147*1e3},MMSCFD:{name:"Million Million Standard Cubic Feet per Day",convertValue:1/35.3147*1e6},"Sm3/h":{name:"Standard Cubic Meter per Hour",convertValue:24},"Sft3/h":{name:"Standard Cubic Feet per Hour",convertValue:1/35.3147*24}}},A=n(I),G=n({baseUnit:"N/m",units:{"N/m":{name:"Newton per Meter",convertValue:1},"dyn/cm":{name:"Dyne per Centimeter",convertValue:.001},"lbf/ft":{name:"Pound-force per Foot",convertValue:14.5939},"mN/m":{name:"Millinewton per Meter",convertValue:.001},"lbf/in":{name:"Pound-force per Inch",convertValue:175.126836},"ozf/in":{name:"Ounce-force per Inch",convertValue:10.945427}}}),T={baseUnit:"sec",units:{sec:{name:"Second",convertValue:1},min:{name:"Minute",convertValue:60},hr:{name:"Hour",convertValue:3600},day:{name:"Day",convertValue:86400},month:{name:"Month",convertValue:86400*30},year:{name:"Year",convertValue:86400*365}}},B=n(T),N={baseUnit:"cP",units:{cP:{name:"Centipoise",convertValue:1},Pas:{name:"Pascal second",convertValue:1/.001},"lb/fts":{name:"Pound per second-foot",convertValue:1/.000671968994813},"kg/ms":{name:"Kilogram per meter-second-hour",convertValue:1/.001},"lb/fth":{name:"Pound per hour-foot",convertValue:1/2.4190883105},"kg/mh":{name:"Kilogram per meter-second-meter",convertValue:1/3.6}}},W=n(N),j=n({baseUnit:"V",units:{V:{name:"Volt",convertValue:1},mV:{name:"Millivolt",convertValue:.001},kV:{name:"Kilovolt",convertValue:1e3}}}),H={baseUnit:"m3",units:{m3:{name:"Cubic Meter",convertValue:1},liter:{name:"Liter",convertValue:.001},cm3:{name:"Cubic Centimeter",convertValue:1e-6},mm3:{name:"Cubic Millimeter",convertValue:1e-9},gallon:{name:"Gallon",convertValue:.00454609},quart:{name:"Quart",convertValue:1/879.877},ft3:{name:"Cubic Feet",convertValue:.0283168},in3:{name:"Cubic inch",convertValue:16387e-9}}},O=n(H),J={baseUnit:"m3/h",units:{"m3/h":{name:"Cubic meter per hour",convertValue:1},"m3/day":{name:"Cubic meter per day",convertValue:1/24},"ft3/h":{name:"Cubic foot per hour",convertValue:.0283168},"ft3/day":{name:"Cubic foot per day",convertValue:.0283168/24},"gal/h":{name:"Gallon per hour",convertValue:.00378541},"gal/day":{name:"Gallon per day",convertValue:.00378541/24},"m3/s":{name:"Cubic meter per second",convertValue:3600},"ft3/s":{name:"Cubic foot per second",convertValue:1/.00980963},"gal/s":{name:"Gallon per second",convertValue:.00378541*3600}}},L=n(J),z={baseUnit:"C",units:{C:{name:"Celsius",convertValue:1,offset:0},F:{name:"Fahrenheit",convertValue:5/9,offset:32},K:{name:"Kelvin",convertValue:1,offset:273.15}}},E=n(z),Y={baseUnit:"Pa/m",units:{"Pa/m":{name:"Pascal per Meter",convertValue:1},"Pa/km":{name:"Pascal per Kilometer",convertValue:1/1e3},"kPa/m":{name:"Kilopascal per Meter",convertValue:1e3},"kPa/km":{name:"Kilopascal per Meter",convertValue:1},"bar/m":{name:"Bar per Meter",convertValue:1e5},"bar/km":{name:"Bar per Kilometer",convertValue:100},"psi/ft":{name:"Pound per Square Inch per Foot",convertValue:6894.76/3.28084},"psi/m":{name:"Pound per Square Inch per Meter",convertValue:6894.76},"atm/m":{name:"Atmosphere per Meter",convertValue:101325},"atm/km":{name:"Atmosphere per Kilometer",convertValue:101.325},"kg/cm2/m":{name:"Kilogram per Square Centimeter per Meter",convertValue:98066.5},"kg/cm2/km":{name:"Kilogram per Square Centimeter per Kilometer",convertValue:98.0665},"barg/m":{name:"Bar Gauge per Meter",convertValue:1e5,offset:-101325},"psig/ft":{name:"Pound per Square Inch Gauge per Foot",convertValue:6894.76/3.28084,offset:-101325},"psig/m":{name:"Pound per Square Inch Gauge per Meter",convertValue:6894.76,offset:-101325},"kg/cm2g/m":{name:"Kilogram per Square Centimeter Gauge per Meter",convertValue:98066.5,offset:-101325},"kg/cm2g/km":{name:"Kilogram per Square Centimeter Gauge per Kilometer",convertValue:98.0665,offset:-101.325}}},Q=n(Y),R={baseUnit:"kg/Sm3",units:{"kg/Sm3":{name:"Kilogram per Standard Cubic Meter",convertValue:1},"g/Sm3":{name:"Gram per Standard Cubic Meter",convertValue:.001},"mg/Sm3":{name:"Milligram per Standard Cubic Meter",convertValue:1e-6},"kg/MSm3":{name:"Kilogram per Thousand Standard Cubic Meters",convertValue:1/1e3},"kg/MMSm3":{name:"Kilogram per Million Standard Cubic Meters",convertValue:1/1e6},"g/SCF":{name:"Gram per Standard Cubic Foot",convertValue:.001*35.3147},"lb/SCF":{name:"Pound per Standard Cubic Foot",convertValue:.453592*35.3147},"lb/MSCF":{name:"Pound per Thousand Standard Cubic Feet",convertValue:.453592*35.3147/1e3},"lb/MMSCF":{name:"Pound per Million Standard Cubic Feet",convertValue:.453592*35.3147/1e6},"kg/MMSCF":{name:"Kilogram per Million Standard Cubic Feet",convertValue:35.3147/1e6}}},X=n(R);e.acceleration=v,e.area=d,e.density=g,e.electricCharge=f,e.electricCurrent=h,e.energy=C,e.force=S,e.length=P,e.mass=K,e.massFlow=y,e.massPerStandardVolume=X,e.power=U,e.pressure=w,e.pressureManometric=q,e.pressurePerLength=Q,e.speed=D,e.standardVolumetricFlow=A,e.temperature=E,e.time=B,e.torque=G,e.viscosity=W,e.voltage=j,e.volume=O,e.volumetricFlow=L,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e["engineering-unit-converter"]={}))})(this,function(e){"use strict";var ae=Object.defineProperty;var re=(e,r,o)=>r in e?ae(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var l=(e,r,o)=>(re(e,typeof r!="symbol"?r+"":r,o),o);class r{constructor(a,t){l(this,"_definitions");l(this,"_val");l(this,"_fromUnit",null);this._definitions=t,this._val=a}from(a){return this._checkUnit(a),this._fromUnit=a,this}to(a){if(!this._fromUnit)throw new Error('Please specify the "from" unit using the from() method before calling to().');this._checkUnit(a);const t=this._getUnit(this._fromUnit),c=this._getUnit(a);let u=this._val;return t.offset!==0&&(u-=t.offset),u=u*t.convertValue/c.convertValue,c.offset!==0&&(u+=c.offset),u}_getUnit(a){const t=this._definitions.units[a],c=t.offset??0;return{convertValue:t.convertValue,offset:c}}_checkUnit(a){const t=Object.keys(this._definitions.units);if(!t.includes(a))throw new Error(`Invalid unit "${a}". Available units: ${t.join(", ")}`)}}class o{constructor(a,t){l(this,"_internalConverter");this._internalConverter=new r(a,t)}from(a){return this._internalConverter.from(a),new i(this._internalConverter)}}class i{constructor(a){this._internalConverter=a}to(a){return this._internalConverter.to(a)}}const n=m=>a=>new o(a,m),s={baseUnit:"m/s2",units:{"m/s2":{name:"Meter per Second Squared",convertValue:1},"km/s2":{name:"Kilometer per Second Squared",convertValue:1e3},"cm/s2":{name:"Centimeter per Second Squared",convertValue:1/100},"ft/s2":{name:"Foot per Second Squared",convertValue:1/3.28084}}},v=n(s),V={baseUnit:"m2",units:{m2:{name:"Square Meter",convertValue:1},km2:{name:"Square Kilometer",convertValue:1/1e-6},cm2:{name:"Square Centimeter",convertValue:1/1e4},mm2:{name:"Square Millimeter",convertValue:1/1e6},sqin:{name:"Square Inch",convertValue:1/1550.0031},sqft:{name:"Square Foot",convertValue:1/10.763888889},sqyd:{name:"Square Yard",convertValue:1/1.1959876543333339},acre:{name:"Acre",convertValue:1/247105e-9},hectare:{name:"Hectare",convertValue:1/1e-4}}},d=n(V),p={baseUnit:"kg/m3",units:{"kg/m3":{name:"Kilogram per cubic meter",convertValue:1},"lb/ft3":{name:"Pound per cubic foot",convertValue:1/.062427962},"g/cm3":{name:"Gram per cubic centimeter",convertValue:1e3},"kg/ft3":{name:"Kilogram per cubic foot",convertValue:1/.0283168},"lb/m3":{name:"Pound per cubic meter",convertValue:1/2.20462}}},g=n(p),h=n({baseUnit:"C",units:{C:{name:"Coulomb",convertValue:1},mC:{name:"MilliCoulomb",convertValue:.001},μC:{name:"MicroCoulomb",convertValue:1e-6},nC:{name:"NanoCoulomb",convertValue:1e-9},pC:{name:"PicoCoulomb",convertValue:1e-12}}}),b=n({baseUnit:"A",units:{A:{name:"Ampere",convertValue:1},mA:{name:"Milliampere",convertValue:.001},μA:{name:"Microampere",convertValue:1e-6},nA:{name:"Nanoampere",convertValue:1e-9},pA:{name:"Picoampere",convertValue:1e-12}}}),C={baseUnit:"J",units:{J:{name:"Joule",convertValue:1},kJ:{name:"Kilojoule",convertValue:1/.001},cal:{name:"Calorie",convertValue:1/.239006},kcal:{name:"Kilocalorie",convertValue:1/239006e-9},Wh:{name:"Watt-hour",convertValue:1/277778e-9},kWh:{name:"Kilowatt-hour",convertValue:1/277778e-12},BTU:{name:"British Thermal Unit",convertValue:1/947817e-9}}},f=n(C),M={baseUnit:"N",units:{N:{name:"Newton",convertValue:1},dyn:{name:"Dyne",convertValue:1e-5},lbf:{name:"Pound-force",convertValue:1/.224809},kgf:{name:"Kilogram-force",convertValue:9.80665}}},S=n(M),P=n({baseUnit:"m",units:{m:{name:"Meter",convertValue:1},km:{name:"Kilometer",convertValue:1e3},mm:{name:"Millimeter",convertValue:.001},cm:{name:"Centimeter",convertValue:.01},in:{name:"Inch",convertValue:.0254},ft:{name:"Foot",convertValue:.3048},um:{name:"Micrometer",convertValue:1e-6},nm:{name:"Nanometer",convertValue:1e-9}}}),k={baseUnit:"kg/s",units:{"kg/s":{name:"Kilogram per second",convertValue:1},"kg/h":{name:"Kilogram per hour",convertValue:1/3600},"lb/day":{name:"Pound per day",convertValue:1/190479},"g/s":{name:"Gram per second",convertValue:.001},"lb/h":{name:"Pound per hour",convertValue:1/(190479/24)},"ton/day":{name:"Ton per day",convertValue:.011574074074074073},"oz/min":{name:"Ounce per minute",convertValue:1/2116.4394433764},"ton/year":{name:"Ton per year",convertValue:31709791983764585e-21},"lb/s":{name:"Pound per second",convertValue:1/(190479/86400)},"kg/day":{name:"Kilogram per day",convertValue:1/86400}}},F=n(k),K=n({baseUnit:"kg",units:{kg:{name:"Kilogram",convertValue:1},g:{name:"Gram",convertValue:.001},lb:{name:"Pound",convertValue:.453592},oz:{name:"Ounce",convertValue:.0283495},ton:{name:"Ton",convertValue:1e3},mg:{name:"Miligram",convertValue:1e-6}}}),U={baseUnit:"W",units:{W:{name:"Watt",convertValue:1},kW:{name:"Kilowatt",convertValue:1e3},MW:{name:"Megawatt",convertValue:1e6},hp:{name:"Horsepower",convertValue:745.7},"BTU/h":{name:"British Thermal Unit per hour",convertValue:1/3.41214},"kBTU/h":{name:"Thousand British Thermal Units per hour",convertValue:1e3/3.41214},"MMBTU/h":{name:"Million British Thermal Units per hour",convertValue:1e6/3.41214},"cal/s":{name:"Calorie per second",convertValue:1/.23884589662749595}}},y=n(U),q=n({baseUnit:"Pag",units:{Pag:{name:"Pascal",convertValue:1},kPag:{name:"Kilopascal",convertValue:1e3},MPag:{name:"Megapascal",convertValue:1e6},barg:{name:"Bar",convertValue:1e5},atmg:{name:"Atmosphere",convertValue:101325},psig:{name:"Pound per Square Inch",convertValue:6894.76},"kg/cm2g":{name:"Kilogram per Square Centimeter",convertValue:98066.5}}}),$={baseUnit:"Pa",units:{Pa:{name:"Pascal",convertValue:1},kPa:{name:"Kilopascal",convertValue:1e3},MPa:{name:"Megapascal",convertValue:1e6},bar:{name:"Bar",convertValue:1e5},atm:{name:"Atmosphere",convertValue:101325},psi:{name:"Pound per Square Inch",convertValue:6894.76},"kg/cm2":{name:"Kilogram per Square Centimeter",convertValue:98066.5},Pag:{name:"Pascal Gauge",convertValue:1,offset:-101325},kPag:{name:"Kilopascal Gauge",convertValue:1e3,offset:-101.325},MPag:{name:"Megapascal Gauge",convertValue:1e6,offset:-.101325},barg:{name:"Bar Gauge",convertValue:1e5,offset:-1.01325},atmg:{name:"Atmosphere Gauge",convertValue:101325,offset:-1},psig:{name:"Pound per Square Inch Gauge",convertValue:6894.76,offset:-101325/6894.76},"kg/cm2g":{name:"Kilogram per Square Centimeter Gauge",convertValue:98066.5,offset:-101325/98066.5},ksi:{name:"1000 Pound per Square Inch",convertValue:6894.76*1e3}}},w=n($),_={baseUnit:"m/s",units:{"m/s":{name:"Meter per second",convertValue:1},"km/h":{name:"Kilometer per hour",convertValue:.277778},"ft/s":{name:"Foot per second",convertValue:.3048},"mi/h":{name:"Mile per hour",convertValue:.44704},knot:{name:"Knot",convertValue:.514444},"m/h":{name:"Meter per hour",convertValue:1/3600},"ft/h":{name:"Foot per hour",convertValue:1/11811},mph:{name:"Miles per hour",convertValue:.44704}}},G=n(_),T={baseUnit:"SCMD",units:{SCMD:{name:"Standard Cubic Meters per Day",convertValue:1},SCFD:{name:"Standard Cubic Feet per Day",convertValue:1/35.3147},MSCMD:{name:"Million Standard Cubic Meters per Day",convertValue:1e3},MMSCMD:{name:"Million Million Standard Cubic Meters per Day",convertValue:1e6},MSCFD:{name:"Million Standard Cubic Feet per Day",convertValue:1/35.3147*1e3},MMSCFD:{name:"Million Million Standard Cubic Feet per Day",convertValue:1/35.3147*1e6},"Sm3/h":{name:"Standard Cubic Meter per Hour",convertValue:24},"Sft3/h":{name:"Standard Cubic Feet per Hour",convertValue:1/35.3147*24}}},D=n(T),B=n({baseUnit:"N/m",units:{"N/m":{name:"Newton per Meter",convertValue:1},"dyn/cm":{name:"Dyne per Centimeter",convertValue:.001},"lbf/ft":{name:"Pound-force per Foot",convertValue:14.5939},"mN/m":{name:"Millinewton per Meter",convertValue:.001},"lbf/in":{name:"Pound-force per Inch",convertValue:175.126836},"ozf/in":{name:"Ounce-force per Inch",convertValue:10.945427}}}),I={baseUnit:"sec",units:{sec:{name:"Second",convertValue:1},min:{name:"Minute",convertValue:60},hr:{name:"Hour",convertValue:3600},day:{name:"Day",convertValue:86400},month:{name:"Month",convertValue:86400*30},year:{name:"Year",convertValue:86400*365}}},A=n(I),N={baseUnit:"cP",units:{cP:{name:"Centipoise",convertValue:1},Pas:{name:"Pascal second",convertValue:1/.001},"lb/fts":{name:"Pound per second-foot",convertValue:1/.000671968994813},"kg/ms":{name:"Kilogram per meter-second-hour",convertValue:1/.001},"lb/fth":{name:"Pound per hour-foot",convertValue:1/2.4190883105},"kg/mh":{name:"Kilogram per meter-second-meter",convertValue:1/3.6}}},W=n(N),L=n({baseUnit:"V",units:{V:{name:"Volt",convertValue:1},mV:{name:"Millivolt",convertValue:.001},kV:{name:"Kilovolt",convertValue:1e3}}}),j={baseUnit:"m3",units:{m3:{name:"Cubic Meter",convertValue:1},liter:{name:"Liter",convertValue:.001},cm3:{name:"Cubic Centimeter",convertValue:1e-6},mm3:{name:"Cubic Millimeter",convertValue:1e-9},gallon:{name:"Gallon",convertValue:.00454609},quart:{name:"Quart",convertValue:1/879.877},ft3:{name:"Cubic Feet",convertValue:.0283168},in3:{name:"Cubic inch",convertValue:16387e-9}}},H=n(j),O={baseUnit:"m3/h",units:{"m3/h":{name:"Cubic meter per hour",convertValue:1},"m3/day":{name:"Cubic meter per day",convertValue:1/24},"ft3/h":{name:"Cubic foot per hour",convertValue:.0283168},"ft3/day":{name:"Cubic foot per day",convertValue:.0283168/24},"gal/h":{name:"Gallon per hour",convertValue:.00378541},"gal/day":{name:"Gallon per day",convertValue:.00378541/24},"m3/s":{name:"Cubic meter per second",convertValue:3600},"ft3/s":{name:"Cubic foot per second",convertValue:1/.00980963},"gal/s":{name:"Gallon per second",convertValue:.00378541*3600}}},J=n(O),z={baseUnit:"C",units:{C:{name:"Celsius",convertValue:1,offset:0},F:{name:"Fahrenheit",convertValue:5/9,offset:32},K:{name:"Kelvin",convertValue:1,offset:273.15}}},E=n(z),R={baseUnit:"Pa/m",units:{"Pa/m":{name:"Pascal per Meter",convertValue:1},"Pa/km":{name:"Pascal per Kilometer",convertValue:1/1e3},"kPa/m":{name:"Kilopascal per Meter",convertValue:1e3},"kPa/km":{name:"Kilopascal per Kilometer",convertValue:1},"bar/m":{name:"Bar per Meter",convertValue:1e5},"bar/km":{name:"Bar per Kilometer",convertValue:100},"psi/ft":{name:"Pound per Square Inch per Foot",convertValue:22620.594793858265},"psi/m":{name:"Pound per Square Inch per Meter",convertValue:6894.76},"atm/m":{name:"Atmosphere per Meter",convertValue:101325},"atm/km":{name:"Atmosphere per Kilometer",convertValue:101.325},"kg/cm2/m":{name:"Kilogram per Square Centimeter per Meter",convertValue:98066.5},"kg/cm2/km":{name:"Kilogram per Square Centimeter per Kilometer",convertValue:98.0665},"barg/m":{name:"Bar Gauge per Meter",convertValue:1e5},"psig/ft":{name:"Pound per Square Inch Gauge per Foot",convertValue:22620.594793858265},"psig/m":{name:"Pound per Square Inch Gauge per Meter",convertValue:6894.76},"kg/cm2g/m":{name:"Kilogram per Square Centimeter Gauge per Meter",convertValue:98066.5},"kg/cm2g/km":{name:"Kilogram per Square Centimeter Gauge per Kilometer",convertValue:98.0665}}},Y=n(R),Q={baseUnit:"kg/Sm3",units:{"kg/Sm3":{name:"Kilogram per Standard Cubic Meter",convertValue:1},"g/Sm3":{name:"Gram per Standard Cubic Meter",convertValue:.001},"mg/Sm3":{name:"Milligram per Standard Cubic Meter",convertValue:1e-6},"kg/MSm3":{name:"Kilogram per Thousand Standard Cubic Meters",convertValue:1/1e3},"kg/MMSm3":{name:"Kilogram per Million Standard Cubic Meters",convertValue:1/1e6},"g/SCF":{name:"Gram per Standard Cubic Foot",convertValue:.001*35.3147},"lb/SCF":{name:"Pound per Standard Cubic Foot",convertValue:.453592*35.3147},"lb/MSCF":{name:"Pound per Thousand Standard Cubic Feet",convertValue:.453592*35.3147/1e3},"lb/MMSCF":{name:"Pound per Million Standard Cubic Feet",convertValue:.453592*35.3147/1e6},"kg/MMSCF":{name:"Kilogram per Million Standard Cubic Feet",convertValue:35.3147/1e6}}},X=n(Q),Z={baseUnit:"Sm3/m3",units:{"Sm3/m3":{name:"Standard Cubic Meter per Cubic Meter",convertValue:1},"Sm3/L":{name:"Standard Cubic Meter per Liter",convertValue:1e3},"SCF/m3":{name:"Standard Cubic Foot per Cubic Meter",convertValue:.3048**3},"SCF/gal":{name:"Standard Cubic Foot per US Gallon",convertValue:.3048**3/.003785411784},"SCF/bbl":{name:"Standard Cubic Foot per Barrel",convertValue:.3048**3/(42*.003785411784)},"MSCF/bbl":{name:"Thousand Standard Cubic Feet per Barrel",convertValue:.3048**3/(42*.003785411784)*1e3}}},x=n(Z),ee={baseUnit:"C",units:{C:{name:"Delta Celsius",convertValue:1},K:{name:"Delta Kelvin",convertValue:1},F:{name:"Delta Fahrenheit",convertValue:5/9},R:{name:"Delta Rankine",convertValue:5/9}}},ne=n(ee);e.acceleration=v,e.area=d,e.deltaTemperature=ne,e.density=g,e.electricCharge=h,e.electricCurrent=b,e.energy=f,e.force=S,e.length=P,e.mass=K,e.massFlow=F,e.massPerStandardVolume=X,e.power=y,e.pressure=w,e.pressureManometric=q,e.pressurePerLength=Y,e.speed=G,e.standardVolumePerVolume=x,e.standardVolumetricFlow=D,e.temperature=E,e.time=A,e.torque=B,e.viscosity=W,e.voltage=L,e.volume=H,e.volumetricFlow=J,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.d.ts
CHANGED
|
@@ -22,3 +22,5 @@ export { default as volumetricFlow } from './units/volumetric-flow';
|
|
|
22
22
|
export { default as temperature } from './units/temperature';
|
|
23
23
|
export { default as pressurePerLength } from './units/pressure-per-length';
|
|
24
24
|
export { default as massPerStandardVolume } from './units/mass-per-standard-volume';
|
|
25
|
+
export { default as standardVolumePerVolume } from './units/standard-volume-per-volume';
|
|
26
|
+
export { default as deltaTemperature } from './units/delta-temperature';
|
package/dist/types.d.ts
CHANGED
|
@@ -109,8 +109,11 @@ export type Speed = {
|
|
|
109
109
|
export type PowerUnits = {
|
|
110
110
|
'W': UnitsValues;
|
|
111
111
|
'kW': UnitsValues;
|
|
112
|
+
'MW': UnitsValues;
|
|
112
113
|
'hp': UnitsValues;
|
|
113
114
|
'BTU/h': UnitsValues;
|
|
115
|
+
'kBTU/h': UnitsValues;
|
|
116
|
+
'MMBTU/h': UnitsValues;
|
|
114
117
|
'cal/s': UnitsValues;
|
|
115
118
|
};
|
|
116
119
|
export type Power = {
|
|
@@ -312,6 +315,18 @@ export type MassPerStandardVolume = {
|
|
|
312
315
|
baseUnit: 'kg/Sm3';
|
|
313
316
|
units: MassPerStandardVolumeUnits;
|
|
314
317
|
};
|
|
318
|
+
export type StandardVolumePerVolumeUnits = {
|
|
319
|
+
'Sm3/m3': UnitsValues;
|
|
320
|
+
'Sm3/L': UnitsValues;
|
|
321
|
+
'SCF/m3': UnitsValues;
|
|
322
|
+
'SCF/gal': UnitsValues;
|
|
323
|
+
'SCF/bbl': UnitsValues;
|
|
324
|
+
'MSCF/bbl': UnitsValues;
|
|
325
|
+
};
|
|
326
|
+
export type StandardVolumePerVolume = {
|
|
327
|
+
baseUnit: 'Sm3/m3';
|
|
328
|
+
units: StandardVolumePerVolumeUnits;
|
|
329
|
+
};
|
|
315
330
|
export type TemperatureUnits = {
|
|
316
331
|
'C': UnitsValues;
|
|
317
332
|
'F': UnitsValues;
|
|
@@ -321,7 +336,17 @@ export type Temperature = {
|
|
|
321
336
|
baseUnit: 'C';
|
|
322
337
|
units: TemperatureUnits;
|
|
323
338
|
};
|
|
324
|
-
export type
|
|
339
|
+
export type DeltaTemperatureUnits = {
|
|
340
|
+
'C': UnitsValues;
|
|
341
|
+
'F': UnitsValues;
|
|
342
|
+
'K': UnitsValues;
|
|
343
|
+
'R': UnitsValues;
|
|
344
|
+
};
|
|
345
|
+
export type DeltaTemperature = {
|
|
346
|
+
baseUnit: 'C';
|
|
347
|
+
units: DeltaTemperatureUnits;
|
|
348
|
+
};
|
|
349
|
+
export type Measurement = Voltage | MassFlow | VolumetricFlow | Density | Viscosity | Length | Mass | Speed | Power | Energy | Area | Volume | Force | Torque | Time | ElectricCharge | ElectricCurrent | Acceleration | Pressure | PressureManometric | StandardVolumetricFlow | Temperature | PressurePerLength | MassPerStandardVolume | StandardVolumePerVolume | DeltaTemperature;
|
|
325
350
|
export type MeasurementUnits<T extends Measurement> = T extends {
|
|
326
351
|
units: infer U;
|
|
327
352
|
} ? keyof U : never;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DeltaTemperature } from '../types';
|
|
2
|
+
declare const _default: (val: number) => {
|
|
3
|
+
readonly _internalConverter: import("../internalConverter").default<DeltaTemperature>;
|
|
4
|
+
from<U extends keyof import("../types").DeltaTemperatureUnits>(fromUnit: U): {
|
|
5
|
+
readonly _internalConverter: import("../internalConverter").default<DeltaTemperature>;
|
|
6
|
+
to<U_1 extends keyof import("../types").DeltaTemperatureUnits>(toUnit: U_1): number;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type StandardVolumePerVolume } from '../types';
|
|
2
|
+
declare const _default: (val: number) => {
|
|
3
|
+
readonly _internalConverter: import("../internalConverter").default<StandardVolumePerVolume>;
|
|
4
|
+
from<U extends keyof import("../types").StandardVolumePerVolumeUnits>(fromUnit: U): {
|
|
5
|
+
readonly _internalConverter: import("../internalConverter").default<StandardVolumePerVolume>;
|
|
6
|
+
to<U_1 extends keyof import("../types").StandardVolumePerVolumeUnits>(toUnit: U_1): number;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|