1.2.22 • Published 5 years ago

chemicaltools v1.2.22

Weekly downloads
24
License
996ICU AND MIT
Repository
github
Last release
5 years ago

chemicaltools-js

996.icu License License Version codecov Downloads jsdelivr

Chemical Tools for JavaScript.

Installion

Install with npm

npm i chemicaltools

And you can use in Node.js:

chemicaltools = require('chemicaltools')

Use in a web page

Add script:

<script src="https://cdn.jsdelivr.net/npm/chemicaltools@latest/dist/main.js"></script>

Usage

console.log(JSON.stringify(chemicaltools.searchElement("Hf")));
// {"number":"72","name":"铪","symbol":"Hf","mass":"178.5","iupac":"Hafnium","origin":"Hafnia, the New Latin name for Copenhagen","pinyin":"ha","url":"https://i.loli.net/2018/03/31/5abf7a90c8da6.png"}
console.log(JSON.stringify(chemicaltools.calculateMass("C6H12O6")));
// {"name":"C6H12O6","mass":180.156,"peratom":[{"name":"氢","iupac":"Hydrogen","symbol":"H","atomnumber":12,"mass":"1.008","massper":6.714181043095984},{"name":"碳","iupac":"Carbon","symbol":"C","atomnumber":6,"mass":"12.01","massper":39.99866782122161},{"name":"氧","iupac":"Oxygen","symbol":"O","atomnumber":6,"mass":"16","massper":53.28715113568241}]}
console.log(JSON.stringify(chemicaltools.calculateGas(p = 3, V = 1, n = 1)));
// {"p":3,"V":1,"n":1,"T":0.36083714216983404}
console.log(JSON.stringify(chemicaltools.calculateAcid(0.1, [2, 7], true)));
// {"c":0.1,"pH":1.5683850420032601,"ion":[{"name":"H+","c":0.027015621187203295},{"name":"H2A","c":0.07298430582855843},{"name":"HA-","c":0.027015594171541573},{"name":"A2-","c":9.999989999984995e-8}]}
console.log(JSON.stringify(chemicaltools.calculateDeviation([2.232, 2.455, 2.742, 2.535, 2.362])));
// {"input":[2.232,2.455,2.742,2.535,2.362],"average":2.4652000000000003,"average_deviation":0.13864,"relative_average_deviation":0.05623884471848126,"standard_deviation":0.05160000000000009,"relative_standard_deviation":0.3721869590305834}
console.log(JSON.stringify(chemicaltools.makeQuestion("name", "iupac")));
// {"question":"铍","options":["Beryllium","Gallium","Lanthanum","Platinum"]}
console.log(JSON.stringify(chemicaltools.correctAnswer("铷", "Rubidiutm", "name", "iupac")));
// {"correct":false,"question":"铷","correct_answer":"Rubidium","answer":"Rubidiutm"}
1.2.22

5 years ago

1.2.21

5 years ago

1.2.19

5 years ago

1.2.20

5 years ago

1.2.18

5 years ago

1.2.17

5 years ago

1.2.16

5 years ago

1.2.15

5 years ago

1.2.14

5 years ago

1.2.13

5 years ago

1.2.12

5 years ago

1.2.10

6 years ago

1.2.11

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago