diff --git a/README.md b/README.md index daa8b7d..90309c1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # HackMD API Clients +This repository contains a set of packages for interacting with the [HackMD API](https://hackmd.io/). + ## Node.JS See [README](./nodejs) diff --git a/nodejs/README.md b/nodejs/README.md index 6ee767f..1059900 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -1,11 +1,37 @@ # HackMD Node.js API Client +![npm](https://img.shields.io/npm/v/@hackmd/api) + +## About + +This is a Node.js client for the [HackMD API](https://hackmd.io/). + +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). + +For bugs and feature requests, please open an issue or pull request on [GitHub](https://github.com/hackmdio/api-client). + ## Installation ```bash npm install @hackmd/api --save ``` -## Usage +## Example + +```javascript +import HackMDAPI from '@hackmd/api' + +const client = new HackMDAPI('YOUR_ACCESS_TOKEN' /* required */, 'https://api.hackmd.io/v1' /* optional */) + +client.getMe().then(me => { + console.log(me.email) +}) +``` + +## API + +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. + +## License -TODO +MIT