Skip to content

Commit

Permalink
docs: refactor examples
Browse files Browse the repository at this point in the history
  • Loading branch information
xseman committed Aug 23, 2024
1 parent c0485a7 commit 194e280
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 84 deletions.
2 changes: 1 addition & 1 deletion docs/examples/deno/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lock": false,
"tasks": {
"dev": "deno run --watch --allow-all --reload ./main.ts"
"dev": "deno run --watch --allow-all --reload --unstable-sloppy-imports ./main.ts"
}
}
5 changes: 0 additions & 5 deletions docs/examples/deno/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// import {
// CurrencyCode,
// encode,
// PaymentOptions,
// } from "../../../dist/index.js";
import {
CurrencyCode,
encode,
Expand Down
15 changes: 0 additions & 15 deletions docs/examples/express/package.json

This file was deleted.

Empty file.
20 changes: 0 additions & 20 deletions docs/examples/express/public/index.html

This file was deleted.

43 changes: 0 additions & 43 deletions docs/examples/express/server.ts

This file was deleted.

File renamed without changes.
33 changes: 33 additions & 0 deletions docs/examples/nodejs/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
CurrencyCode,
encode,
PaymentOptions,
} from "./../../../src/index.js";
// import {
// CurrencyCode,
// DataModel,
// encode,
// PaymentOptions,
// } from "bysquare";

const encoded = encode({
invoiceId: "random-id",
payments: [
{
type: PaymentOptions.PaymentOrder,
amount: 100.0,
bankAccounts: [
{ iban: "SK9611000000002918599669" },
],
currencyCode: CurrencyCode.EUR,
variableSymbol: "123",
beneficiary: {
name: "Filip",
city: "City",
street: "Street",
},
},
],
});

console.log(encoded);
13 changes: 13 additions & 0 deletions docs/examples/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"author": "Filip Seman",
"type": "module",
"scripts": {
"start": "node --no-warnings --loader=ts-node/esm ./main.ts"
},
"dependencies": {
"bysquare": "latest"
},
"devDependencies": {
"ts-node": "~10.9.0"
}
}

0 comments on commit 194e280

Please sign in to comment.