Skip to content

Commit

Permalink
doc TS
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Sep 21, 2024
1 parent 81f8281 commit 023f227
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
- [TestCafe](#testcafe)
- [Selenium Webdriver](#selenium-webdriver)
- [Mocha](#mocha)
- [tsx](#tsx)
- [ts-node](#ts-node)
- [TypeScript](#typescript)
- [AVA](#ava)
- [Codecov](#codecov)
- [Codacy](#codacy)
Expand Down Expand Up @@ -776,8 +775,7 @@ mcr -c mcr.config.js -- sub-cli -c sub-cli.config.js

- Examples
- [Mocha](#mocha)
- [tsx](#tsx)
- [ts-node](#ts-node)
- [TypeScript](#typescript)
- [AVA](#ava)

## Config File
Expand Down Expand Up @@ -1034,19 +1032,22 @@ c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js
```sh
mcr mocha ./test/**/*.js
```
### [TypeScript](https://github.com/microsoft/typescript)
- [tsx](https://github.com/privatenumber/tsx)
```sh
cross-env NODE_OPTIONS="--import tsx" npx mcr tsx ./src/example.ts
cross-env NODE_OPTIONS="--import tsx" npx mcr mocha ./test/**/*.ts
# Node.js v20.6.0 +
mcr --import tsx tsx ./src/example.ts
mcr --import tsx mocha ./test/**/*.ts
```
- see [mcr-tsx](https://github.com/cenfun/mcr-tsx)
### [tsx](https://github.com/privatenumber/tsx)
- [ts-node](https://github.com/TypeStrong/ts-node)
```sh
mcr --import tsx tsx ./src/example.ts
cross-env NODE_OPTIONS="--loader ts-node/esm --no-warnings" npx mcr ts-node ./src/example.ts
cross-env NODE_OPTIONS="--loader ts-node/esm --no-warnings" npx mcr mocha ./test/**/*.ts
```
- see [mcr-tsx](https://github.com/cenfun/mcr-tsx)
### [ts-node](https://github.com/TypeStrong/ts-node)
- see [mcr-ts-node](https://github.com/cenfun/mcr-ts-node)
### [AVA](https://github.com/avajs/ava)
```sh
Expand Down
24 changes: 13 additions & 11 deletions README.zh-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
- [TestCafe](#testcafe)
- [Selenium Webdriver](#selenium-webdriver)
- [Mocha](#mocha)
- [tsx](#tsx)
- [ts-node](#ts-node)
- [TypeScript](#typescript)
- [AVA](#ava)
- [Codecov](#codecov)
- [Codacy](#codacy)
Expand Down Expand Up @@ -779,8 +778,7 @@ mcr -c mcr.config.js -- sub-cli -c sub-cli.config.js

- 参见例子
- [Mocha](#mocha)
- [tsx](#tsx)
- [ts-node](#ts-node)
- [TypeScript](#typescript)
- [AVA](#ava)

## Config File
Expand Down Expand Up @@ -1038,19 +1036,23 @@ c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js
```sh
mcr mocha ./test/**/*.js
```

### [TypeScript](https://github.com/microsoft/typescript)

- [tsx](https://github.com/privatenumber/tsx)
```sh
cross-env NODE_OPTIONS="--import tsx" npx mcr tsx ./src/example.ts
cross-env NODE_OPTIONS="--import tsx" npx mcr mocha ./test/**/*.ts
# Node.js v20.6.0 +
mcr --import tsx tsx ./src/example.ts
mcr --import tsx mocha ./test/**/*.ts
```
- see [mcr-tsx](https://github.com/cenfun/mcr-tsx)

### [tsx](https://github.com/privatenumber/tsx)
- [ts-node](https://github.com/TypeStrong/ts-node)
```sh
mcr --import tsx tsx ./src/example.ts
cross-env NODE_OPTIONS="--loader ts-node/esm --no-warnings" npx mcr ts-node ./src/example.ts
cross-env NODE_OPTIONS="--loader ts-node/esm --no-warnings" npx mcr mocha ./test/**/*.ts
```
- see [mcr-tsx](https://github.com/cenfun/mcr-tsx)

### [ts-node](https://github.com/TypeStrong/ts-node)
- see [mcr-ts-node](https://github.com/cenfun/mcr-ts-node)

### [AVA](https://github.com/avajs/ava)
```sh
Expand Down

0 comments on commit 023f227

Please sign in to comment.