@neaps/tide-predictor 0.5.0 → 0.6.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 CHANGED
@@ -17,10 +17,10 @@ npm install @neaps/tide-predictor
17
17
 
18
18
  # Usage
19
19
 
20
- `@neaps/tide-predictor` requires that you [provide your own tidal harmonics information](#constituent-object) to generate a prediction. For a complete tide prediction solution, including finding nearby stations and their harmonics, check out the [`neaps` package](https://github.com/neaps/neaps).
20
+ `@neaps/tide-predictor` requires that you [provide your own tidal harmonics information](#constituent-object) to generate a prediction. For a complete tide prediction solution, including finding nearby stations and their harmonics, check out the [`neaps` package](https://github.com/openwatersio/neaps).
21
21
 
22
22
  ```typescript
23
- import TidePredictor from "@neaps/tide-predictor";
23
+ import { createTidePredictor } from "@neaps/tide-predictor";
24
24
 
25
25
  const constituents = [
26
26
  {
@@ -32,7 +32,7 @@ const constituents = [
32
32
  //....there are usually many, read the docs
33
33
  ];
34
34
 
35
- const highLowTides = TidePredictor(constituents).getExtremesPrediction({
35
+ const highLowTides = createTidePredictor(constituents).getExtremesPrediction({
36
36
  start: new Date("2019-01-01"),
37
37
  end: new Date("2019-01-10"),
38
38
  });
@@ -59,7 +59,7 @@ Returns the predicted high and low tides between a start and end date.
59
59
  ```typescript
60
60
  const startDate = new Date();
61
61
  const endDate = new Date(startDate + 3 * 24 * 60 * 60 * 1000);
62
- const tides = TidePredictor(constituents).getExtremesPrediction({
62
+ const tides = createTidePredictor(constituents).getExtremesPrediction({
63
63
  start: startDate,
64
64
  end: endDate,
65
65
  labels: {
@@ -73,7 +73,7 @@ const tides = TidePredictor(constituents).getExtremesPrediction({
73
73
  If you want predictions for a subservient station, first set the reference station in the prediction, and pass the [subservient station offests](#subservient-station) to the `getExtremesPrediction` method:
74
74
 
75
75
  ```typescript
76
- const tides = TidePredictor(constituents).getExtremesPrediction({
76
+ const tides = createTidePredictor(constituents).getExtremesPrediction({
77
77
  start: startDate,
78
78
  end: endDate,
79
79
  offset: {
@@ -116,7 +116,7 @@ High and low tides are returned as arrays of objects:
116
116
  Gives you the predicted water level at a specific time.
117
117
 
118
118
  ```typescript
119
- const waterLevel = TidePredictor(constituents).getWaterLevelAtTime({
119
+ const waterLevel = createTidePredictor(constituents).getWaterLevelAtTime({
120
120
  time: new Date(),
121
121
  });
122
122
  ```