@mpickell810/temperature-converter 0.0.0-stage → 1.0.0
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/LICENSE +21 -0
- package/README.md +20 -2
- package/index.js +15 -0
- package/package.json +259 -4
- package/test.js +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michael Pickell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Temperature Converter Module
|
|
2
|
+
A simple Node.js module for converting temperatures between Fahrenheit and Celsius.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# Example Usage
|
|
5
|
+
```js
|
|
6
|
+
const { fahrenheitToCelsius, celsiusToFahrenheit }
|
|
7
|
+
= require ('@mpickell810/temperature-converter');
|
|
8
|
+
const celsius = fahrenheitToCelsius(100);
|
|
9
|
+
console.log(`100°F is ${celsius}°C`);
|
|
10
|
+
const fahrenheit = celsiusToFahrenheit(37);
|
|
11
|
+
console.log(`37°C is ${fahrenheit}°F`);
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
# Running Tests
|
|
15
|
+
To run tests and ensure the module is working as expected, navigate to the module's root directory and execute:
|
|
16
|
+
```sh
|
|
17
|
+
$ npm run test
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
#license
|
|
21
|
+
This project is liscensed under the MIT Liscense.
|
package/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Convert Fahrenheit to Celsius
|
|
2
|
+
function fahrenheitToCelsius (fahrenheit) {
|
|
3
|
+
return (fahrenheit - 32) * 5 / 9;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Convert Celsius to Fahrenheit
|
|
7
|
+
function celsiusToFahrenheit (celsius) {
|
|
8
|
+
return (celsius * 9 / 5) + 32;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Export the conversion functions
|
|
12
|
+
module.exports = {
|
|
13
|
+
fahrenheitToCelsius,
|
|
14
|
+
celsiusToFahrenheit
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,261 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpickell810/temperature-converter",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Converts temperatures between Fahrenheight and Celsius",
|
|
5
|
+
"homepage": "https://github.com/mpickell810/temperature-converter#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/mpickell810/temperature-converter/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/mpickell810/temperature-converter.git"
|
|
12
|
+
},
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"author": "",
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"main": "index.js",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"lint": "semistandard *.js",
|
|
19
|
+
"test": "node test.js"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"acorn": "^8.19.0",
|
|
23
|
+
"acorn-jsx": "^5.3.2",
|
|
24
|
+
"ajv": "^6.15.0",
|
|
25
|
+
"ansi-regex": "^5.0.1",
|
|
26
|
+
"ansi-styles": "^4.3.0",
|
|
27
|
+
"argparse": "^2.0.1",
|
|
28
|
+
"array-buffer-byte-length": "^1.0.2",
|
|
29
|
+
"array-includes": "^3.2.0",
|
|
30
|
+
"array.prototype.findlast": "^1.2.5",
|
|
31
|
+
"array.prototype.findlastindex": "^1.2.6",
|
|
32
|
+
"array.prototype.flat": "^1.3.3",
|
|
33
|
+
"array.prototype.flatmap": "^1.3.3",
|
|
34
|
+
"array.prototype.tosorted": "^1.1.4",
|
|
35
|
+
"arraybuffer.prototype.slice": "^1.0.4",
|
|
36
|
+
"async-function": "^1.0.0",
|
|
37
|
+
"available-typed-arrays": "^1.0.7",
|
|
38
|
+
"balanced-match": "^1.0.2",
|
|
39
|
+
"brace-expansion": "^1.1.21",
|
|
40
|
+
"builtins": "^5.1.0",
|
|
41
|
+
"call-bind": "^1.0.9",
|
|
42
|
+
"call-bind-apply-helpers": "^1.0.2",
|
|
43
|
+
"call-bound": "^1.0.4",
|
|
44
|
+
"callsites": "^3.1.0",
|
|
45
|
+
"chalk": "^4.1.2",
|
|
46
|
+
"color-convert": "^2.0.1",
|
|
47
|
+
"color-name": "^1.1.4",
|
|
48
|
+
"concat-map": "^0.0.1",
|
|
49
|
+
"cross-spawn": "^7.0.6",
|
|
50
|
+
"data-view-buffer": "^1.0.2",
|
|
51
|
+
"data-view-byte-length": "^1.0.2",
|
|
52
|
+
"data-view-byte-offset": "^1.0.1",
|
|
53
|
+
"debug": "^4.4.3",
|
|
54
|
+
"deep-is": "^0.1.4",
|
|
55
|
+
"define-data-property": "^1.1.4",
|
|
56
|
+
"define-properties": "^1.2.1",
|
|
57
|
+
"doctrine": "^3.0.0",
|
|
58
|
+
"dunder-proto": "^1.0.1",
|
|
59
|
+
"error-ex": "^1.3.4",
|
|
60
|
+
"es-abstract": "^1.24.2",
|
|
61
|
+
"es-abstract-get": "^1.0.0",
|
|
62
|
+
"es-define-property": "^1.0.1",
|
|
63
|
+
"es-errors": "^1.3.0",
|
|
64
|
+
"es-iterator-helpers": "^1.4.0",
|
|
65
|
+
"es-object-atoms": "^1.1.2",
|
|
66
|
+
"es-set-tostringtag": "^2.1.0",
|
|
67
|
+
"es-shim-unscopables": "^1.1.0",
|
|
68
|
+
"es-to-primitive": "^1.3.4",
|
|
69
|
+
"escape-string-regexp": "^4.0.0",
|
|
70
|
+
"eslint": "^8.57.1",
|
|
71
|
+
"eslint-config-semistandard": "^17.0.0",
|
|
72
|
+
"eslint-config-standard": "^17.0.0",
|
|
73
|
+
"eslint-config-standard-jsx": "^11.0.0",
|
|
74
|
+
"eslint-import-resolver-node": "^0.3.10",
|
|
75
|
+
"eslint-module-utils": "^2.14.0",
|
|
76
|
+
"eslint-plugin-es": "^4.1.0",
|
|
77
|
+
"eslint-plugin-import": "^2.32.0",
|
|
78
|
+
"eslint-plugin-n": "^15.7.0",
|
|
79
|
+
"eslint-plugin-promise": "^6.6.0",
|
|
80
|
+
"eslint-plugin-react": "^7.37.5",
|
|
81
|
+
"eslint-scope": "^7.2.2",
|
|
82
|
+
"eslint-utils": "^3.0.0",
|
|
83
|
+
"eslint-visitor-keys": "^3.4.3",
|
|
84
|
+
"espree": "^9.6.1",
|
|
85
|
+
"esquery": "^1.7.0",
|
|
86
|
+
"esrecurse": "^4.3.0",
|
|
87
|
+
"estraverse": "^5.3.0",
|
|
88
|
+
"esutils": "^2.0.3",
|
|
89
|
+
"fast-deep-equal": "^3.1.3",
|
|
90
|
+
"fast-json-stable-stringify": "^2.1.0",
|
|
91
|
+
"fast-levenshtein": "^2.0.6",
|
|
92
|
+
"fastq": "^1.20.3",
|
|
93
|
+
"file-entry-cache": "^6.0.1",
|
|
94
|
+
"find-up": "^5.0.0",
|
|
95
|
+
"flat-cache": "^3.2.0",
|
|
96
|
+
"flatted": "^3.4.4",
|
|
97
|
+
"for-each": "^0.3.5",
|
|
98
|
+
"fs.realpath": "^1.0.0",
|
|
99
|
+
"function-bind": "^1.1.2",
|
|
100
|
+
"function.prototype.name": "^1.2.0",
|
|
101
|
+
"functions-have-names": "^1.2.3",
|
|
102
|
+
"generator-function": "^2.0.1",
|
|
103
|
+
"get-intrinsic": "^1.3.0",
|
|
104
|
+
"get-proto": "^1.0.1",
|
|
105
|
+
"get-stdin": "^8.0.0",
|
|
106
|
+
"get-symbol-description": "^1.1.0",
|
|
107
|
+
"glob": "^7.2.3",
|
|
108
|
+
"glob-parent": "^6.0.2",
|
|
109
|
+
"globals": "^13.24.0",
|
|
110
|
+
"globalthis": "^1.0.4",
|
|
111
|
+
"gopd": "^1.2.0",
|
|
112
|
+
"graceful-fs": "^4.2.11",
|
|
113
|
+
"graphemer": "^1.4.0",
|
|
114
|
+
"has-bigints": "^1.1.0",
|
|
115
|
+
"has-flag": "^4.0.0",
|
|
116
|
+
"has-property-descriptors": "^1.0.2",
|
|
117
|
+
"has-proto": "^1.2.0",
|
|
118
|
+
"has-symbols": "^1.1.0",
|
|
119
|
+
"has-tostringtag": "^1.0.2",
|
|
120
|
+
"hasown": "^2.0.4",
|
|
121
|
+
"ignore": "^5.3.2",
|
|
122
|
+
"import-fresh": "^3.3.1",
|
|
123
|
+
"imurmurhash": "^0.1.4",
|
|
124
|
+
"inflight": "^1.0.6",
|
|
125
|
+
"inherits": "^2.0.4",
|
|
126
|
+
"internal-slot": "^1.1.0",
|
|
127
|
+
"is-array-buffer": "^3.0.5",
|
|
128
|
+
"is-arrayish": "^0.2.1",
|
|
129
|
+
"is-async-function": "^2.1.1",
|
|
130
|
+
"is-bigint": "^1.1.0",
|
|
131
|
+
"is-boolean-object": "^1.2.2",
|
|
132
|
+
"is-callable": "^1.2.7",
|
|
133
|
+
"is-core-module": "^2.18.0",
|
|
134
|
+
"is-data-view": "^1.0.2",
|
|
135
|
+
"is-date-object": "^1.1.0",
|
|
136
|
+
"is-document.all": "^1.0.0",
|
|
137
|
+
"is-extglob": "^2.1.1",
|
|
138
|
+
"is-finalizationregistry": "^1.1.1",
|
|
139
|
+
"is-generator-function": "^1.1.2",
|
|
140
|
+
"is-glob": "^4.0.3",
|
|
141
|
+
"is-map": "^2.0.3",
|
|
142
|
+
"is-negative-zero": "^2.0.3",
|
|
143
|
+
"is-number-object": "^1.1.1",
|
|
144
|
+
"is-path-inside": "^3.0.3",
|
|
145
|
+
"is-regex": "^1.2.1",
|
|
146
|
+
"is-set": "^2.0.3",
|
|
147
|
+
"is-shared-array-buffer": "^1.0.4",
|
|
148
|
+
"is-string": "^1.1.1",
|
|
149
|
+
"is-symbol": "^1.1.1",
|
|
150
|
+
"is-typed-array": "^1.1.15",
|
|
151
|
+
"is-weakmap": "^2.0.2",
|
|
152
|
+
"is-weakref": "^1.1.1",
|
|
153
|
+
"is-weakset": "^2.0.4",
|
|
154
|
+
"isarray": "^2.0.5",
|
|
155
|
+
"isexe": "^2.0.0",
|
|
156
|
+
"iterator.prototype": "^1.1.5",
|
|
157
|
+
"js-tokens": "^4.0.0",
|
|
158
|
+
"js-yaml": "^4.3.2",
|
|
159
|
+
"json-buffer": "^3.0.1",
|
|
160
|
+
"json-parse-better-errors": "^1.0.2",
|
|
161
|
+
"json-schema-traverse": "^0.4.1",
|
|
162
|
+
"json-stable-stringify-without-jsonify": "^1.0.1",
|
|
163
|
+
"json5": "^1.0.2",
|
|
164
|
+
"jsx-ast-utils": "^3.3.5",
|
|
165
|
+
"keyv": "^4.5.4",
|
|
166
|
+
"levn": "^0.4.1",
|
|
167
|
+
"load-json-file": "^5.3.0",
|
|
168
|
+
"locate-path": "^6.0.0",
|
|
169
|
+
"lodash.merge": "^4.6.2",
|
|
170
|
+
"loose-envify": "^1.4.0",
|
|
171
|
+
"math-intrinsics": "^1.1.0",
|
|
172
|
+
"minimatch": "^3.1.5",
|
|
173
|
+
"minimist": "^1.2.8",
|
|
174
|
+
"ms": "^2.1.3",
|
|
175
|
+
"natural-compare": "^1.4.0",
|
|
176
|
+
"node-exports-info": "^1.6.2",
|
|
177
|
+
"object-assign": "^4.1.1",
|
|
178
|
+
"object-inspect": "^1.13.4",
|
|
179
|
+
"object-keys": "^1.1.1",
|
|
180
|
+
"object.assign": "^4.1.7",
|
|
181
|
+
"object.entries": "^1.1.9",
|
|
182
|
+
"object.fromentries": "^2.0.8",
|
|
183
|
+
"object.groupby": "^1.0.3",
|
|
184
|
+
"object.values": "^1.2.1",
|
|
185
|
+
"once": "^1.4.0",
|
|
186
|
+
"optionator": "^0.9.4",
|
|
187
|
+
"own-keys": "^1.0.2",
|
|
188
|
+
"p-limit": "^3.1.0",
|
|
189
|
+
"p-locate": "^5.0.0",
|
|
190
|
+
"p-try": "^2.2.0",
|
|
191
|
+
"parent-module": "^1.0.1",
|
|
192
|
+
"parse-json": "^4.0.0",
|
|
193
|
+
"path-exists": "^4.0.0",
|
|
194
|
+
"path-is-absolute": "^1.0.1",
|
|
195
|
+
"path-key": "^3.1.1",
|
|
196
|
+
"path-parse": "^1.0.7",
|
|
197
|
+
"pify": "^4.0.1",
|
|
198
|
+
"pkg-conf": "^3.1.0",
|
|
199
|
+
"possible-typed-array-names": "^1.1.0",
|
|
200
|
+
"prelude-ls": "^1.2.1",
|
|
201
|
+
"prop-types": "^15.8.1",
|
|
202
|
+
"punycode": "^2.3.1",
|
|
203
|
+
"queue-microtask": "^1.2.3",
|
|
204
|
+
"react-is": "^16.13.1",
|
|
205
|
+
"reflect.getprototypeof": "^1.0.10",
|
|
206
|
+
"regexp.prototype.flags": "^1.5.4",
|
|
207
|
+
"regexpp": "^3.2.0",
|
|
208
|
+
"resolve": "^2.0.0-next.7",
|
|
209
|
+
"resolve-from": "^4.0.0",
|
|
210
|
+
"reusify": "^1.1.0",
|
|
211
|
+
"rimraf": "^3.0.2",
|
|
212
|
+
"run-parallel": "^1.2.0",
|
|
213
|
+
"safe-array-concat": "^1.1.4",
|
|
214
|
+
"safe-push-apply": "^1.0.0",
|
|
215
|
+
"safe-regex-test": "^1.1.0",
|
|
216
|
+
"semver": "^6.3.2",
|
|
217
|
+
"set-function-length": "^1.2.2",
|
|
218
|
+
"set-function-name": "^2.0.2",
|
|
219
|
+
"set-proto": "^1.0.0",
|
|
220
|
+
"shebang-command": "^2.0.0",
|
|
221
|
+
"shebang-regex": "^3.0.0",
|
|
222
|
+
"side-channel": "^1.1.1",
|
|
223
|
+
"side-channel-list": "^1.0.1",
|
|
224
|
+
"side-channel-map": "^1.0.1",
|
|
225
|
+
"side-channel-weakmap": "^1.0.2",
|
|
226
|
+
"standard-engine": "^15.1.0",
|
|
227
|
+
"stop-iteration-iterator": "^1.1.0",
|
|
228
|
+
"string.prototype.matchall": "^4.1.0",
|
|
229
|
+
"string.prototype.repeat": "^1.0.0",
|
|
230
|
+
"string.prototype.trim": "^1.2.11",
|
|
231
|
+
"string.prototype.trimend": "^1.0.10",
|
|
232
|
+
"string.prototype.trimstart": "^1.0.8",
|
|
233
|
+
"strip-ansi": "^6.0.1",
|
|
234
|
+
"strip-bom": "^3.0.0",
|
|
235
|
+
"strip-json-comments": "^3.1.1",
|
|
236
|
+
"supports-color": "^7.2.0",
|
|
237
|
+
"supports-preserve-symlinks-flag": "^1.0.0",
|
|
238
|
+
"text-table": "^0.2.0",
|
|
239
|
+
"tsconfig-paths": "^3.15.0",
|
|
240
|
+
"type-check": "^0.4.0",
|
|
241
|
+
"type-fest": "^0.20.2",
|
|
242
|
+
"typed-array-buffer": "^1.0.3",
|
|
243
|
+
"typed-array-byte-length": "^1.0.3",
|
|
244
|
+
"typed-array-byte-offset": "^1.0.5",
|
|
245
|
+
"typed-array-length": "^1.0.8",
|
|
246
|
+
"unbox-primitive": "^1.1.0",
|
|
247
|
+
"uri-js": "^4.4.1",
|
|
248
|
+
"which": "^2.0.2",
|
|
249
|
+
"which-boxed-primitive": "^1.1.1",
|
|
250
|
+
"which-builtin-type": "^1.2.1",
|
|
251
|
+
"which-collection": "^1.0.2",
|
|
252
|
+
"which-typed-array": "^1.1.24",
|
|
253
|
+
"word-wrap": "^1.2.5",
|
|
254
|
+
"wrappy": "^1.0.2",
|
|
255
|
+
"xdg-basedir": "^4.0.0",
|
|
256
|
+
"yocto-queue": "^0.1.0"
|
|
257
|
+
},
|
|
258
|
+
"devDependencies": {
|
|
259
|
+
"semistandard": "17.0.0"
|
|
260
|
+
}
|
|
261
|
+
}
|
package/test.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const assert = require('assert');
|
|
2
|
+
const { fahrenheitToCelsius, celsiusToFahrenheit } = require('./index');
|
|
3
|
+
|
|
4
|
+
// Test fahrenheitToCelsius
|
|
5
|
+
assert.strictEqual(fahrenheitToCelsius(32), 0, '32°F should be 0');
|
|
6
|
+
assert.strictEqual(fahrenheitToCelsius(212), 100, '212°F should be 100');
|
|
7
|
+
// Test celsiusToFahrenheit
|
|
8
|
+
assert.strictEqual(celsiusToFahrenheit(0), 32, '0°C should be 32');
|
|
9
|
+
assert.strictEqual(celsiusToFahrenheit(100), 212, '100°C should be 212');
|
|
10
|
+
console.log('All tests passed!');
|