Skip to content

Commit

Permalink
jsr.json and readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinta365 committed Mar 1, 2024
1 parent d439f7d commit 7ce3af6
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 12 deletions.
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
# OURA_API

[Deno](https://deno.land/x/oura_api) library to interact with v2 of the [Oura API](https://cloud.ouraring.com/v2/docs).
Library to interact with v2 of the [Oura API](https://cloud.ouraring.com/v2/docs).

The library is also available for Node.js via a [NPM package](https://www.npmjs.com/package/oura_api).
Available for **Deno** and **Bun** through [JSR Package](https://jsr.io/@pinta365/oura-api) and for Node.js via a [NPM package](https://www.npmjs.com/package/oura_api).
Deno users can also use the [deno.land/x package](https://deno.land/x/oura_api).

---

## Example usage

### Deno
### Deno and Bun

Change the import URL to include the latest version number. Example: `https://deno.land/x/[email protected]/mod.ts`
**Deno install notes**

Through JSR and imports map
```
deno add @pinta365/oura-api
import { Oura } from "@pinta365/oura-api";
```
Or directly from deno.land/x
```
import { Oura } from "https://deno.land/x/oura_api/mod.ts";
```

> [!NOTE]
>If you're importing the package from deno.land/x the example code will use the latest version but you should always change import URL
>to include a specific version number. Example: https://deno.land/x/[email protected]/mod.ts
---

**Bun Install notes**
```
bunx jsr add @pinta365/oura-api
import { Oura } from "@pinta365/oura-api";
```

```javascript
//from deno.land/x (Deno)
import { Oura, DateFormat } from "https://deno.land/x/oura_api/mod.ts";
//or from JSR (Deno and Bun)
//import { Oura, DateFormat } from "@pinta365/oura-api";


// Replace 'YOUR_ACCESS_TOKEN' with your actual access token
const accessToken = "YOUR_ACCESS_TOKEN";
Expand All @@ -36,6 +65,8 @@ try {
Install package.
```
npm install oura_api --save
const Api = require('oura_api');
```
Code example.
```javascript
Expand Down
9 changes: 2 additions & 7 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"name": "@pinta365/oura-api",
"version": "0.5.3",
"exports": "./mod.ts",
"exclude": [
"npm"
],
"tasks": {
"build_npm": "deno run -A scripts/build_npm.ts"
"build_npm": "deno run -A scripts/build_npm.ts",
"publish_jsr": "deno publish --config jsr.json"
},
"lint": {
"include": ["src"]
Expand Down
8 changes: 8 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@pinta365/oura-api",
"version": "0.5.5",
"exports": "./mod.ts",
"exclude": [
"scripts"
]
}
1 change: 0 additions & 1 deletion scripts/build_npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ await build({
//scriptModule: false,
test: false,
shims: {
undici: true,
deno: "dev",
},
package: {
Expand Down

0 comments on commit 7ce3af6

Please sign in to comment.