Skip to content

Commit

Permalink
chore: Fix example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
kevee committed Jul 16, 2022
1 parent 1eef0c4 commit 0d8585d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,11 @@ yarn add @neaps/tide-prediction

## Importing

Using Ecmascript Imports:
You can import the module using Ecmascript, or CommonJS. Note that the CommonJS export is transpiled, so deep debugging the module that way will be difficult.

```js
import TidePrediction from '@neaps/tide-prediction'
```

Using CommonJS

```js
const TidePrediction = require('@neaps/tide-prediction')

// Before NodeJS version with conditional export support

const TidePrediction = require('@neaps/tide-prediction/dist/commonjs')
```

There are also packaged and minified versions for the browser in `dist/web`.
Expand Down Expand Up @@ -69,7 +60,10 @@ const constituents = [

const highLowTides = tidePrediction(constituents, {
phaseKey: 'phase_GMT'
}).getExtremesPrediction(new Date('2019-01-01'), new Date('2019-01-10'))
}).getExtremesPrediction({
start: new Date('2019-01-01'),
end: new Date('2019-01-10')
})
```

## Tide prediction object
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
"name": "@neaps/tide-predictor",
"version": "0.0.5",
"description": "Tide predictor",
"main": "",
"repository": "https://github.com/neaps/tide-predictor",
"author": "Kevin Miller <[email protected]>",
"license": "MIT",
"type": "module",
"module": "index.js",
"module": "./src/index.js",
"browser": "./dist/web/tide-predictor.js",
"commonjs": "./dist/commonjs/index.js",
"exports": {
Expand Down

0 comments on commit 0d8585d

Please sign in to comment.