thrustcurve-db 1.0.2 → 2.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/README.md +16 -38
- package/package.json +3 -3
- package/thrustcurve-db.d.ts +45 -27
- package/thrustcurve-db.json +188 -435
package/README.md
CHANGED
|
@@ -1,71 +1,49 @@
|
|
|
1
1
|
# thrustcurve-db
|
|
2
2
|
|
|
3
|
-
ThrustCurve.org model rocket motor data as a
|
|
4
|
-
utility functions).
|
|
3
|
+
ThrustCurve.org model rocket motor data as a single JSON file.
|
|
5
4
|
|
|
6
|
-
This module is a rebundling of the model rocket motor data found at John Coker's
|
|
7
|
-
[thrustcurve.org](https://thrustcurve.org) website ("TC"). It is available here
|
|
8
|
-
in JSON format, or as an ESM or CommonJS module.
|
|
5
|
+
This module is a rebundling of the model rocket motor data found at John Coker's [thrustcurve.org](https://thrustcurve.org) website ("TC"). It is available here in JSON format, or as an ESM or CommonJS module.
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
Data is pulled from the TC [/api/v1/search response](https://github.com/JohnCoker/thrustcurve3/blob/8bd8571fe0791fb9a68a6a96eb36c276d58c339b/config/api_v1.yml#L428-L526) API. For brevity, not all fields are included in the dataset here, however they can be added if requested. (Just file an issue).
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
See also, the included [TypeScript definition`](./thrustcurve.d.ts).
|
|
9
|
+
There is one additional field, `samples`, which is the actual thrust data as provided by the TC "/api/vi/download" endpoint. This is normalized to always have `[0, 0]` as the first data point. In cases where more than one sample file is available for a motor, the first "cert"(ified) data file is used. Otherwise it will be whichever data file the API returns first.
|
|
15
10
|
|
|
11
|
+
See also, the included [TypeScript definition](./thrustcurve.d.ts).
|
|
16
12
|
|
|
17
13
|
## Installation
|
|
18
14
|
|
|
19
15
|
```
|
|
20
16
|
npm i thrustcurve-db
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
... or with `yarn`:
|
|
24
|
-
```
|
|
25
17
|
yarn add thrustcurve-db
|
|
26
18
|
```
|
|
27
19
|
|
|
28
20
|
## Usage
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```js
|
|
33
|
-
import MOTORS from 'thrustcurve-db';
|
|
34
|
-
```
|
|
22
|
+
### Import with ESM or CommonJS:
|
|
35
23
|
|
|
36
|
-
... or for CommonJS:
|
|
37
24
|
```js
|
|
38
|
-
|
|
25
|
+
import MOTORS from "thrustcurve-db"; // ESM
|
|
26
|
+
const MOTORS = require("thrustcurve-db"); // CommonJS
|
|
39
27
|
```
|
|
40
28
|
|
|
41
|
-
|
|
29
|
+
Note: At present this requires you run `node` with the `--experimental-json-modules` flag
|
|
42
30
|
|
|
43
|
-
|
|
31
|
+
### Fetch from JSDelivr CDN:
|
|
44
32
|
|
|
45
33
|
```js
|
|
46
|
-
const MOTORS = await
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
... or to fetch from jsDelvr CDN:
|
|
50
|
-
|
|
51
|
-
```js
|
|
52
|
-
const MOTORS = await fetch('https://cdn.jsdelivr.net/npm/thrustcurve-db@latest/thrustcurve-db.json')
|
|
53
|
-
.then(res => res.json());
|
|
34
|
+
const MOTORS = await fetch(
|
|
35
|
+
"https://cdn.jsdelivr.net/npm/thrustcurve-db@latest/thrustcurve-db.json"
|
|
36
|
+
).then(res => res.json());
|
|
54
37
|
```
|
|
55
38
|
|
|
56
39
|
## Example
|
|
57
40
|
|
|
58
|
-
After importing (above)...
|
|
59
|
-
|
|
60
41
|
```js
|
|
61
42
|
// Find all J motors currently in production
|
|
62
|
-
MOTORS.filter(m => m.availability ===
|
|
43
|
+
MOTORS.filter(m => m.availability === "regular" && m.impulseClass === "J");
|
|
63
44
|
```
|
|
64
45
|
|
|
65
|
-
|
|
46
|
+
## Issues & Contributions
|
|
66
47
|
|
|
67
|
-
The data provided here is sourced from thrustcurve.org.
|
|
68
|
-
rocket data should be directed there. Any systematic problems or suggestions
|
|
69
|
-
for how the data here is presented may be [reported
|
|
48
|
+
The data provided here is sourced from thrustcurve.org. Omissions and errors in rocket data should be directed there. Any systematic problems or suggestions for how the data here is presented may be [reported
|
|
70
49
|
here](https://github.com/broofa/thrustcurve-db/issues).
|
|
71
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thrustcurve-db",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ThrustCurve.org model rocket motor and thrust curve data as a single JSON file",
|
|
6
6
|
"exports": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"thrustcurve-db.d.ts"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"prepare": "
|
|
19
|
-
"test": "
|
|
18
|
+
"prepare": "build/build.js > thrustcurve-db.json",
|
|
19
|
+
"test": "echo \"no tests\" && exit 1"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
package/thrustcurve-db.d.ts
CHANGED
|
@@ -1,31 +1,49 @@
|
|
|
1
|
-
type ThrustPoint = [
|
|
1
|
+
type ThrustPoint = [
|
|
2
|
+
number, // time (seconds)
|
|
3
|
+
number // thrust (Newtons)
|
|
4
|
+
];
|
|
2
5
|
|
|
3
6
|
export declare type Motor = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
7
|
+
availability: "regular" | "OOP";
|
|
8
|
+
avgThrustN: number;
|
|
9
|
+
burnTimeS: number;
|
|
10
|
+
certOrg: string;
|
|
11
|
+
commonName: string;
|
|
12
|
+
dataFiles: number;
|
|
13
|
+
delays: string;
|
|
14
|
+
designation: string;
|
|
15
|
+
diameter: number;
|
|
16
|
+
impulseClass:
|
|
17
|
+
| "A"
|
|
18
|
+
| "B"
|
|
19
|
+
| "C"
|
|
20
|
+
| "D"
|
|
21
|
+
| "E"
|
|
22
|
+
| "F"
|
|
23
|
+
| "G"
|
|
24
|
+
| "H"
|
|
25
|
+
| "I"
|
|
26
|
+
| "J"
|
|
27
|
+
| "K"
|
|
28
|
+
| "L"
|
|
29
|
+
| "M"
|
|
30
|
+
| "N"
|
|
31
|
+
| "O";
|
|
32
|
+
infoUrl: string;
|
|
33
|
+
length: number;
|
|
34
|
+
manufacturer: string;
|
|
35
|
+
manufacturerAbbrev: string;
|
|
36
|
+
maxThrustN: number;
|
|
37
|
+
motorId: string;
|
|
38
|
+
propInfo: string;
|
|
39
|
+
propWeightG: number;
|
|
40
|
+
samples?: ThrustPoint[];
|
|
41
|
+
sparky?: boolean;
|
|
42
|
+
totImpulseNs: number;
|
|
43
|
+
totalWeightG: number;
|
|
44
|
+
type: "SU" | "hybrid" | "reload";
|
|
45
|
+
updatedOn: string;
|
|
46
|
+
};
|
|
29
47
|
|
|
30
|
-
declare const MOTORS
|
|
48
|
+
declare const MOTORS: Array<Motor>;
|
|
31
49
|
export default MOTORS;
|