simple-cw-node
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/simple-cw-node package

0.2.0 • Public • Published

simple-cw-node

A simple ChatWork API client for Node.js. ( UNOFFICIAL )

Installation

$ npm install simple-cw-node

Dependencies

API Document

Official API Document

RAML

Usage

The minimal you'll need to have is:

var CW = require('simple-cw-node'),
    client = CW();
 
// initialize.
client.init({
    token: 'YOUR_LEGACY_TOKEN'
});
 
// in the case of OAuth
client.init({
    type: 'oauth',
    token: 'YOUR_OAUTH_TOKEN',
})
 
// get your info.
client.get('me', function (err, res) {
    console.log(res.body);
});
 
// create room.
client.post('rooms', {
    name: 'room',
    members_admin_ids: '123456789,987654321',
    description: 'description'
}, function (err, res) {
    console.log('created.');
});

Deferred support

var CW = require('simple-cw-node'),
    client = CW(),
    Deferred = client.Deferred;
 
// initialize.
client.init({ token: 'YOUR_TOKEN' });
 
// get your info.
client
    .get('me')
    .done(function (res) {
        console.log(res.body)
    })
    .fail(function (err) {
        console.error(err);
    });

Author

Readme

Keywords

Package Sidebar

Install

npm i simple-cw-node

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

5.24 kB

Total Files

5

Last publish

Collaborators

  • astronaughts