1.0.8 • Published 5 years ago
@bsgbryan/jyn v1.0.8
Jyn
A simple, fun, fully asynchronous web socket server
Install
npm install -g @bsgbryan/jynUsage
jynThat'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?
mkdir ~/jyn_test && cd ~/jyn_testnpm install -g wscatjynecho 'const madul = { greet: ({ name }) => `Hello ${name}!` }\n' > ./casian.jswscat -c ws://localhost:1138{"action": "casian.greet", "name": "World"}
This should result in the response {"result": "Hello World!"}