Skip to content

Commit c92b9d7

Browse files
committed
docs: update README
1 parent 1502895 commit c92b9d7

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# HackMD API Clients
22

3+
This repository contains a set of packages for interacting with the [HackMD API](https://hackmd.io/).
4+
35
## Node.JS
46

57
See [README](./nodejs)

nodejs/README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,37 @@
11
# HackMD Node.js API Client
22

3+
![npm](https://img.shields.io/npm/v/@hackmd/api)
4+
5+
## About
6+
7+
This is a Node.js client for the [HackMD API](https://hackmd.io/).
8+
9+
You can sign up for an account at [hackmd.io](https://hackmd.io/), and then create access tokens for your projects by following the [HackMD API documentation](https://hackmd.io/@hackmd-api/developer-portal).
10+
11+
For bugs and feature requests, please open an issue or pull request on [GitHub](https://github.com/hackmdio/api-client).
12+
313
## Installation
414

515
```bash
616
npm install @hackmd/api --save
717
```
818

9-
## Usage
19+
## Example
20+
21+
```javascript
22+
import HackMDAPI from '@hackmd/api'
23+
24+
const client = new HackMDAPI('YOUR_ACCESS_TOKEN' /* required */, 'https://api.hackmd.io/v1' /* optional */)
25+
26+
client.getMe().then(me => {
27+
console.log(me.email)
28+
})
29+
```
30+
31+
## API
32+
33+
See the [code](./src/index.ts) and [typings](./src/type.ts). The API client is written in TypeScript, so you can get auto-completion and type checking in any TypeScript Language Server powered editor or IDE.
34+
35+
## License
1036

11-
TODO
37+
MIT

0 commit comments

Comments
 (0)