engineering-unit-converter 0.0.1

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.
@@ -0,0 +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 G=Object.defineProperty;var W=(e,t,n)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var o=(e,t,n)=>(W(e,typeof t!="symbol"?t+"":t,n),n);class t{constructor(a,r){o(this,"_definitions");o(this,"_val");o(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(a),N=this._getUnit(this._fromUnit);return this._val*N/r}_getUnit(a){return this._definitions.units[a].convertValue}_checkUnit(a){const r=Object.keys(this._definitions.units);if(!r.includes(a))throw new Error(`Invalid unit "${a}". Available units: ${r.join(", ")}`)}}const n=c=>a=>new t(a,c),l=n({baseUnit:"m/s²",units:{"m/s²":{name:"Meter per Second Squared",convertValue:1},"km/s²":{name:"Kilometer per Second Squared",convertValue:1e6},"cm/s²":{name:"Centimeter per Second Squared",convertValue:1e-4},g:{name:"Gravity",convertValue:9.80665},"ft/s²":{name:"Foot per Second Squared",convertValue:.3048}}}),u={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.7639},sqyd:{name:"Square Yard",convertValue:1/1.19599},acre:{name:"Acre",convertValue:1/247105e-9},hectare:{name:"Hectare",convertValue:1/1e-4}}},m=n(u),i={baseUnit:"kg/m3",units:{"kg/m3":{name:"Kilogram per cubic meter",convertValue:1},"lb/ft3":{name:"Pound per cubic foot",convertValue:.0160185},"g/cm3":{name:"Gram per cubic centimeter",convertValue:.001},"kg/ft3":{name:"Kilogram per cubic foot",convertValue:1/16.0185},"lb/m3":{name:"Pound per cubic meter",convertValue:.0160185/1e3}}},s=n(i),v=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}}}),V=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}}}),d={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}}},p=n(d),h=n({baseUnit:"N",units:{N:{name:"Newton",convertValue:1},dyn:{name:"Dyne",convertValue:1e-5},lbf:{name:"Pound-force",convertValue:4.44822},kgf:{name:"Kilogram-force",convertValue:9.80665}}}),g=n({baseUnit:"m",units:{mm:{name:"Millimeter",convertValue:.001},cm:{name:"Centimeter",convertValue:.01},m:{name:"Meter",convertValue:1},in:{name:"Inch",convertValue:.0254},ft:{name:"Foot",convertValue:.3048}}}),b={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:453592e-9*(1/86400)},"g/s":{name:"Gram per second",convertValue:.001},"lb/h":{name:"Pound per hour",convertValue:453592e-9},"ton/day":{name:"Ton per day",convertValue:1e3*(1/86400)},"oz/min":{name:"Ounce per minute",convertValue:.0283495/60},"ton/year":{name:"Ton per year",convertValue:1e3/86400/365},"lb/s":{name:"Pound per second",convertValue:453592e-9},"kg/day":{name:"Kilogram per day",convertValue:1/86400}}},f=n(b),C=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}}}),M=n({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:3.41214},"cal/s":{name:"Calorie per second",convertValue:239.006}}}),y=n({baseUnit:"Pa",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}}}),S=n({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}}}),U={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:.3048/3600}}},P=n(U),k={baseUnit:"SCMD",units:{SCMD:{name:"Standard Cubic Meters per Day",convertValue:1},SCFD:{name:"Standard Cubic Feet per Day",convertValue:.00211888},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:.00211888*1e3},MMSCFD:{name:"Million Million Standard Cubic Feet per Day",convertValue:.00211888*1e6}}},w=n(k),$=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:.3048},"mN/m":{name:"Millinewton per Meter",convertValue:.001}}}),K=n({baseUnit:"s",units:{s:{name:"Second",convertValue:1},min:{name:"Minute",convertValue:60},hr:{name:"Hour",convertValue:3600},day:{name:"Day",convertValue:86400}}}),F={baseUnit:"cP",units:{cP:{name:"Centipoise",convertValue:1},"Pa·s":{name:"Pascal second",convertValue:.001},"lb·ft/s·h":{name:"Pound-foot per second-hour",convertValue:241909e-12},"kg/m·s·h":{name:"Kilogram per meter-second-hour",convertValue:.001/3600},"lb·ft/s·ft":{name:"Pound-foot per second-foot",convertValue:241909e-12/3600},"kg/m·s·m":{name:"Kilogram per meter-second-meter",convertValue:.001/3600/3600}}},q=n(F),_=n({baseUnit:"V",units:{V:{name:"Volt",convertValue:1},mV:{name:"Millivolt",convertValue:.001},kV:{name:"Kilovolt",convertValue:1e3}}}),D=n({baseUnit:"m³",units:{"m³":{name:"Cubic Meter",convertValue:1},liter:{name:"Liter",convertValue:.001},"cm³":{name:"Cubic Centimeter",convertValue:1e-6},"mm³":{name:"Cubic Millimeter",convertValue:1e-9},gallon:{name:"Gallon",convertValue:.00378541},quart:{name:"Quart",convertValue:946353e-9}}}),T={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:1/3600},"ft3/s":{name:"Cubic foot per second",convertValue:.0283168/3600},"gal/s":{name:"Gallon per second",convertValue:.00378541/3600}}},A=n(T);e.acceleration=l,e.area=m,e.density=s,e.electricCharge=v,e.electricCurrent=V,e.energy=p,e.force=h,e.length=g,e.mass=C,e.massFlow=f,e.power=M,e.pressure=S,e.pressureManometric=y,e.speed=P,e.standardVolumetricFlow=w,e.surfaceTension=$,e.time=K,e.viscosity=q,e.voltage=_,e.volume=D,e.volumetricFlow=A,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,21 @@
1
+ export { default as acceleration } from './units/acceleration';
2
+ export { default as area } from './units/area';
3
+ export { default as density } from './units/density';
4
+ export { default as electricCharge } from './units/electric-charge';
5
+ export { default as electricCurrent } from './units/electric-current';
6
+ export { default as energy } from './units/energy';
7
+ export { default as force } from './units/force';
8
+ export { default as length } from './units/length';
9
+ export { default as massFlow } from './units/mass-flow';
10
+ export { default as mass } from './units/mass';
11
+ export { default as power } from './units/power';
12
+ export { default as pressureManometric } from './units/pressure-manometric';
13
+ export { default as pressure } from './units/pressure';
14
+ export { default as speed } from './units/speed';
15
+ export { default as standardVolumetricFlow } from './units/standard-volumetric-flow';
16
+ export { default as surfaceTension } from './units/surface-tension';
17
+ export { default as time } from './units/time';
18
+ export { default as viscosity } from './units/viscosity';
19
+ export { default as voltage } from './units/voltage';
20
+ export { default as volume } from './units/volume';
21
+ export { default as volumetricFlow } from './units/volumetric-flow';
@@ -0,0 +1,258 @@
1
+ export type UnitsValues = {
2
+ name: string;
3
+ convertValue: number;
4
+ };
5
+ export type VoltageUnits = {
6
+ V: UnitsValues;
7
+ mV: UnitsValues;
8
+ kV: UnitsValues;
9
+ };
10
+ export type Voltage = {
11
+ baseUnit: 'V';
12
+ units: VoltageUnits;
13
+ };
14
+ export type MassFlowUnits = {
15
+ 'kg/s': UnitsValues;
16
+ 'kg/h': UnitsValues;
17
+ 'lb/day': UnitsValues;
18
+ 'g/s': UnitsValues;
19
+ 'lb/h': UnitsValues;
20
+ 'ton/day': UnitsValues;
21
+ 'oz/min': UnitsValues;
22
+ 'ton/year': UnitsValues;
23
+ 'lb/s': UnitsValues;
24
+ 'kg/day': UnitsValues;
25
+ };
26
+ export type MassFlow = {
27
+ baseUnit: 'kg/s';
28
+ units: MassFlowUnits;
29
+ };
30
+ export type VolumetricFlowUnits = {
31
+ 'm3/h': UnitsValues;
32
+ 'm3/day': UnitsValues;
33
+ 'ft3/h': UnitsValues;
34
+ 'ft3/day': UnitsValues;
35
+ 'gal/h': UnitsValues;
36
+ 'gal/day': UnitsValues;
37
+ 'm3/s': UnitsValues;
38
+ 'ft3/s': UnitsValues;
39
+ 'gal/s': UnitsValues;
40
+ };
41
+ export type VolumetricFlow = {
42
+ baseUnit: 'm3/h';
43
+ units: VolumetricFlowUnits;
44
+ };
45
+ export type DensityUnits = {
46
+ 'kg/m3': UnitsValues;
47
+ 'lb/ft3': UnitsValues;
48
+ 'g/cm3': UnitsValues;
49
+ 'kg/ft3': UnitsValues;
50
+ 'lb/m3': UnitsValues;
51
+ };
52
+ export type Density = {
53
+ baseUnit: 'kg/m3';
54
+ units: DensityUnits;
55
+ };
56
+ export type ViscosityUnits = {
57
+ cP: UnitsValues;
58
+ 'Pa·s': UnitsValues;
59
+ 'lb·ft/s·h': UnitsValues;
60
+ 'kg/m·s·h': UnitsValues;
61
+ 'lb·ft/s·ft': UnitsValues;
62
+ 'kg/m·s·m': UnitsValues;
63
+ };
64
+ export type Viscosity = {
65
+ baseUnit: 'cP';
66
+ units: ViscosityUnits;
67
+ };
68
+ export type LengthUnits = {
69
+ mm: UnitsValues;
70
+ cm: UnitsValues;
71
+ m: UnitsValues;
72
+ in: UnitsValues;
73
+ ft: UnitsValues;
74
+ };
75
+ export type Length = {
76
+ baseUnit: 'm';
77
+ units: LengthUnits;
78
+ };
79
+ export type MassUnits = {
80
+ kg: UnitsValues;
81
+ g: UnitsValues;
82
+ lb: UnitsValues;
83
+ oz: UnitsValues;
84
+ ton: UnitsValues;
85
+ };
86
+ export type Mass = {
87
+ baseUnit: 'kg';
88
+ units: MassUnits;
89
+ };
90
+ export type SpeedUnits = {
91
+ 'm/s': UnitsValues;
92
+ 'km/h': UnitsValues;
93
+ 'ft/s': UnitsValues;
94
+ 'mi/h': UnitsValues;
95
+ 'knot': UnitsValues;
96
+ 'm/h': UnitsValues;
97
+ 'ft/h': UnitsValues;
98
+ };
99
+ export type Speed = {
100
+ baseUnit: 'm/s';
101
+ units: SpeedUnits;
102
+ };
103
+ export type PowerUnits = {
104
+ 'W': UnitsValues;
105
+ 'kW': UnitsValues;
106
+ 'hp': UnitsValues;
107
+ 'BTU/h': UnitsValues;
108
+ 'cal/s': UnitsValues;
109
+ };
110
+ export type Power = {
111
+ baseUnit: 'W';
112
+ units: PowerUnits;
113
+ };
114
+ export type EnergyUnits = {
115
+ 'J': UnitsValues;
116
+ 'kJ': UnitsValues;
117
+ 'cal': UnitsValues;
118
+ 'kcal': UnitsValues;
119
+ 'Wh': UnitsValues;
120
+ 'kWh': UnitsValues;
121
+ 'BTU': UnitsValues;
122
+ };
123
+ export type Energy = {
124
+ baseUnit: 'J';
125
+ units: EnergyUnits;
126
+ };
127
+ export type AreaUnits = {
128
+ 'm2': UnitsValues;
129
+ 'km2': UnitsValues;
130
+ 'cm2': UnitsValues;
131
+ 'mm2': UnitsValues;
132
+ 'sqin': UnitsValues;
133
+ 'sqft': UnitsValues;
134
+ 'sqyd': UnitsValues;
135
+ 'acre': UnitsValues;
136
+ 'hectare': UnitsValues;
137
+ };
138
+ export type Area = {
139
+ baseUnit: 'm2';
140
+ units: AreaUnits;
141
+ };
142
+ export type VolumeUnits = {
143
+ 'm³': UnitsValues;
144
+ 'liter': UnitsValues;
145
+ 'cm³': UnitsValues;
146
+ 'mm³': UnitsValues;
147
+ 'gallon': UnitsValues;
148
+ 'quart': UnitsValues;
149
+ };
150
+ export type Volume = {
151
+ baseUnit: 'm³';
152
+ units: VolumeUnits;
153
+ };
154
+ export type ForceUnits = {
155
+ 'N': UnitsValues;
156
+ 'dyn': UnitsValues;
157
+ 'lbf': UnitsValues;
158
+ 'kgf': UnitsValues;
159
+ };
160
+ export type Force = {
161
+ baseUnit: 'N';
162
+ units: ForceUnits;
163
+ };
164
+ export type SurfaceTensionUnits = {
165
+ 'N/m': UnitsValues;
166
+ 'dyn/cm': UnitsValues;
167
+ 'lbf/ft': UnitsValues;
168
+ 'mN/m': UnitsValues;
169
+ };
170
+ export type SurfaceTension = {
171
+ baseUnit: 'N/m';
172
+ units: SurfaceTensionUnits;
173
+ };
174
+ export type TimeUnits = {
175
+ 's': UnitsValues;
176
+ 'min': UnitsValues;
177
+ 'hr': UnitsValues;
178
+ 'day': UnitsValues;
179
+ };
180
+ export type Time = {
181
+ baseUnit: 's';
182
+ units: TimeUnits;
183
+ };
184
+ export type ElectricChargeUnits = {
185
+ 'C': UnitsValues;
186
+ 'mC': UnitsValues;
187
+ 'μC': UnitsValues;
188
+ 'nC': UnitsValues;
189
+ 'pC': UnitsValues;
190
+ };
191
+ export type ElectricCharge = {
192
+ baseUnit: 'C';
193
+ units: ElectricChargeUnits;
194
+ };
195
+ export type ElectricCurrentUnits = {
196
+ 'A': UnitsValues;
197
+ 'mA': UnitsValues;
198
+ 'μA': UnitsValues;
199
+ 'nA': UnitsValues;
200
+ 'pA': UnitsValues;
201
+ };
202
+ export type ElectricCurrent = {
203
+ baseUnit: 'A';
204
+ units: ElectricCurrentUnits;
205
+ };
206
+ export type AccelerationUnits = {
207
+ 'm/s²': UnitsValues;
208
+ 'km/s²': UnitsValues;
209
+ 'cm/s²': UnitsValues;
210
+ 'g': UnitsValues;
211
+ 'ft/s²': UnitsValues;
212
+ };
213
+ export type Acceleration = {
214
+ baseUnit: 'm/s²';
215
+ units: AccelerationUnits;
216
+ };
217
+ export type PressureUnits = {
218
+ 'Pa': UnitsValues;
219
+ 'kPa': UnitsValues;
220
+ 'MPa': UnitsValues;
221
+ 'bar': UnitsValues;
222
+ 'atm': UnitsValues;
223
+ 'psi': UnitsValues;
224
+ 'kg/cm2': UnitsValues;
225
+ };
226
+ export type Pressure = {
227
+ baseUnit: 'Pa';
228
+ units: PressureUnits;
229
+ };
230
+ export type PressureManometricUnits = {
231
+ 'Pag': UnitsValues;
232
+ 'kPag': UnitsValues;
233
+ 'MPag': UnitsValues;
234
+ 'barg': UnitsValues;
235
+ 'atmg': UnitsValues;
236
+ 'psig': UnitsValues;
237
+ 'kg/cm2g': UnitsValues;
238
+ };
239
+ export type PressureManometric = {
240
+ baseUnit: 'Pa';
241
+ units: PressureManometricUnits;
242
+ };
243
+ export type StandardVolumetricFlowUnits = {
244
+ 'SCMD': UnitsValues;
245
+ 'SCFD': UnitsValues;
246
+ 'MSCMD': UnitsValues;
247
+ 'MMSCMD': UnitsValues;
248
+ 'MSCFD': UnitsValues;
249
+ 'MMSCFD': UnitsValues;
250
+ };
251
+ export type StandardVolumetricFlow = {
252
+ baseUnit: 'SCMD';
253
+ units: StandardVolumetricFlowUnits;
254
+ };
255
+ export type Measurement = Voltage | MassFlow | VolumetricFlow | Density | Viscosity | Length | Mass | Speed | Power | Energy | Area | Volume | Force | SurfaceTension | Time | ElectricCharge | ElectricCurrent | Acceleration | Pressure | PressureManometric | StandardVolumetricFlow;
256
+ export type MeasurementUnits<T extends Measurement> = T extends {
257
+ units: infer U;
258
+ } ? keyof U : never;
@@ -0,0 +1,11 @@
1
+ import { type Acceleration } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Acceleration;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").AccelerationUnits | null;
6
+ from<U extends keyof import("../types").AccelerationUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").AccelerationUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").AccelerationUnits): number;
9
+ _checkUnit(unit: keyof import("../types").AccelerationUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Area } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Area;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").AreaUnits | null;
6
+ from<U extends keyof import("../types").AreaUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").AreaUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").AreaUnits): number;
9
+ _checkUnit(unit: keyof import("../types").AreaUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Density } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Density;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").DensityUnits | null;
6
+ from<U extends keyof import("../types").DensityUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").DensityUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").DensityUnits): number;
9
+ _checkUnit(unit: keyof import("../types").DensityUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type ElectricCharge } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: ElectricCharge;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").ElectricChargeUnits | null;
6
+ from<U extends keyof import("../types").ElectricChargeUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").ElectricChargeUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").ElectricChargeUnits): number;
9
+ _checkUnit(unit: keyof import("../types").ElectricChargeUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type ElectricCurrent } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: ElectricCurrent;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").ElectricCurrentUnits | null;
6
+ from<U extends keyof import("../types").ElectricCurrentUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").ElectricCurrentUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").ElectricCurrentUnits): number;
9
+ _checkUnit(unit: keyof import("../types").ElectricCurrentUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Energy } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Energy;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").EnergyUnits | null;
6
+ from<U extends keyof import("../types").EnergyUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").EnergyUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").EnergyUnits): number;
9
+ _checkUnit(unit: keyof import("../types").EnergyUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Force } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Force;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").ForceUnits | null;
6
+ from<U extends keyof import("../types").ForceUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").ForceUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").ForceUnits): number;
9
+ _checkUnit(unit: keyof import("../types").ForceUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Length } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Length;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").LengthUnits | null;
6
+ from<U extends keyof import("../types").LengthUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").LengthUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").LengthUnits): number;
9
+ _checkUnit(unit: keyof import("../types").LengthUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type MassFlow } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: MassFlow;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").MassFlowUnits | null;
6
+ from<U extends keyof import("../types").MassFlowUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").MassFlowUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").MassFlowUnits): number;
9
+ _checkUnit(unit: keyof import("../types").MassFlowUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Mass } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Mass;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").MassUnits | null;
6
+ from<U extends keyof import("../types").MassUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").MassUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").MassUnits): number;
9
+ _checkUnit(unit: keyof import("../types").MassUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Power } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Power;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").PowerUnits | null;
6
+ from<U extends keyof import("../types").PowerUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").PowerUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").PowerUnits): number;
9
+ _checkUnit(unit: keyof import("../types").PowerUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type PressureManometric } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: PressureManometric;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").PressureManometricUnits | null;
6
+ from<U extends keyof import("../types").PressureManometricUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").PressureManometricUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").PressureManometricUnits): number;
9
+ _checkUnit(unit: keyof import("../types").PressureManometricUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Pressure } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Pressure;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").PressureUnits | null;
6
+ from<U extends keyof import("../types").PressureUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").PressureUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").PressureUnits): number;
9
+ _checkUnit(unit: keyof import("../types").PressureUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Speed } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Speed;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").SpeedUnits | null;
6
+ from<U extends keyof import("../types").SpeedUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").SpeedUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").SpeedUnits): number;
9
+ _checkUnit(unit: keyof import("../types").SpeedUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type StandardVolumetricFlow } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: StandardVolumetricFlow;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").StandardVolumetricFlowUnits | null;
6
+ from<U extends keyof import("../types").StandardVolumetricFlowUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").StandardVolumetricFlowUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").StandardVolumetricFlowUnits): number;
9
+ _checkUnit(unit: keyof import("../types").StandardVolumetricFlowUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type SurfaceTension } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: SurfaceTension;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").SurfaceTensionUnits | null;
6
+ from<U extends keyof import("../types").SurfaceTensionUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").SurfaceTensionUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").SurfaceTensionUnits): number;
9
+ _checkUnit(unit: keyof import("../types").SurfaceTensionUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Time } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Time;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").TimeUnits | null;
6
+ from<U extends keyof import("../types").TimeUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").TimeUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").TimeUnits): number;
9
+ _checkUnit(unit: keyof import("../types").TimeUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Viscosity } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Viscosity;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").ViscosityUnits | null;
6
+ from<U extends keyof import("../types").ViscosityUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").ViscosityUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").ViscosityUnits): number;
9
+ _checkUnit(unit: keyof import("../types").ViscosityUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Voltage } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Voltage;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").VoltageUnits | null;
6
+ from<U extends keyof import("../types").VoltageUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").VoltageUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").VoltageUnits): number;
9
+ _checkUnit(unit: keyof import("../types").VoltageUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Volume } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: Volume;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").VolumeUnits | null;
6
+ from<U extends keyof import("../types").VolumeUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").VolumeUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").VolumeUnits): number;
9
+ _checkUnit(unit: keyof import("../types").VolumeUnits): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type VolumetricFlow } from '../types';
2
+ declare const _default: (val: number) => {
3
+ readonly _definitions: VolumetricFlow;
4
+ readonly _val: number;
5
+ _fromUnit: keyof import("../types").VolumetricFlowUnits | null;
6
+ from<U extends keyof import("../types").VolumetricFlowUnits>(fromUnit: U): any;
7
+ to<U_1 extends keyof import("../types").VolumetricFlowUnits>(toUnit: U_1): number;
8
+ _getUnit(unit: keyof import("../types").VolumetricFlowUnits): number;
9
+ _checkUnit(unit: keyof import("../types").VolumetricFlowUnits): void;
10
+ };
11
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "engineering-unit-converter",
3
+ "repository": {
4
+ "type": "git",
5
+ "url": "https://github.com/alanhaertel/engineering-unit-converter"
6
+ },
7
+ "version": "0.0.1",
8
+ "type": "module",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "main": "./dist/engineering-unit-converter.umd.cjs",
13
+ "module": "./dist/engineering-unit-converter.js",
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/engineering-unit-converter.js",
17
+ "require": "./dist/engineering-unit-converter.umd.cjs",
18
+ "types": "./dist/index.d.ts"
19
+ }
20
+ },
21
+ "scripts": {
22
+ "dev": "vite",
23
+ "build": "tsc && vite build",
24
+ "preview": "vite preview"
25
+ },
26
+ "devDependencies": {
27
+ "@typescript-eslint/eslint-plugin": "^6.13.1",
28
+ "eslint": "^8.55.0",
29
+ "eslint-config-standard-with-typescript": "^40.0.0",
30
+ "eslint-plugin-import": "^2.29.0",
31
+ "eslint-plugin-n": "^16.3.1",
32
+ "eslint-plugin-promise": "^6.1.1",
33
+ "typescript": "^5.3.2",
34
+ "vite": "^5.0.0"
35
+ },
36
+ "dependencies": {
37
+ "@changesets/cli": "^2.27.1",
38
+ "vite-plugin-dts": "^3.6.4"
39
+ }
40
+ }