npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodejs-chatwork

v0.0.5

Published

Chatwork module for node.js

Downloads

3

Readme

nodejs-chatwork

It's a chatwork module without Official API for Node.js. So there is no limitaion of number of function call.

Installation

npm install nodejs-chatwork

Usage

Initializing

var Chatwork = require('nodejs-chatwork');
var cw = new Chatwork();

cw.init({
    email:"{EMAIL}",
    password:"{PASSWORD}",
    oncomplete:function(info){

    },
    onerror:function(err){
    }
});

Caution: This module supports only login with email and password pair.

Watching chat rooms

cw.watch({
   oncomplete:function(){

   },
   onmessage:function(msgObj){
       switch(msgObj.type) {
           case 'messageAdded':
           // A message is added.

           break;
           case 'messageUpdated':
           // A message is updated(edited).

           break;
           case 'messageRemoved':
           // A message is removed.

           break;
           case 'taskAdded':
           // A task is added.

           break;
           case 'taskUpdated':
           // A task is updated(edited).

           break;
           case 'taskDone':
           // A task is done.

           break;
           case 'taskRemoved':
           // A task is removed.

           break;
           case 'roomInvited':
           // you are invited the room.

           break;
           case 'roomKicked':
           // you are kicked from the room or the room is removed.

           break;
           case 'roomInfoChanged':
           // A name or description of the room is changed.

           break;
           case 'roomMemberChanged':
           // members or a role of a member of the room is changed.

           break;
           default:
           // unknown message
       }

   },
   onerror:function(err){

   }
});

Messages Operations

Adding a message

cw.sendMessage({
    msg:{
        text:"{MESSAGE_TEXT}",
        room_id:{ROOM_ID}
    },
    oncomplete:function(status){

    },
    onerror:function(err){

    }
});

Gettng a message

cw.getMessage({
    message_id:{MESSAGE_ID},
    room_id:{ROOM_ID},
    oncomplete:function(message){

    },
    onerror:function(err){

    }
})

Tasks Operations

Adding a task

cw.addTask({
    task:{
        body:"{TASK_TEXT}",
        room_id:{ROOM_ID},
        to_ids:[{ASSIGNEE_ID1},{ASSIGNEE_ID2}, ...],
        limit:{
            year:{YEAR_OF_TASKLIMIT},
            month:{MONTH_OF_TASKLIMIT},
            date:{DATE_OF_TASKLIMIT}
        }
    },
    oncomplete:function(status){

    },
    onerror:function(err){

    }
});

If a limit property is null or undefined, a limit of new task is set to the day you invoke the method.

Getting a task

cw.getTask({
    task_id:{TASK_ID},
    room_id:{ROOM_ID},
    oncomplete:function(task){

    },
    onerror:function(err){

    }
});

Closing a task

cw.closeTask({
    task_id:{TASK_ID},
    oncomplete:function(status){

    },
    onerror:function(err){

    }
});

Getting tasks by status

// Getting MY tasks
cw.getMyTask({
    status:"{TASK_STATUS}", // "open" or "done"
    oncomplete:function(tasks){

    },
    onerror:function(err){

    }
});

Room Operations

Getting rooms

cw.getRooms({
    room_id:{ROOM_ID},
    oncomplete:function(Rooms){

    },
    onerror:function(err){

    }
});

Getting a Room

cw.getRoom({
    room_id:{ROOM_ID},
    oncomplete:function(room){

    },
    onerror:function(err){

    }
});

Getting Members in a room

cw.getMembers({
    room_id:{ROOM_ID},
    oncomplete:function(members){
    },
    onerror:function(err){

    }
});

Account information Operations

Getting Detail Account Infomations

cw.getDetailAccountInfo({
    aid:{ACCOUNT_ID},
    oncomplete:function(info){

    },
    onerror:function(err){

    }
})

Getting Detail MY Infomations

cw.getDetailMyInfo({
    oncomplete:function(info){

    },
    onerror:function(err){

    }
})

Getting contacts

cw.getContacts({
    oncomplete:function(contacts){

    },
    onerror:function(err) {

    }
});

Unimplemented operations.

  • Editing/Deleting messages
  • Editing/Deleting tasks
  • Creating/Updating/Deleting rooms
  • Uploading/Downloading/Deleting files
  • Adding/Requesting/Removing contacts