Skip to content

goofmint/growi-sdk-alpha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Growi node.js SDK

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

Installation

$ npm install @goofmint/growi-js

Usage

Create a client

import { GROWI } from '@goofmint/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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages