thrustcurve-db 1.0.2 → 2.0.2
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 +18 -31
- package/package.json +3 -3
- package/thrustcurve-db.d.ts +45 -27
- package/thrustcurve-db.json +3014 -2817
package/README.md
CHANGED
|
@@ -1,71 +1,58 @@
|
|
|
1
1
|
# thrustcurve-db
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
utility functions).
|
|
3
|
+
This module is a rebundling of the model rocket motor data available on John Coker's excellent [thrustcurve.org](https://thrustcurve.org) website ("TC") as a stand-alone JSON file. The data is an array of motor items consistent with TC's [`SearchResponse#results` schema](https://app.swaggerhub.com/apis/JCSW7/thrust-curve_org_api/1.0.3#/SearchResponse).
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
[thrustcurve.org](https://thrustcurve.org) website ("TC"). It is available here
|
|
8
|
-
in JSON format, or as an ESM or CommonJS module.
|
|
5
|
+
See also, the included [TypeScript definitions](https://github.com/broofa/thrustcurve-db/blob/main/thrustcurve.d.ts).
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
### Alterations
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
In addition to the `SearchResponse` data, the following alterations have been made:
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
- All `number`s are rounded to a precision of 4 digits.
|
|
12
|
+
- Most (but not all) motors include a `samples` array containing the thrust data found in the TC `/api/vi/download` endpoint.
|
|
13
|
+
- `samples` data is normalized to insure the first data point is always `[0, 0]`
|
|
15
14
|
|
|
15
|
+
For full details of how this data set is compiled, please refer to the [`build/build.js`](https://github.com/broofa/thrustcurve-db/blob/main/build/build.js) script in this repository.
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
npm i thrustcurve-db
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
... or with `yarn`:
|
|
24
|
-
```
|
|
25
21
|
yarn add thrustcurve-db
|
|
26
22
|
```
|
|
27
23
|
|
|
28
24
|
## Usage
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
### ESM
|
|
31
27
|
|
|
32
28
|
```js
|
|
33
29
|
import MOTORS from 'thrustcurve-db';
|
|
34
30
|
```
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
### CommonJS
|
|
33
|
+
|
|
37
34
|
```js
|
|
38
35
|
const MOTORS = require('thrustcurve-db');
|
|
39
36
|
```
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Note: At present this requires you run `node` with the `--experimental-json-modules` flag
|
|
38
|
+
Note: Users running `node` may need to supply the [`--experimental-json-modules`](https://nodejs.org/docs/latest-v12.x/api/all.html#esm_experimental_json_modules) flag
|
|
44
39
|
|
|
45
|
-
|
|
46
|
-
const MOTORS = await import('thrustcurve-db');
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
... or to fetch from jsDelvr CDN:
|
|
40
|
+
### Fetch from JSDelivr CDN:
|
|
50
41
|
|
|
51
42
|
```js
|
|
52
|
-
const MOTORS = await fetch(
|
|
53
|
-
.
|
|
43
|
+
const MOTORS = await fetch(
|
|
44
|
+
'https://cdn.jsdelivr.net/npm/thrustcurve-db@latest/thrustcurve-db.json'
|
|
45
|
+
).then(res => res.json());
|
|
54
46
|
```
|
|
55
47
|
|
|
56
48
|
## Example
|
|
57
49
|
|
|
58
|
-
After importing (above)...
|
|
59
|
-
|
|
60
50
|
```js
|
|
61
51
|
// Find all J motors currently in production
|
|
62
52
|
MOTORS.filter(m => m.availability === 'regular' && m.impulseClass === 'J');
|
|
63
53
|
```
|
|
64
54
|
|
|
65
|
-
|
|
55
|
+
## Issues & Contributions
|
|
66
56
|
|
|
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
|
|
57
|
+
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
58
|
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.2",
|
|
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;
|