-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from hackmdio/develop
v2.0.0
- Loading branch information
Showing
9 changed files
with
3,019 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"no-trailing-spaces": ["warn", { "skipBlankLines": false }], | ||
"semi": ["warn", "never"], | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"keyword-spacing": ["warn", {"before": true, "after": true}], | ||
"space-infix-ops": "warn", | ||
"space-before-function-paren": "warn", | ||
"eol-last": ["error", "always"] | ||
}, | ||
"parserOptions": { | ||
"project": [ | ||
path.resolve(__dirname, "tsconfig.json") | ||
] | ||
}, | ||
"ignorePatterns": [ | ||
".eslintrc.js" | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,41 @@ | ||
# HackMD Node.js API Client | ||
|
||
 | ||
|
||
## 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). | ||
|
||
## **v2.0.0 Update Note** | ||
|
||
`v2.0.0` is a completely rewrite and is incompatible with `v1.x.x`. But the best of all, it does not require Node.JS runtime anymore, which means you can use it in a browser. We recommend you to upgrade to `v2.0.0` if you are using the old one. | ||
|
||
## 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 |
Oops, something went wrong.