growi-js

1.0.2 • Public • Published

Growi node.js SDK

This is a SDK for GROWI written in node.js.

Installation

$ npm install growi-js

Usage

Create a client

import { GROWI } from 'growi-js';
const growi = new GROWI({apiToken: 'YOUR_API_TOKEN'});

Initialize parameters are as follows:

Parameter Description
apiToken API token for GROWI. You can get it from the setting page of GROWI.
url URL of GROWI. Default is http://localhost:3000.
path Endpoint path of Growi API. Default is /.

Get root page

const page = await growi.root();
page instanceof growi.Page; // true

Get children of a page

const pages = await page.children();
pages[0] instanceof growi.Page; // true

Update page contents

page.contents('New contents');
await page.save();

Get contents of a page

const contents = await page.contents();

Create a page

const newPage = await page.create({name: 'New page'});

Remove a page

await page.remove();

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i growi-js

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

34.4 kB

Total Files

15

Last publish

Collaborators

  • moongift