Skip to content

Commit

Permalink
docs: add usage
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Apr 22, 2023
1 parent 9383a9b commit d72ef88
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# simptrad

[![CI](https://github.com/yjl9903/simptrad/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/simptrad/actions/workflows/ci.yml)

简体字和繁体字转换。

## Usage

```bash
npm i simptrad
```

```ts
import { simpleToTrad, tradToSimple } from 'simptrad'

const t1 = `子曰:「学而时习之,不亦说乎?有朋自远方来,不亦乐乎?人不知,而不愠,不亦君子乎?」`
const t2 = `子曰:「學而時習之,不亦說乎?有朋自遠方來,不亦樂乎?人不知,而不慍,不亦君子乎?」`

console.log(simpleToTrad(t1))
console.log(tradToSimple(t2))
```

## License

MIT License © 2023 [XLor](https://github.com/yjl9903)

0 comments on commit d72ef88

Please sign in to comment.