Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
chore: update repl --script examples (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal authored Jun 8, 2023
1 parent dcfb2a8 commit 72342aa
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1382,17 +1382,35 @@ near repl --accountId example-acct.testnet
- Then try console logging `account` after the `>` prompt.

```bash
console.log(account)
> console.log(account)
```

Or in a JS files
```bash
near repl --accountId example-acct.testnet --script print_account.js
```

```js
module.exports.main = async function main({account, near, nearAPI, argv}) {
console.log(account);
}
```

or TS

```bash
near repl --accountId example-acct.testnet --script print_account.ts
```

```js
import { Context } from "near-cli/context"

export async function main({account, near, nearAPI, argv}: Context) {
console.log(account);
}
```


<details>
<summary><strong>Example Response</strong></summary>
<p>
Expand Down

0 comments on commit 72342aa

Please sign in to comment.