cchook
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

ccHook

Usage

server

Build before use

git clone https://github.com/MamoruDS/ccHook.git
cd ccHook
npm install
npm run build

Start ccHook server

node dist/index.js --server
node dist/index.js --server --password='passwd' --port=80

Add a new user with alias

node dist/index.js --addUser='username'

client

npm i cchook

Use in your project

const { Client } = require('cchook')

const client = new Client({
    user: 'USER-AAAAAA-00000000000-AAAAAA',
    password: 'YOURPASSWD',
    address: 'http://127.0.0.1',
    port: 8030,
})

client.interval = 1000
client.timeout = 5000
client.start()

client.on('request', (data) => {
    console.log(data)
})

// type of data above
type Data = {
    request: {
        body: {
            [key: string]: string | number | boolean | null
        }
        headers: {
            [key: string]: string
        }
    }
}

License

MIT License copyright © 2020 MamoruDS

Readme

Keywords

none

Package Sidebar

Install

npm i cchook

Weekly Downloads

0

Version

0.1.5

License

MIT

Unpacked Size

60.8 kB

Total Files

32

Last publish

Collaborators

  • mamoruds