@bsgbryan/jyn

1.0.8 • Public • Published

NPM GitHub top language Travis (.com) branch Snyk Vulnerabilities for GitHub Repo GitHub last commit (branch)

Jyn

A simple, fun, fully asynchronous web socket server

Install

npm install -g @bsgbryan/jyn

Usage

jyn

That's it. Really.

For command options, execute jyn --help

Handling requests

jyn is built on Mädūl. It bootstraps and invokes the madul specified by the action property of the JSON web socket request, executes the method requested, and returns the results.

What does this look like in practice?

  1. mkdir ~/jyn_test && cd ~/jyn_test
  2. npm install -g wscat
  3. jyn
  4. echo 'const madul = { greet: ({ name }) => `Hello ${name}!` }\n' > ./casian.js
  5. wscat -c ws://localhost:1138
  6. {"action": "casian.greet", "name": "World"}

This should result in the response {"result": "Hello World!"}

Readme

Keywords

Package Sidebar

Install

npm i @bsgbryan/jyn

Weekly Downloads

9

Version

1.0.8

License

MIT

Unpacked Size

8.06 kB

Total Files

7

Last publish

Collaborators

  • bryanmaynard