Skip to content

Commit ffda997

Browse files
authored
Merge pull request #17 from hackmdio/docs/README
Docs/README
2 parents 40638b3 + c92b9d7 commit ffda997

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
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

nodejs/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hackmd/api",
33
"version": "2.0.0-pre1",
4-
"description": "HackMD/CodiMD Node.js API Client",
4+
"description": "HackMD Node.js API Client",
55
"main": "dist/index.js",
66
"declaration": "./dist/index.d.ts",
77
"scripts": {
@@ -19,8 +19,12 @@
1919
"README.md",
2020
"LICENSE"
2121
],
22-
"author": "",
23-
"license": "ISC",
22+
"author": {
23+
"name": "HackMD",
24+
"email": "[email protected]",
25+
"url": "https://hackmd.io"
26+
},
27+
"license": "MIT",
2428
"devDependencies": {
2529
"@types/node": "^13.11.1",
2630
"eslint": "^8.9.0",

0 commit comments

Comments
 (0)