Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/README #17

Merged
merged 2 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
30 changes: 28 additions & 2 deletions nodejs/README.md
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hackmd/api",
"version": "2.0.0-pre1",
"description": "HackMD/CodiMD Node.js API Client",
"description": "HackMD Node.js API Client",
"main": "dist/index.js",
"declaration": "./dist/index.d.ts",
"scripts": {
Expand All @@ -19,8 +19,12 @@
"README.md",
"LICENSE"
],
"author": "",
"license": "ISC",
"author": {
"name": "HackMD",
"email": "support@hackmd.io",
"url": "https://hackmd.io"
},
"license": "MIT",
"devDependencies": {
"@types/node": "^13.11.1",
"eslint": "^8.9.0",
Expand Down