periodic-table-data-complete 1.0.0 → 1.1.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 +18 -3
- package/pTable.csv +120 -120
- package/pTable.json +11679 -11508
- package/package.json +30 -27
- package/scripts/ConvertJsToJson.js +6 -0
- package/scripts/ConvertJsonToCsv.js +12 -0
- package/src/pTable.js +176 -5
- package/src/pTableUnits.js +2 -2
package/package.json
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "periodic-table-data-complete",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "The definitive dataset for chemical elements.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/sweaver2112/periodic-table-data-complete.git"
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"periodic-table",
|
|
16
|
-
"chemical-elements",
|
|
17
|
-
"chemistry",
|
|
18
|
-
"data",
|
|
19
|
-
"json"
|
|
20
|
-
],
|
|
21
|
-
"author": "Scott Weaver",
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/sweaver2112/periodic-table-data-complete/issues"
|
|
25
|
-
},
|
|
26
|
-
"homepage": "https://github.com/sweaver2112/periodic-table-data-complete#readme"
|
|
27
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "periodic-table-data-complete",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "The definitive dataset for chemical elements.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/sweaver2112/periodic-table-data-complete.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"periodic-table",
|
|
16
|
+
"chemical-elements",
|
|
17
|
+
"chemistry",
|
|
18
|
+
"data",
|
|
19
|
+
"json"
|
|
20
|
+
],
|
|
21
|
+
"author": "Scott Weaver",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/sweaver2112/periodic-table-data-complete/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/sweaver2112/periodic-table-data-complete#readme",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"json-2-csv": "^5.6.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { json2csv } from "json-2-csv";
|
|
3
|
+
|
|
4
|
+
const data = JSON.parse(
|
|
5
|
+
fs.readFileSync("../pTable.json", "utf8")
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
const csv = await json2csv(data, {
|
|
9
|
+
sortHeader: true
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
fs.writeFileSync("../pTable.csv", csv + "\n");
|